I don't understand the first description. For me we obtain :
0 1 2 3 4 5 6
-------------
0 1 0 1 0 1 0
0 0 1 0 0 1 0
0 0 0 1 1 1 0
So so PF-1(3) = 6.
Did I miss something ?
Jean-Marie: I think the phrase, "invert the substack" is the issue. For me, this means to take the substack and invert it as a unit. The coins exchange positions in the substack as well as inverting their values. It is a single physical action that translates into two separate operations on the coins. I may have done better to write, "flip the substack as a unit."
Thank you Everett.
Now I understand the second operation, but not the Nth operation (in the example) when you invert all the stack. It's OK between steps 5 and 6 and between steps 8 and 9, but not between steps 2 and 3 (1 0 0 -> 0 1 1 ?).
Jean-Marie: The transformation between steps 2 and 3 (1 0 0 -> 1 1 0) is the same as for the one between steps 8 and 9; we are working with the entire stack of 3 coins. The first/top coin exchanges with the last/bottom coin and then all coins change their orientation.
Every i-th step, imagine that we are picking the top i-coins with our fingers and fliping them upside down. That's FP-1. FP-2 does similar, but, instead of always picking the top i-coins, it alternates between top i-coins and bottom i+1-coins.
Remove all the words that end with "ain"
1292 Solvers
Least common multiple of many numbers
189 Solvers
Matrix with different incremental runs
106 Solvers
Return unique values without sorting
588 Solvers
Set some matrix elements to zero
290 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!