9

Given $k,p \in \mathbb N$, what's $$ \mathbb E(\min(a \bmod p,2a\bmod p,...,ka \bmod p)) $$ where $a$ is a random integer in $[0,p)$?


According to the simulation, I found the answer is roughly $\dfrac{p}{2k}$(or imprecisely speaking, $\Theta(p/k)$). Update: we can prove that it is $>p/2k$ when $p$ is prime.

In fact I want to know the asymptotic expansion of $$ {k \to \infty }, {p\to \infty} \mathbb E(a) $$ and it means $k<p$ but $k=\Theta(p)$(Thanks to @mathworker21's comment)


New discovery: when $k \ll p$, the expectation can be asymptotically given by the integral: $$ p \times \int _{0}^ 1 \min(\{x\},\{2x\},...,\{kx\}) \mathrm dx $$ but when $k = \Theta (p)$, the error will be large (even when $p \to \infty $)

FFjet
  • 5,041

2 Answers2

3

Seems like a tough question in full generality, and I have no answer, but merely ideas in very special cases, when taking limits of the parameters in a precise order.

So, if you wish to fix $k$ and let $p$ goes to infinity, then you will have the following convergence in distribution. I let $M_p$ be the random variable to be studied.

$$ \frac{M_p}{p} \Rightarrow \min({ \{j U\}, j = 1 \ldots k }) $$

where $U$ is uniform on $(0,1)$ and $\{x\}$ is the fractional part of $x$

You may compute explicitly the density of the RHS random variable for $k$ small. And you also have convergence of the expectations (since it is bounded).

Then, we want to let $p\to \infty$ and a first and interesting question would be to establish that there is a constant $C$ such that :

$$E[\min({ \{j U\}, j = 1 \ldots k })] \sim C/k$$

which is not obvious because of the very rigid relation between the random variables $(\{jU\}, j = 1 \ldots k).$ To start things and understand this law for a small fixed $k$, I recommend to plot the functions $$ x \mapsto x, x \mapsto \{2x\}, \ldots , x \mapsto \{kx\} $$ on a same graph and look at the shape of their min.

If you look at the part of the graph :

  • for $x$ between $[1-1/k, 1]$ then you find that for such $x=1-\epsilon$, $\epsilon \in [0,1/k)$

$$ \min( \{j(1-\epsilon)\}, j=1 \ldots k ) = 1-k \epsilon $$

  • more generally, for $x$ between $[2^{-j}(1-1/k), 2^{-j}]$ then you find that for such $x=2^{-j}-\epsilon$, $\epsilon \in [0,2^{-j}/k]$

$$ \min( \{j (2^{-j}-\epsilon) \}, j=1 \ldots k ) \ge 2^{-j}- k \epsilon $$

thus

$$E[\min({ \{j U\}, j = 1 \ldots k })] \ge (\sum_{j\ge 0} \frac{1}{2^{2j+1}} ) \frac{1}{k} = \frac{\pi^2}{12} \frac{1}{k} $$

Notice the above constant satifies $1/2<\frac{\pi^2}{12} < 1$. (I'm also interested in the comparison with $1$ because this is the right order for n iid uniform on $(0,1)$).

--

There are papers on CLT for such "rotations on the circle", that have considered as achievements in the field, you should check them; notice the min functional is arguably more difficult to deal with than the normalized sum that appear in the CLT.

Olivier
  • 1,191
1

I'll show the answer is $\frac{1}{2}\log(p)+O(1)$ when $k = \frac{p}{2}$, and $\frac{5}{6}\log(p)+O(1)$ when $k = \frac{p}{3}$.

For ease, I'll assume $p$ is prime. I'll also ignore $a=0$, which obviously is allowed.

Let's first greatly simplify the problem. Since $a \mapsto -a^{-1}$ is a bijection, the expectation is equivalent to \begin{align*} \mathbb{E}_{a \in \mathbb{Z}_p} \min(-a^{-1},-2a^{-1},\dots,-ka^{-1}) &= \mathbb{E}_{a \in \mathbb{Z}_p} \min\{j \ge 1 : j \equiv -a^{-1}x \text{ for some } x \in [k]\} \\ &= \mathbb{E}_{a \in \mathbb{Z}_p} \min\{j \ge 1 : ja \equiv -x \text{ for some } x \in [k]\} \\ &= \mathbb{E}_{a \in \mathbb{Z}_p} \min\{j \ge 1 : ja \in \{p-k,\dots,p-1\}\}. \end{align*}

So, if $k = \frac{p-1}{2}$, we obtain \begin{align*} \mathbb{E}_{a \in \mathbb{Z}_p} \min\{j \ge 1 : ja \in \{\frac{p+1}{2},\dots,p-1\}\} &= \frac{1}{p-1}\left[\sum_{a=1}^{(p-1)/2} \lceil \frac{(p+1)/2}{a} \rceil + \sum_{a=(p+1)/2}^{p-1} 1\right] \\ &= \frac{1}{p-1}\left[\sum_{a=1}^{(p-1)/2} [\frac{(p+1)/2}{a} + O(1)] + \frac{p}{2}+O(1)\right] \\& = \frac{1}{2}\log(p)+O(1). \end{align*}

Now take $k = \frac{p-1}{3}$, or $\frac{p-2}{3}$ if $p \equiv 2 \pmod{3}$ -- I'll just write $p/3$ for ease.

If $a \le \frac{p}{3}$, then since the "jumps" between $ja$ and $(j+1)a$ are at most $\frac{p}{3}$, we have $\min\{j : ja \in [\frac{2p}{3},p]\} = \lceil \frac{2p/3}{a} \rceil$. If $\frac{p}{3} \le a \le \frac{p}{2}$, then $2a \in [\frac{2p}{3},p]$. If $\frac{2p}{3} \le a \le p$, then $a \in [\frac{2p}{3},p]$. Take $a \in [\frac{p}{2},\frac{2p}{3}]$, and let $\Delta = a-\frac{p}{2}$. Then, for $j$ even, $ja \equiv j\Delta$, and for $j$ odd, $ja \equiv \frac{p}{2}+j\Delta$. Since $\Delta \le \frac{p}{6}$, $2\Delta \le \frac{p}{3}$, and so it can't be the case that $j\Delta$ to $(j+2)\Delta$ jumps over $[\frac{2p}{3},p]$. We therefore see that $\min\{j : ja \in [\frac{2p}{3},p]\} = \lceil \frac{p/6}{\Delta}\rceil$. Putting everything together, $$\mathbb{E}_{a \in \mathbb{Z}_p} \min\{j \ge 1 : ja \in [\frac{2p}{3},p]\} = \frac{1}{p}\left[\sum_{a=1}^{p/3} \lceil \frac{2p/3}{a} \rceil + \sum_{a=p/3}^{p/2} 2 + \sum_{a=p/2}^{2p/3} \lceil \frac{p/6}{a-p/2}\rceil + \sum_{a=2p/3}^p 1\right],$$ which gives $\frac{5}{6}\log(p)+O(1)$.

The analysis done above for $k = p/3$ becomes (seemingly) much more complicated for $k = p/N$ for larger $N$ (though $k=p/4,p/5$ might be easily doable). Definitely, though, the answer will be $c_N \log(p)+O(1)$ for some constant $c_N$ depending only on $N$.


The situation becomes complicated when $p$ is composite. I'll write $n$ instead of $p$ for psychological ease. Suppose $n$ is even, and set $k = \frac{n}{2}$. Take $a \in [n]$. If $g := \gcd(a,n)$ is bigger than $1$, then $a\frac{n}{g} \equiv 0 \pmod{n}$ and thus the min is $0$. The set of $a \in \mathbb{Z}_n$ with $\gcd(a,n) = 1$ is permuted under the (well-defined) operation $a \mapsto -a^{-1}$, and so, as done when $n$ was prime, we get \begin{align*} \mathbb{E}_{a \in \mathbb{Z}_n} \min(a,2a,\dots,\frac{n}{2}a) &= \frac{1}{n}\sum_{\substack{a \in \mathbb{Z}_n \\ (a,n) = 1}} \min(-a^{-1},-2a^{-1},\dots,-\frac{n}{2}a^{-1}) \\ &= \frac{1}{n}\sum_{\substack{a \in \mathbb{Z}_n \\ (a,n) = 1}} \min\{j \ge 1 : aj \in \{\frac{n}{2}+1,\dots,n-1\}\} \\ &= \frac{1}{n}\left[\sum_{\substack{a = 1 \\ (a,n) = 1}}^{n/2} \lceil \frac{n/2}{a} \rceil + \sum_{\substack{a = n/2 \\ (a,n) = 1}} 1 \right]. \end{align*} Now, \begin{align*} \sum_{\substack{a=1 \\ (a,n) = 1}}^{n/2} \frac{1}{a} &= \sum_{a=1}^{n/2} \frac{1}{a}\sum_{d \mid (a,n)} \mu(d) = \sum_{a=1}^{n/2}\frac{1}{a}\sum_{\substack{d \mid a \\ d \mid n}} \mu(d) \\ &= \sum_{d \mid n} \mu(d)\sum_{d \mid a \le \frac{n}{2}} \frac{1}{a} = \sum_{d \mid n} \mu(d)\sum_{k \le \frac{n}{2d}} \frac{1}{dk} \\ &= \sum_{d \mid n} \frac{\mu(d)}{d}\left[\log(\frac{n}{2d})+\gamma+O(\frac{2d}{n})\right]. \end{align*} We have $$\sum_{d \mid n} \frac{\mu(d)}{d}O(\frac{2d}{n}) = \sum_{d \mid n} O(\frac{1}{n}) = O(1)$$ $$\sum_{d \mid n} \frac{\mu(d)}{d}\gamma = \gamma\frac{\phi(n)}{n} = O(1)$$ $$\sum_{d \mid n} \frac{\mu(d)}{d}\log(\frac{n}{2d}) = \sum_{d \mid n} \frac{\mu(d)}{d}\log(\frac{n}{d})-\log(2)\frac{\phi(n)}{n}.$$ Therefore, $$\mathbb{E}_{a \in \mathbb{Z}_n} \min(a,2a,\dots,\frac{n}{2}a) = \frac{1}{2}\sum_{d \mid n} \frac{\mu(d)}{d}\log(n/d)+O(1).$$ There might be a closed form for this quantity, but I can't figure it out right now. It definitely varies highly based on the factorization of $n$. If $n$ is prime, it is asymptotic to $\frac{1}{2}\log(n)$, while if $n = 2p$ for a prime $p$, it is asymptotic to $\frac{1}{4}\log(n)$.

ADDED: See here. It implies $$\frac{1}{2}\sum_{d \mid n} \frac{\mu(d)}{d}\log(n/d)+O(1) = \frac{1}{2}\log(n)\sum_{d \mid n} \frac{\mu(d)}{d} +O(\log\log n) = \frac{1}{2}\log(n)\frac{\phi(n)}{n},$$ giving the result $$\mathbb{E}_{a \in \mathbb{Z}_n} \min(a,2a,\dots,\frac{n}{2}a) = \frac{1}{2}\log(n)\frac{\phi(n)}{n}+O(\log\log n).$$

mathworker21
  • 34,399