All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
Weird shuffling (Posted on 2020-11-29) Difficulty: 2 of 5
John has a deck of 52 cards, stacked in a pile with their backs facing up. He separates the small pile consisting of the seven cards on the top of the deck, turns it upside down, and places it at the bottom of the deck. All cards are again in one pile, but not all of them face down; the seven cards at the bottom do, in fact, face up. He repeats this move until all cards have their backs facing up again. In total, how many moves did John make?

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer verification | Comment 2 of 8 |
There seems to be a bug, and the answer is wrong. See later post.

All the cards need to be flipped an even number of times.

The GCD of 52 and 7 if 364, so 52 times John does this causes 364 flip of cards, each card having been flipped 7 times, which is an odd number. He has to do the procedure another 52 times to get them back to the starting position.

His move has to be made 104 times.

Computer simulation for verification:

while ~isequal(deck,deck0) | (ct==0)


>> weirdShuffle
ct =
I wish MATLAB would allow testing at the bottom of a loop rather than require it be at the top.   

Edited on November 29, 2020, 6:44 pm
  Posted by Charlie on 2020-11-29 15:40:07

Please log in:
Remember me:
Sign up! | Forgot password

Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Copyright © 2002 - 2021 by Animus Pactum Consulting. All rights reserved. Privacy Information