On Fri, 19 May 2017 08:24:32 +0000, James Waldby wrote:
> On Tue, 16 May 2017 00:53:49 -0700, glathoud_sub wrote:
>
>> Here is a particular way to construct a permutation of N elements, which is only feasible when N is a power of two:
http://www.glat.info/cipo/
>>
>> There seems to be a periodicity:
http://www.glat.info/cipo/#o1-as-a-permutation
>>
>> I'd be happy to hear comments, e.g. a simpler or shorter demo, related work, periodicity... whatever you have.
>
> Regarding the question of whether the permutation for N = 2^q has some
> periodicity, that will certainly always be the case, and it will always
> be not more than 2^N - 2 (as in, for example, the cases q = 2, 3, 4, 5.)
> Let CL_q denote the cycle length (ie the order or period of the
> permutation). Your webpage shows values of CL_2 ... CL_10.
> Values for CL_2 ... CL_26 are shown in the following table:
[snip]
> If there's a pattern for q>5 I don't know what it is.
>
> Here is the python 2.7 program that produced lines of the above table,
> in a couple minutes of computing:
[snip]
Following are some equivalent results, up to q=29, from a faster C
program that uses less memory. Note, to get the order of the whole
permutation, find the LCM of the separate cycle lengths. The C
program used int and long arithmetic which is too short to compute
the LCMs for q > 15.
3 cycles for q=2, 2^q=4 Lengths: 1 1 2
3 cycles for q=3, 2^q=8 Lengths: 1 1 6
3 cycles for q=4, 2^q=16 Lengths: 1 1 14
3 cycles for q=5, 2^q=32 Lengths: 1 1 30
5 cycles for q=6, 2^q=64 Lengths: 1 1 40 3 19
7 cycles for q=7, 2^q=128 Lengths: 1 1 48 3 55 14 6
5 cycles for q=8, 2^q=256 Lengths: 1 1 247 3 4
7 cycles for q=9, 2^q=512 Lengths: 1 1 488 3 6 6 7
5 cycles for q=10, 2^q=1024 Lengths: 1 1 818 47 157
5 cycles for q=11, 2^q=2048 Lengths: 1 1 1652 23 371
5 cycles for q=12, 2^q=4096 Lengths: 1 1 4060 25 9
9 cycles for q=13, 2^q=8192 Lengths: 1 1 3609 3754 412 321 79 12 3
11 cycles for q=14, 2^q=16384 Lengths: 1 1 15748 190 24 292 71 22 13 13 9
11 cycles for q=15, 2^q=32768 Lengths: 1 1 20161 11349 305 281 72 44 333 218 3
11 cycles for q=16, 2^q=65536 Lengths: 1 1 16759 20128 8072 17231 2377 579 295 60 33
15 cycles for q=17, 2^q=131072 Lengths: 1 1 85861 26603 9389 3365 3887 594 488 118 682 49 23 6 5
13 cycles for q=18, 2^q=262144 Lengths: 1 1 159827 89991 5465 5749 592 100 231 42 118 24 3
19 cycles for q=19, 2^q=524288 Lengths: 1 1 176243 35639 211265 28496 59029 4245 1239 6122 632 713 36 244 59 146 133 39 6
15 cycles for q=20, 2^q=1048576 Lengths: 1 1 620076 216520 131454 68118 1235 7535 1028 225 2111 213 36 20 3
17 cycles for q=21, 2^q=2097152 Lengths: 1 1 583840 993084 31835 87941 394263 3389 1648 459 273 8 306 10 35 45 14
21 cycles for q=22, 2^q=4194304 Lengths: 1 1 1487646 942359 429054 1119526 28806 64446 118037 3238 291 323 126 186 118 102 4 10 12 11 7
21 cycles for q=23, 2^q=8388608 Lengths: 1 1 2040680 2462220 2542051 1138236 93072 14243 45880 19664 16473 2160 6319 2917 514 1414 2598 19 23 118 5
19 cycles for q=24, 2^q=16777216 Lengths: 1 1 12137774 4004239 271250 253890 43860 4132 33597 25495 2575 67 35 157 116 4 6 8 9
17 cycles for q=25, 2^q=33554432 Lengths: 1 1 28169497 1019221 1401622 2552414 356682 10242 14735 8223 21006 135 566 45 15 21 6
17 cycles for q=26, 2^q=67108864 Lengths: 1 1 29360424 32223531 3530597 67418 809707 932310 83093 99109 248 248 1612 364 166 14 21
25 cycles for q=27, 2^q=134217728 Lengths: 1 1 87591110 34361487 3291274 3343185 3360928 353498 323522 1345478 158252 47767 17776 11159 84 5927 59 2343 2681 530 235 162 208 30 31
23 cycles for q=28, 2^q=268435456 Lengths: 1 1 232647749 5559122 24918738 197080 384941 3742461 525140 62977 48736 21684 278834 2721 1625 8993 16632 13525 3073 153 1262 3 5
23 cycles for q=29, 2^q=536870912 Lengths: 1 1 379598603 129063661 26279056 137686 665648 222289 483286 10615 41767 80276 94323 5066 106713 15498 59199 2699 2816 1579 113 10 7
real 0m53.153s
--
jiw