wu :: forums
« wu :: forums - Five Card Magic Trick »

Welcome, Guest. Please Login or Register.
Nov 26th, 2024, 2:20pm

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   hard
(Moderators: SMQ, Grimbal, ThudnBlunder, Icarus, towr, william wu, Eigenray)
   Five Card Magic Trick
« Previous topic | Next topic »
Pages: 1 2  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Five Card Magic Trick  (Read 17539 times)
Nicodemus
Guest

Email

Five Card Magic Trick  
« on: Jul 30th, 2002, 12:09am »
Quote Quote Modify Modify Remove Remove

5 Card Magic Trick
 
I don't have a solution for this one yet, but I think I'm on the right track. Can anyone offer advice?
 
Solution?
 
The audience member (C) selects five random cards from a deck of fifty-two (I'm assuming). From these five, Teller (A) chooses one card to give back and passes the remaining four to Penn (B). Grin
 
What can we infer from these four cards? I chose to use their relative ordering to convey information. For any four cards, we can designate them lowest (#1) to highest (#4) based on their rank; we can use the suit as a tiebreaker for cards of equal rank (e.g. spade-diamond-club-heat; thus 3 of clubs may be arbitrarily ranked below 3 of hearts). For CS geeks, think of the suit as extra low-order bits.
 
By converting our 4 arbitrary cards into an ordered sequence {#1,#2,#3,#4}, we can rearrange the sequence when stacking the cards. There are 24 permutations (4!) we could use; we arbitrarily number the possible permutations (and the magicians memorize the table -- yikes!). This is a fair amount of info, but not enough (AFAIK) to encode the fifth card's identity.
 
Note that we selected the fifth card randomly in this case. What if we made that selection intelligently such that we could encode one bit (literally) of information. This would require that we be able to select four cards (from any five in the deck) such that a property of the set of four is true or false. And I'm absolutely stumped trying to find it! Some sort of parity of face values, perhaps?  
 
Anyhow, if we assume that we can do that, then the selection of the fifth card (the one Teller passes back to the audience member) leaves behind one extra bit of information in the set of four cards. Combining that with our order premutation (which, recall, works for any four cards), we double our transmitted information to 48 possible values.
 
This is exactly the number of cards in the deck MINUS the four held by Penn. Too perfect! Thus we can find the fifth card by simply counting through all possible cards (2 spades, 2 diamonds, 2 clubs, 2 hearts, 3 spades,...) and skipping the four known ones. We can determine the hidden card's identity every time.
 
 
So... Can anyone figure out the missing property of the four cards? Please? Smiley
« Last Edit: Aug 28th, 2003, 7:43pm by Icarus » IP Logged
ScottP
Guest

Email

Re: Five Card Magic Trick  
« Reply #1 on: Jul 30th, 2002, 2:18am »
Quote Quote Modify Modify Remove Remove

If 'C' selects five cards then it is guaranteed that two of these will be of the same suit. So therefore the first card (bottom in the pile) that 'A' passes to 'B' can tell the suit.
 
However, this now leaves us only 3 cards/permutations (six values: 3!) to represent the value.
 
So how can six represent a number between 1 and 13..? Any ideas? Can the value of the first card be used in any way...?
IP Logged
Kozo Morimoto
Guest

Email

Re: Five Card Magic Trick  
« Reply #2 on: Jul 30th, 2002, 2:26am »
Quote Quote Modify Modify Remove Remove

Yeah, I've been thinking about this too, but the question is still vague.
 
"after looking at the 5 cards, A picks one of the 5 cards and gives it back to C."
 
So I asuume that the original 5 is random, but the 1 card that is given to C is NOT random out of the 5?
 
"A then arranges the other four cards in some way, and gives those 4 cards face down, in a neat pile, to B."
 
So the cards are passed to B face down and B isn't allowed to find out what the 4 cards are?  What is the definition of a neat pile?  Card stacked on top of each other?  Can the cards be stacked so that some cards are 'horizontal', some cards are 'vertical' and some cards are 'diagonal'?  Do they fit the 'neat pile' condition?
 
"B looks at these 4 cards and then determines what card is in C's hand (the missing 5th card)."
 
Does B get to find out the face value of the 4 cards, or does B just look at the 4 cards face down in the neat pile?
IP Logged
Frost
Newbie
*





   
Email

Posts: 14
Re: Five Card Magic Trick  
« Reply #3 on: Jul 30th, 2002, 2:33am »
Quote Quote Modify Modify

Magician A will always choose a card from the lower range of 24 cards. There's a 2.5% chance he can't though. (I may have miscalculated.) I'm still stuck on the complete solution.
 
Then again, magician A might 'be' left- or righthanded when he gives the cards to B. But that's real magician's trick, not a mathmagician's one.
 
IP Logged
ScottP
Guest

Email

Re: Five Card Magic Trick  
« Reply #4 on: Jul 30th, 2002, 3:47am »
Quote Quote Modify Modify Remove Remove

Hmm, just had another thought no two cards in the same suit - we know the card in 'C' hand and from my assumption above the 'first' card are the same suit - can be more than 6 apart if we loop round....? i.e. allow J, Q, K, A, 2, ...
 
But how do you get the direction?
IP Logged
Viorel Canja
Guest

Email

Re: Five Card Magic Trick  
« Reply #5 on: Jul 30th, 2002, 8:37am »
Quote Quote Modify Modify Remove Remove

A rule to transmit additional info would be nice Smiley , but there is a general solution . This can be interpreted as a bipartite matching problem. Consider 2 sets of nodes :
 
Set A: every node is assigned to a 5 cards set ( 52!/(5!*47!) )
Set B: every node is assigned to a 4 cards arrangement ( 52!/48! )
 
Every node from set A is the origin of 5*24 oriented edges pointing to the coresponding nodes in set B.
 
A and B need to agree on an algorithm and they can compute a common assignment table.The only problem with this solution is that it needs a lot of CPU power  Grin
IP Logged
NickH
Senior Riddler
****





   
WWW

Gender: male
Posts: 341
Re: Five Card Magic Trick  
« Reply #6 on: Jul 30th, 2002, 10:26am »
Quote Quote Modify Modify

Nicodemus,
 
I had worked out the same argument, and I too cannot find an intelligent selection to pass the extra bit!  We _could_ say that the way A places the pile of cards carries the information: lengthways is one value, breadthways another.  But that's going against the spirit of the problem -- though it would still make a neat trick!
 
Nick
IP Logged

Nick's Mathematical Puzzles
Nicodemus
Guest

Email

Re: Five Card Magic Trick  
« Reply #7 on: Jul 30th, 2002, 11:25am »
Quote Quote Modify Modify Remove Remove

Nick & Kozo-
 
The problem is a little vague, but I'm taking the descriptions of a neat pile and the denouncing of hand signals to indicate that no information is conveyed by the passing of the stack of cards. All of our information needs to be in the cards' identities.
 
I think Wu has this marked as a known solution; hopefully he'll chime in if I'm way off base on my reading of the puzzle! Smiley
 
 
Viorel-
 
I don't mind admitting that you're way over my head on the math, there. From what I can glean, though, it sounds like this isn't likely to be the intended solution?
 
 
Scott-
 
I like the idea of using the suits. I'll think more about this...
IP Logged
preiter
Newbie
*





   


Posts: 1
Re: Five Card Magic Trick  
« Reply #8 on: Jul 30th, 2002, 11:39am »
Quote Quote Modify Modify

If the back of the deck has a distinguishable up and down orientation, that could be used to convey 4 bits of information. That would give you the value of the card.
 
Then you could use the trick of handing back the duplicated suit and placing the suit in a particular place in the pile to communicate the suit.
IP Logged
kkw
Guest

Email

Re: Five Card Magic Trick  
« Reply #9 on: Jul 30th, 2002, 11:42am »
Quote Quote Modify Modify Remove Remove

Scott -  
  You're very close.  the first card suit is valuable, as is
its value. Think modulo 13.
IP Logged
Viorel Canja
Guest

Email

Re: Five Card Magic Trick  
« Reply #10 on: Jul 30th, 2002, 1:44pm »
Quote Quote Modify Modify Remove Remove

I think this works:
 
A and B agree on a common numbering scheme assigning numbers between 0 and 51 to the cards.
 
A sorts the cards ( those 5 that were chosen by C )
and finds those 2 adjacent cards ( when sorted and considering that the fifth is adjacent to the first ) that are separated by the the maximum distance ( the distance refers to the numbering scheme ) arbitrarily breaking ties.
 
A then removes the second card from the pair and encodes in the ordering of the remaining 4 cards a number equal to the distance from the removed card to the next card in the sorted list.
 
For example:
 
If the cards are 3 6 9 12 15 the pair with the greatest distance is 15 3. A extracts 3 . The number that has to be encoded is 6-3 = 3 .
 
The maximum number to encode is obtained in the following situation:
 
The cards are 0 24 48 49 50
Greatest distance 24 - 0
Encoded number 48-24 = 24
 
The encoded number cannot be 25 because the greatest distance would also be 25 and 53 cards would be required.
 
B obtains a number ( let's call it K ) between 1 and 24 from the ordering of the cards , then sorts the cards. B finds the pair that has the greatest distance ( there cannot be any ties because by eliminating that specific card A has ensured that the greatest distance will grow ). From the number of the second card in the pair B substracts K ( modulo 52 ) and finds the number of the missing card.
IP Logged
Nicodemus
Guest

Email

Re: Five Card Magic Trick  
« Reply #11 on: Jul 30th, 2002, 2:14pm »
Quote Quote Modify Modify Remove Remove

Viorel, I think you've solved it! I can't find a way to break your scheme and your argument for a maximum interval of 24 looks solid to me.
 
The trick is that we aren't encoding an extra bit of information via the selection of the fifth card. We're encoding where we count from.
IP Logged
NickH
Senior Riddler
****





   
WWW

Gender: male
Posts: 341
Re: Five Card Magic Trick  
« Reply #12 on: Jul 30th, 2002, 6:08pm »
Quote Quote Modify Modify

Aha!  I see now a solution based upon the ideas of ScottP and kkw, above.  I shouldn't be the one to post the solution.  I can only say its economy is every bit as elegant as that of Viorel's solution.
« Last Edit: Jul 30th, 2002, 6:14pm by NickH » IP Logged

Nick's Mathematical Puzzles
ScottP
Newbie
*





   


Posts: 3
Re: Five Card Magic Trick  
« Reply #13 on: Jul 30th, 2002, 11:09pm »
Quote Quote Modify Modify

Yup, worked out how to make my way work now Smiley. Forgot the fact that 'A' decides which card to give back to 'C' therefore I don't need another way to get that extra bit of information to give the direction. Therefore 'A' can always insure that counting up from the first card he gives 'B' returns the correct card, as these will always be a max of six apart. Nice trick, now to teach it to someone else I know and try it out on a few people!!
IP Logged
Nicodemus
Guest

Email

Re: Five Card Magic Trick  
« Reply #14 on: Jul 31st, 2002, 12:49am »
Quote Quote Modify Modify Remove Remove

ScottP-
 
I had to sit and ponder your post for a while but I did eventually get what you were saying! It definitely works. Two solutions!
 
Although if I had to pick one, I'd say yours (+kkw+NickH) is the best answer... The magicians need to memorize a much smaller table of permutations.  Grin
IP Logged
kkw
Guest

Email

Re: Five Card Magic Trick  
« Reply #15 on: Jul 31st, 2002, 5:51am »
Quote Quote Modify Modify Remove Remove

Viorel, I think I'm missing a piece to your soln.
 
given 0 1 2 3 4, hide 4 use 0 1 2 3 to encode 1? (3+1=4)
0 1 2 3 5, hide 5 use 0 1 2 3 to encode 2
0 1 2 3 6, hide 6 use 0 1 2 3 to encode 3
...
0 1 2 3 24, hide 24 use 0 1 2 3 to encode 21
 
so only using 4 cards, i have to be able to encode 21
possibilities? i need one more bit.
 
what did i miss?
IP Logged
Viorel Canja
Guest

Email

Re: Five Card Magic Trick  
« Reply #16 on: Jul 31st, 2002, 6:10am »
Quote Quote Modify Modify Remove Remove

Given 0 1 2 3 4 hide 0 because 0 is the second card in the pair.The encoded number is 1 ( the distance between the hidden card and the next card in the sorted list , in this case cards 0 and 1).
 
The first card in a pair has index i in the sorted list and the second has index (i+1)%5 . The indexes in the list are between 0 and 4 inclusively.
IP Logged
-D-
Guest

Email

Re: Five Card Magic Trick  
« Reply #17 on: Jul 31st, 2002, 10:13pm »
Quote Quote Modify Modify Remove Remove

I think I'm missing part of the solution from just reading.  
 
What I get is that you sort the cards and find the maximum distance (based on the numbering scheme) and remove that card.  The maximum distance has now increased by some value and we are to adjust the card order so that our partner can determine that value.  
 
that's pretty much the part I don't get, how from cards that are arbitrary although garenteed to be within a certain range of echother be encoded to pass that information?
-D-
IP Logged
Viorel Canja
Guest

Email

Re: Five Card Magic Trick  
« Reply #18 on: Aug 1st, 2002, 3:01am »
Quote Quote Modify Modify Remove Remove

4 cards can be arranged in 24 different ways ( 4! permutations ). Each ordering encodes a number between 1 and 24 .
IP Logged
kkw
Guest

Email

Re: Five Card Magic Trick  
« Reply #19 on: Aug 1st, 2002, 2:30pm »
Quote Quote Modify Modify Remove Remove

Viorel,
  Just wanted to let you know I finally "got" your soln. I had
to write it in perl to see it work, but sure enough, it is valid.
IP Logged
Lewis Jones
Newbie
*





   


Gender: male
Posts: 3
Re: Five Card Magic Trick  
« Reply #20 on: Aug 7th, 2002, 2:28pm »
Quote Quote Modify Modify

The 5 card magic trrick was put out many years ago, under the name Telephone Stud, by “Fitch” (Professor Fitch Cheney, Jnr, Chairman, Dept of Mathematics, University of Hartford, Hartford, CT).
 This was his solution. Select a suit that is represented more than once.  
Example: 2S 9C 7D QH 10S.  
Choose Spades. Imagine all 13 card values (from Ace to King) written in a circle, in clockwise ascending order. Mark the values of two of the Spades (in this case, 10 and 2). Focus on the shortest distance between these two values: this will never be more than six places around the circle. Moving clockwise along this short arc (10 J Q K A 2), note the end card of the sequence (2): this is to be your target card. Choose the beginning card of this sequence (10) as the first card to be transmitted.  
 This leaves three cards (9 7 Q), for coding the target card’s value. The number you code will be the shortest distance clockwise from the beginning to the end of the sequence (from 10 clockwise to 2 in this case). This distance is 5.  
 Think of the three remaining cards as LOW, MEDIUM, and HIGH values (their actual values don’t  matter). In this case, LOW = 7, MEDIUM = 9, and HIGH = Q. Select one of these to code the distance around the arc. LOW codes for 1 or 2. MEDIUM codes for 3 or 4. HIGH codes for 5 or 6.  
 In this case, choose the HIGH card to code for 5 or 6. Transmit this as the second card. Of the two remaining cards, transmit the lower value to indicate the lower value (5).  
 The full transmission sequence for this example is  
10S QC 7D 9C.
 The receiver notes that the suit of the first card transmitted is Spades: this tells him the suit of the target card. The second card transmitted (QH) is the highest of the final three, so the number being coded is 5 or 6. The third card is the lowest of the final two, so the number being secretly coded is 5.  
 He moves 5 places  around the circle from 10, and reaches 2. He now knows that the target card is the 2 of Spades.  
 Where there are duplicate values among the five chosen cards, allot priorities according to an agreed order of suits.  
 
IP Logged
william wu
wu::riddles Administrator
*****





   
WWW

Gender: male
Posts: 1291
132-card Variation on 5-card Magic Trick  
« Reply #21 on: Aug 7th, 2002, 4:07pm »
Quote Quote Modify Modify

Awesome! I'm interested in the history behind all these riddles. Thanks for the info.  
 
Have you heard of a 132 card variation of this same riddle? I heard that apparently you can pull off this same trick on a 132 card deck, using only 4 cards to encode a fifth. However, I don't know enough about this riddle to attack it. Particularly, what kind of cards does the 132 card set consist of? If we double a regular 52 card deck, we get 104 cards; what are the remaining 28 cards? Let me know if you know the details about such a variation ... maybe it's just a rumor.
IP Logged


[ wu ] : http://wuriddles.com / http://forums.wuriddles.com
icon
Guest

Email

Re: Five Card Magic Trick  
« Reply #22 on: Aug 8th, 2002, 1:43am »
Quote Quote Modify Modify Remove Remove

for more details read here  
http://people.brandeis.edu/~kleber/Papers/card.pdf
 
Smiley
IP Logged
Brian Quistorff
Guest

Email

Re: Five Card Magic Trick  
« Reply #23 on: Aug 23rd, 2002, 8:02pm »
Quote Quote Modify Modify Remove Remove

The solutions posted so far seem to be very neat and tidy, so how about one that is ugly and horendous. Roll Eyes.  While its true that with 4 distinct cards you can only encode 24 number s you can make this sufficient as long as you limit what cards that number could mean. For instance, if I tell you that the card is red and not either ace, a four card permutation is sufficient. Below, is an transition table, such that, from the resultant set of cards you are guaranteed to know 2 suites that has to belong to, and at least two cards from those suites that it isn't.
 
Possible START STATES (I list distinct suites one after each other):
5(of one suite):
->  4 (means go to the end state that has four cards of one suite).
 
4,1(four of one, and one of another):
if(4.same_color(1)) -> 4
else -> 3,1
 
3,2:
if(3.same_color(2)) -> 3,1
else ->2,2
 
3,1a,1b:
if(1a.same_color(1b)) -> 2,1,1
else -> (discarding any one with same color as 3) 3,1
 
2,2,1:
->discard from any 2 that has a diff color as 1) 2,1,1
 
2,1,1,1:
-> (discarding a 1 with same color as the two) 2,1,1
 
 
END STATES:
4:
 check(4.color())
 
3,1:
if(3.diff_color(1))
 check(3.color())
else
 check(1.suite());
 
2,1,1:
if(1a.same_color(1b))
 check(2.color());
else if(1a.diff_color(1b))
 check(1a.suite(), 1b.suite());
 
2,2:
// assert(2.diff_color(2))
check(2a.suite(), 2b.suite();
IP Logged
Fakrudeen
Guest

Email

Re: Five Card Magic Trick  
« Reply #24 on: Oct 10th, 2002, 3:09am »
Quote Quote Modify Modify Remove Remove

will this solution work?
number the cards from 0-51.
sum the 5 cards (values) chosen by C. This is S.
now order the cards from low to high. reverse the order of last two cards.now S%5  th card in the order will be given to the audience.  
Every permutation will be encoded into a number from 0-23.
remaining four cards will be encoded  using S%24 th permutation and given to B.
B can uniquely identify the card by finding a number h which satisfies (sum of remianing 4 cards + h) mod24 = permutation no.
It leaves the 3 cards to choose,say h1,h2 and h3.
But only one out of h1, h2, h3 will have S%5 equal to it's place in the order of cards.  
If we had used the low to high order, ambiguity will  
come with no.s  25 26 27 28 39 and 26 27 28 39 49.
so the order of last two was reversed.
 
example:
no.s  1 13 24 48 49
 
S=1+13+24+48+49=135
 
order the cards,
1 13 24 49 48
S%5=0
so remove first card with value 1. Remaining 13 24 49 48
 will be ordered with permutation no. 135%24=15
 
B will calculate (134+h)mod24 =15
 
h can be 1 , 25 or 49 but 135%5=0, 159%5=4 183%5=3
so it is 1. Shocked
IP Logged
Pages: 1 2  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board