The Faro shuffle is the perfect interweaving of cards. Quiz: How many Faro's returns a standard 52 deck to its start? Fifty four cards require 52 shuffles while 64 cards requires only 6 shuffles.
This challenge is to return the vectors of shuffle results until the original sequence is re-created.
Input: N (number of cards-even; start sequence 1:N)
Output: deck (Array of cards created by the Faro shuffles)
Example: N=4, deck= [1 3 2 4;1 2 3 4]
N=8, deck=[1 5 2 6 3 7 4 8;1 3 5 7 2 4 6 8;1 2 3 4 5 6 7 8 ]
Code Exclusions: regexp, str2num (enforced if necessary)
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers18
Suggested Problems
-
Check to see if a Sudoku Puzzle is Solved
341 Solvers
-
393 Solvers
-
"Low : High - Low : High - Turn around " -- Create a subindices vector
589 Solvers
-
Create a random logical vector of N elements of which M are true.
104 Solvers
-
Area of an equilateral triangle
6912 Solvers
More from this Author306
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!