Friday, 29 April 2016

magic - A five card trick - How does it work?


At a party last night, my friends Alice and Bob did a magic trick. Any ideas how it worked?


Alice shuffled a pack of cards, and asked me to take five. I looked at them. She put the rest of the pack down on the table. Alice asked for my cards. She gave four of them to Bob (he was across the table), and the fifth back to me. Bob looked at the four cards for a while. Then Bob looked at me, and named the card I was holding. He was right. I'm quite sure he couldn't have seen it (we weren't sitting by a mirror).


They did the trick again later to someone else. I watched for funny business. Alice didn't say anything to Bob, so I don't think they have a code. Also Alice is famously clumsy, so I doubt it was sleight of hand.




Edit to answer a question: I learnt the trick from a maths magazine several years ago. I don't know who invented it. "Michael Kleber. The best card trick. Mathematical Intelligencer 24 #1 (Winter 2002)"



Answer



I'm going to assume Alice looked at the cards and chose which one to give back to you. The key to the puzzle is then to encode a single card's suit and value in 4 cards without the luxury of choosing those 4 cards arbitrarily from the whole deck.


The suit is easy. In 5 cards there must be a double of at least one suit. So the first (or last, but I'll choose arbitrarily) card in the bunch she passes is the same suit as yours. Now there are three cards left to encode a number from 1 to 13. However Alice chose which card of your suit to pass to Bob and which to return to you. She can choose according to a rule that gets the number of possible cards down significantly.


The three passed cards can be designated small medium and large according to their number, and then breaking ties by suit order (clubs smallest, diamonds, hearts, spades as in bridge.) This gives six possible numbers to be represented by the 3 passed cards based on their order: SML, SLM, MLS, MSL, LSM, LMS.



So how does she choose which of the suit cards to pass and which to return? Bob will add the encoded number to the passed card (going around K-A-2 if need be) to get the returned card. Alice passes whichever card is within an add of 6.


Say you have the 2 and 4 of spades in your 5. She can't pass the 4 because no number between 1 and 6, added to 4, will wrap around to the 2. So she passes the 2 and encodes 2 in the other three cards by ordering them SLM. If you have the Q and K she passes the Q and encodes 1. If you have the 7 and K she passes the 7 and encodes 6. But 6 and K, she passes the K and encodes 6.


I've tried to find a set of cards you could choose, knowing this algorithm, that would make it impossible to perform the trick, and I can't. Not from a proper deck that doesn't have any duplicate cards.


No comments:

Post a Comment

Understanding Stagnation point in pitot fluid

What is stagnation point in fluid mechanics. At the open end of the pitot tube the velocity of the fluid becomes zero.But that should result...