Average of products of numbers taken from a finite field

72 Views Asked by At

There is this domain I'm working in, where you pick $r$ random integers between $0$ and $p-1$, inclusive. All calculations are done mod $p$. Then, you get all multiples of each number $x$ from $-a \cdot x$ to $a \cdot x$. Finally, you find all unique numbers of the form $c_1 x_1 + c_2 x_2 + \dots + c_r x_r$, where $c_k$ ranges from $-a$ to $a$.

Between all of the numbers there are $(2a+1)^r$ combinations, but not all of them are unique. I'm trying to model this distribution. For instance, I really need to know the average number of unique combinations, if I pick $r$ numbers and use the $2a+1$ powers for each of the $r$ numbers.

I really don't know how to start... I think that I might be able to use conditional probabilities. I would really appreciate some help.

EDIT 5/8/2020

Here I will show what happens for $p=7$, $r=2$ and $a=1$...

Here is a table with all of the different inputs to the problem:

$$\begin{array}{c|ccc} x & -1 x & 0 x & 1 x \\ \hline 0 & 0 & 0 & 0 \\ 1 & 6 & 0 & 1 \\ 2 & 5 & 0 & 2 \\ 3 & 4 & 0 & 3 \\ 4 & 3 & 0 & 4 \\ 5 & 2 & 0 & 5 \\ 6 & 1 & 0 & 6 \end{array}$$

You can see the different values of $-x$, $0x$, and $1x$ in the table for different $x$ values. Since $r=2$, we will add all possible values from $r=2$ of the rows in the table. Here is a second table that lists how many combinations are possible between a given row and column:

$$\begin{array}{c|ccccc} & 0 & 1 & 2 & 3 & 4 & 5 & 6 \\ \hline 0 & 1 & 3 & 3 & 3 & 3 & 3 & 3 \\ 1 & 3 & 5 & 7 & 7 & 7 & 7 & 5 \\ 2 & 3 & 7 & 5 & 7 & 7 & 5 & 7 \\ 3 & 3 & 7 & 7 & 5 & 5 & 7 & 7 \\ 4 & 3 & 7 & 7 & 5 & 5 & 7 & 7 \\ 5 & 3 & 7 & 5 & 7 & 7 & 5 & 7 \\ 6 & 3 & 5 & 7 & 7 & 7 & 7 & 5 \\ \end{array}$$

For example, if $x_1 = 2$ and $x_2 = 5$, row $2$ and column $5$ in the table says that there are 5 combinations. This comes from all 5 different sums from adding all combinations of the list

$$\{-1(2), 0(2), 1(2)\} \equiv \{5, 0, 2\}$$

with all combinations of the list

$$\{-1(5), 0(5), 1(5)\} \equiv \{2, 0, 5\}$$

i.e. We can get the numbers $\{0+0, 0+2, 5+5, 2+2, 5+0\} \equiv \{0,2,3,4,5\}$.

The final result in this example is that the average over all possible combinations is that the average is

$$\frac{265}{7 \cdot 7} = \frac{265}{49} \approx 5.40816$$

I hope this helps with understanding the problem, and thank you for your interest!