Talk:Factorial base numbers indexing permutations of a collection: Difference between revisions

Content added Content deleted
(minor correction and comment (hopefully correct))
(Undo revision 274032 by Craigd (talk))
Line 47: Line 47:


Starting with '''m=0''' and '''Ω''', an array of elements to be permutated, for each digit '''g'''
Starting with '''m=0''' and '''Ω''', an array of elements to be permutated, for each digit '''g'''
starting with the '''most''' significant digit in the factorial base number. Note: '''Ω''' is also indexed from most significant ('''Ω'''[0] is the left most digit).
starting with the '''most''' significant digit in the factorial base number.


* If '''g''' is greater than zero, rotate left the elements from '''m''' to '''m+g''' in '''Ω''' (see example)
* If '''g''' is greater than zero, rotate left the elements from '''m''' to '''m+g''' in '''Ω''' (see example)
Line 56: Line 56:
* Step 1: '''m=0 g=2'''; Rotate places 0 through 2 left. '''Ω''' becomes 2 0 1 3
* Step 1: '''m=0 g=2'''; Rotate places 0 through 2 left. '''Ω''' becomes 2 0 1 3
* Step 2: '''m=1 g=0'''; no action
* Step 2: '''m=1 g=0'''; no action
* Step 3: '''m=2 g=1'''; Rotate places 2 through 3 left. '''Ω''' becomes 2 0 3 1
* Step 3: '''m=2 g=1'''; Rotate places 3 through 3 left. '''Ω''' becomes 2 0 3 1


<br>
<br>