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 re: computer verification -- bug -- changed result | Comment 3 of 8 |
(In reply to computer verification by Charlie)

The code in the previous post actually represented flipping each card individually, but having the seventh card be the new bottom card, the sixth card above that. Actually in the procedure given, the first card would become the last and the seventh card would become the seventh from last. 


This apparently affects the results.

deck0=zeros(1,52);
deck=deck0;
ct=0;
while ~isequal(deck,deck0) | (ct==0)
   deck=[deck(8:52),1-fliplr(deck(1:7))];
   ct=ct+1;
   if ct==52 
      disp(deck) 
   end
end
ct

finds

ct =
   112


After 52 of the procedure, the deck is represented by

0001111000111100011110001111111000011100001110000111

where 0 represents a card in its original orientation and 1 represents a card in opposite orientation.

  Posted by Charlie on 2020-11-29 18:43:18
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
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

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