We know that expected cycle size of a random element in random permutation is $\frac {n+1}{2}$:
https://en.wikipedia.org/wiki/Random_permutation_statistics#Expected_cycle_size_of_a_random_element
But let's consider random set of n-bit random numbers of size $2^{n}$. Example, $n=6$:
$(_{ 29 \ \ 59 \ \ 62 \ \ 14 \ \ 58 \ \ 29 \ \ 1 \ \ 42 \ \ 0 \ \ 53 \ \ 41 \ \ 63 \ \ 53 \ \ 56 \ \ 48 \ \ 27 \ \ 45 \ \ 26 \ \ 32 \ \ 7 \ \ \ \ 0 \ \ \ \ 2 \ \ \ \ 53 \ \ 63 \ \ 56 \ \ 63 \ \ 28 \ \ 62 \ \ 3 \ \ \ \ 7 \ \ \ \ 4 \ \ \ \ 48 \ \ 35 \ \ 63 \ \ 15 \ \ 28 \ \ 26 \ \ 8 \ \ \ \ 7 \ \ \ \ 7 \ \ \ \ 31 \ \ 0 \ \ \ \ 62 \ \ 35 \ \ 33 \ \ 18 \ \ 14 \ \ 17 \ \ 2 \ \ \ \ 58 \ \ 35 \ \ 60 \ \ 48 \ \ 45 \ \ 54 \ \ 52 \ \ 61 \ \ 3 \ \ \ \ 14 \ \ 20 \ \ 63 \ \ 31 \ \ 17 \ \ 63 } ^{0 \ \ \ \ 1 \ \ \ \ 2 \ \ \ \ 3 \ \ \ \ 4 \ \ \ \ 5 \ \ \ \ 6 \ \ 7 \ \ \ \ 8 \ \ 9 \ \ \ \ 10 \ \ 11 \ \ 12 \ \ 13 \ \ 14 \ \ 15 \ \ 16 \ \ 17 \ \ 18 \ \ 19 \ \ 20 \ \ 21 \ \ 22 \ \ 23 \ \ 24 \ \ 25 \ \ 26 \ \ 27 \ \ 28 \ \ 29 \ \ 30 \ \ 31 \ \ 32 \ \ 33 \ \ 34 \ \ 35 \ \ 36 \ \ 37 \ \ 38 \ \ 39 \ \ 40 \ \ 41 \ \ 42 \ \ 43 \ \ 44 \ \ 45 \ \ 46 \ \ 47 \ \ 48 \ \ 49 \ \ 50 \ \ 51 \ \ 52 \ \ 53 \ \ 54 \ \ 55 \ \ 56 \ \ 57 \ \ 58 \ \ 59 \ \ 60 \ \ 61 \ \ 62 \ \ 63} )$
Starting from $29$ we have:
$29 \rightarrow 7 \rightarrow 42 \rightarrow 62 \rightarrow 17 \rightarrow 26 \rightarrow 28 \rightarrow 3 \rightarrow 14 \rightarrow 48 \rightarrow 2 \rightarrow 62$
So we end up with a cycle of length $8$ (after $3$ steps). Note that this is different from random permutation, because here numbers can repeat - we just draw them randomly.
- What is expected cycle lenght?
- What is expected number of steps/elements after which we will go into cycle (starting from random element)?
- What is probability, that we will get some small cycle of size m ($m<2^{n}$), starting from random element?
https://math.stackexchange.com/questions/2849169/expected-number-of-cycles-in-random-function
It looks like expected cycle lenght in set of size $n$ could be $\sqrt{\frac {n+1}{2}}$. It is close to my experimental results. But I can't explain this answer and don't understand much from cited topic.
– Tom Oct 01 '21 at 12:13https://www.pcg-random.org/posts/too-big-to-fail.html
Cycle lenght should be equal to $\sqrt(\pi \cdot \frac {N}{8})$.
– Tom Oct 02 '21 at 19:01