On 14 Sep 2002 at 12:32, Peter Wayner wrote:
It's also important to remember that there are many tricks that avoid making changes in the usual way. I'm currently very intrigued with the potential to rearrange lists of items. (You can try out an applet here: http://www.wayner.org/books/discrypt2/sorted.php)
There's an error in the way youconvert arrangements into numbers. On your page you have <quote> A Strange Notation Before beginning, we need to introduce one slightly strange notation, a flexible base, where the ith digit can be any value between 0 and i+1. The digits are enumerated from right to left so the smallest value, the one with the least significance on the right, is digit 0. It can be either a 0 or a 1. The next digit to its left, the one with next-to-least significance, is digit 1 and it can be either a 0, a 1, or a 2. Here's a value in the flexible base: 321. Each digit is set to it's maximum value. What is this value in base 10? To figure this out, first find the multiple assigned to each digit. That is, how much each digit contributes to the final value. In base 10, the multiple assigned to digit 1 is 10 and the multiple assigned to digit 2 is 100. To put it simply, the multiple of digit i is 10i in base ten and 2i in base two. What is the multiple of each digit in this flexible base? In the fixed bases, each digit's multiple increases by another factor of the base for each new digit. In this example, each digit has a different value. The 0 digit can only take two values, 0 or 1. The 1 digit can take three values, 0, 1 or 2. The multiple of digit i is (i+1)!. You can check it out. What is 321 in base ten? That's 1*(1!)+2*(2!)+3*(3!)=1+4+18=23. </quote> There's no reason for the factorials in the notation, the multiple of digit i should be i, not i!, so the value of any permutation of n items should be something from 0 to n!-1. for example, for 3 items what you should have is permutation value 123 0 132 1 213 2 231 3 312 4 321 5
I guess it's important not to let an obsessive attention to mathematical perfection prevent you from accomplishing something cool. After all, every RSA key can be factored eventually, but we still use the system because it's practically secure.
-Peter
George