|
|
back to board1 - 2 3 1 4 5 2 - 3 1 2 4 5 3 - 2 3 1 4 5 1 and 3 are same No, 3-1 2 3 4 5. The digit always mean index for the first line. but i can't find answer 3 with LCM? 2&3&1 is a loop with length 3 4 is a loop with length 1 5 is a loop with length 1 LCM(3,1,1)=3 2&3&1 is a loop with length 3 Edited by author 19.08.2010 16:11 ok.I understood. Edited by author 19.08.2010 16:21 Say it in this way: select an arbitraty number n, let i=n; while( P(i)!=n ) i=P(i); all the numbers "involved" makes a loop. in case 2 3 1 select n=2,i=2; P(i)=3 so i=3; P(i)=1 so i=2; now i=n, exit loop; You can prove the following statement: if a loop has X elements, then after exactly X permutations, every elements in the loop is on its proper position in EN. is that clear? Since you are very good in maths, you may prove it yourself. yes my math is good. But i begun to learn programming since 18. Due to it I am not very good at finding algorythm. Do you know really good book with examples for learning algorythms. Sorry I only know books written in Chinese. May be it is translation from English or Russian All I know are written by Chinese authors. cormen introduction to algorithms (pdf) Knuth and other) yes my math is good. But i begun to learn programming since 18. Due to it I am not very good at finding algorythm. Do you know really good book with examples for learning algorythms. |
|
|