Checksum of a set of real numbers I have a set of real numbers $a_i \in (-r, r)$ which can be represented as the tuple $(a_1, a_2, ..., a_n)$ where $n \in (5,10)$. I am searching for an algorithm to generate a checksum so that I can verify that none of the $a_i$'s have changed. The arithmetric operators I have available are addition, subtraction, multiplication, and division. The algorithm must ensure that all computed values are in the range $(-r, r)$.
The algorithms I have found are for detecting transmission errors of binary numbers or typing errors of e.g. social security numbers.
 A: Some of the algorithms like check digit algorithms can be adapted to be used here. For example you can compute
$$\frac{a_1}{2}+\frac{a_2}{4}+\frac{a_3}{8}+...+\frac{a_n}{2^n}.$$
Depending on how you define exponentials, this may or may not be within your constraints because powers of two can just be stored or computed as repeated multiplication. Also if your list is too long you may run into underflow. This method should keep you within your interval though. An easy variant is
$$\frac{a_1}{1}+\frac{a_2}{2}+\frac{a_3}{3}+...+\frac{a_n}{n}$$ and again if your numbers are evenly distributed around zero then this should stay inside your interval but in case it doesn't you can alternatively add and subtract.
Things like an idea of what $r$ is (how large or small is it), how many numbers in a typical list, if you are worried about overflow/underflow, are you using exact arithmetic or floating point stuff, do you want just error detection or do you want error correction as well, what kind of numbers are $a_n$ like are they all integers, unit fractions, rational numbers, and do you want to detect just change in magnitude of a number or a change in position as well like if two elements get swapped (i.e. is $\{1,2,3\}$ the same as $\{1,3,2\}$ or is it considered an "error" for you?) are all things to consider.
