Problem 2479. Mongean Shuffle
A Mongean shuffle of an n card deck starts with putting the initial deck on the left hand side.
- The top card of the deck is taken and put on the right hand side.
- The second card from the deck on left is taken and put on top of right deck.
- The third card is taken from the left and and put at the bottom of the right deck.
- The fourth card is put on top of right deck.
- The fifth card is put at the bottom of right deck.
This process is continued until all the cards on left are transferred to the right.
The initial state of the cards will be given. Return the state after this shuffle.
Solution Stats
Problem Comments
-
2 Comments
See video on Youtube
http://www.youtube.com/watch?v=dVOJMiyVpWA
If even cards from the deck on left are taken and put on top of right deck, you inverse the correct order. No ?
Solution Comments
Show commentsProblem Recent Solvers89
Suggested Problems
-
Find third Side of a right triangle given hypotenuse and a side. No * - or other functions allowed
245 Solvers
-
Find nearest prime number less than input number
880 Solvers
-
711 Solvers
-
475 Solvers
-
Find the sides of an isosceles triangle when given its area and height from its base to apex
2072 Solvers
More from this Author44
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!