wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> hard >> Five Card Magic Trick
(Message started by: Nicodemus on Jul 30th, 2002, 12:09am)

Title: Five Card Magic Trick
Post by Nicodemus on Jul 30th, 2002, 12:09am
5 Card Magic Trick (http://www.ocf.berkeley.edu/~wwu/riddles/hard.shtml#5cardTrick)

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). ;D

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? :)

Title: Re: Five Card Magic Trick
Post by ScottP on Jul 30th, 2002, 2:18am
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...?

Title: Re: Five Card Magic Trick
Post by Kozo Morimoto on Jul 30th, 2002, 2:26am
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?

Title: Re: Five Card Magic Trick
Post by Frost on Jul 30th, 2002, 2:33am
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.


Title: Re: Five Card Magic Trick
Post by ScottP on Jul 30th, 2002, 3:47am
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?

Title: Re: Five Card Magic Trick
Post by Viorel Canja on Jul 30th, 2002, 8:37am
A rule to transmit additional info would be nice :) , 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  ;D

Title: Re: Five Card Magic Trick
Post by NickH on Jul 30th, 2002, 10:26am
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

Title: Re: Five Card Magic Trick
Post by Nicodemus on Jul 30th, 2002, 11:25am
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! :)


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...

Title: Re: Five Card Magic Trick
Post by preiter on Jul 30th, 2002, 11:39am
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.

Title: Re: Five Card Magic Trick
Post by kkw on Jul 30th, 2002, 11:42am
Scott -
 You're very close.  the first card suit is valuable, as is
its value. Think modulo 13.

Title: Re: Five Card Magic Trick
Post by Viorel Canja on Jul 30th, 2002, 1:44pm
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.

Title: Re: Five Card Magic Trick
Post by Nicodemus on Jul 30th, 2002, 2:14pm
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.

Title: Re: Five Card Magic Trick
Post by NickH on Jul 30th, 2002, 6:08pm
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.

Title: Re: Five Card Magic Trick
Post by ScottP on Jul 30th, 2002, 11:09pm
Yup, worked out how to make my way work now :). 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!!

Title: Re: Five Card Magic Trick
Post by Nicodemus on Jul 31st, 2002, 12:49am
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.  ;D

Title: Re: Five Card Magic Trick
Post by kkw on Jul 31st, 2002, 5:51am
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?

Title: Re: Five Card Magic Trick
Post by Viorel Canja on Jul 31st, 2002, 6:10am
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.

Title: Re: Five Card Magic Trick
Post by -D- on Jul 31st, 2002, 10:13pm
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-

Title: Re: Five Card Magic Trick
Post by Viorel Canja on Aug 1st, 2002, 3:01am
4 cards can be arranged in 24 different ways ( 4! permutations ). Each ordering encodes a number between 1 and 24 .

Title: Re: Five Card Magic Trick
Post by kkw on Aug 1st, 2002, 2:30pm
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.

Title: Re: Five Card Magic Trick
Post by Lewis Jones on Aug 7th, 2002, 2:28pm
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.


Title: 132-card Variation on 5-card Magic Trick
Post by william wu on Aug 7th, 2002, 4:07pm
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.

Title: Re: Five Card Magic Trick
Post by icon on Aug 8th, 2002, 1:43am
for more details read here
http://people.brandeis.edu/~kleber/Papers/card.pdf

:)

Title: Re: Five Card Magic Trick
Post by Brian Quistorff on Aug 23rd, 2002, 8:02pm
The solutions posted so far seem to be very neat and tidy, so how about one that is ugly and horendous. ::).  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();

Title: Re: Five Card Magic Trick
Post by Fakrudeen on Oct 10th, 2002, 3:09am
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. :o

Title: Re: Five Card Magic Trick
Post by luke's new shoes on Nov 12th, 2002, 8:00pm
person B can tell the suit of the card by looking at the suits he is given, and can tell the number of the card by the arrangement of the cards he is given (there is 24 ways to arrange them)

the possible combintaion of suits that person B will be given are:

four hearts (or four clubs etc). he then concludes that the suit person A took out was hearts. and uses the arrangement of the four cards to work out the number of the card.

three hearts and a club (or diamond or spade). the suit of the card is either hearts or a club. so there is 26 combinations of what the cards number and suit could be, but he can eliminate the cards he has, reducing the number of combinations to 22 (below the 24 possible ways to arrange them).

two hearts, a club and spade. the cards suit is either hearts or diamonds (the suit person B doesnt have). 26 combinations, can eliminate the 2 hearts he has, reducing number of combinations to 24.

2 hearts and 2 diamonds. the cards suit is hearts or diamonds. 26 combinations, can eliminate the 4 cards he has, reducing number of combinations to 22.



Title: Re: Five Card Magic Trick
Post by luke's new shoes on Nov 12th, 2002, 9:23pm
alright i was close, but doesnt work.
if person B is given 2 hearts and 2 diamonds then the cards suit will be clubs or spades (not hearts or diamonds as i stated). 26 possible combinations, only 24 ways to arrange the cards!
this method will fail 1/26th of the time.

Title: Re: Five Card Magic Trick
Post by luke's new shoes on Nov 12th, 2002, 10:00pm
ok i'll try again... this time suit as well as colour (sometimes) come into play.

if person A is given (i'll use 5 hearts as an example, but that could also mean 5 diamonds etc):
*5 hearts: it doesnt matter what card they give back.
*4 hearts and a club: they give back a heart
*3 hearts, a club and diamond: give back club (or diamond)
*3 hearts and 2 clubs: give back a heart
*2 hearts, club, spade, diamond: give back diamond (now it is important to give back the diamond because it is the same colour as the hearts)
*2 hearts, 2 diamonds and clubs: put back a card so u are left with a pair of suits and two cards of differnt colours.

Person B can tell what suit was given back by:
*4 diamonds: suit is diamonds
(13 possible cards)
*3 hearts and a club: suit is hearts or clubs
(26-4 possible cards = 22)
*2 hearts and 2 clubs: suit is hearts or clubs
(26-4 possible cards = 22)
*2 hearts, club and spade: suit is diamond
(13 possible cards)
*2 hearts, diamond and club: suit is clubs or diamonds
(26-2 possible cards = 24)

the number of the card can be determined by the way person A arranges the cards (24 ways to arrange them).


Title: Re: Five Card Magic Trick
Post by Crucio on Dec 15th, 2002, 10:20pm
I guess i have a solution to this problem... read on

Spoilers warning!!

The 4 cards can/will be used to index to 24 cards. So we can start from the lowest of the 4 cards and count from it the number of cards that are indicated by the combination number formed by the 4 cards (ofcourse, skipping the cards that are already in the hand).
All this has been amply clear to everyone on this list.... now to the stuff which is not clear.

The magician A has to keep to himself such a card that can be indexed by the other 4 cards... that means the 5 card should not be farther than ~ 24 cards from the lowest of the 4 cards that he is giving to B. It all boils down to.... either A will start counting from the lowest of the 5 cards or the second lowest of the 5 cards. So if the difference between the lowest and the second lowest card is < 24, then B can keep the second lowest and give A the rest of the cards ordered in such a way that they point to the second lowest card that he has kept to himself. If the difference betweeen lowest and second lowest is > 24, then the distance detween second lowest and the lowest will be <24 if we loopback from the other end(count to King and loopback to Ace). Now B will keep the lowest to himself and give A the rest with the same criteria... A will now loopback from King of spades to Ace of diamonds whicle counting... and the lowest card can be indexed successfully.
Hence proved.

Title: Re: Five Card Magic Trick
Post by mike1102 on May 23rd, 2003, 9:23am
I think everyone is thinking way too hard on this one....

Of the five cards selected by the audience member, two must be the same suit. The second magician selects two cards of the same suit and gives one of them back to the audience member and places the second on top of the other three in a neat pile. When the second magician sets the pile of four cards down, or hands it back to the first magician, he can use either his right or left hand and places his thumb at a particular location on the stack - like the numbers on the face of an analog clock. Using any pre-arranged coding scheme, all the first magician need do is watch the second magician's hands and view the top card. Its magic - It all comes down to slight of hand.

Title: Re: Five Card Magic Trick
Post by Leonid Broukhis on May 23rd, 2003, 12:50pm
Mike1102,

you're right about the suit but wrong about the rest. This trick can be shown on a computer, using any spectator to enter data - no set-up, cooperation or sleight of hand required.

As you've mentioned, out of 5 cards at least 2 will be of same suit (let's say exactly 2 WLOG). The magician will use the first card out of the other 4 to indicate the suit, and the other 3 can only encode 6 combinations, but the magician has the liberty to choose which card out of 2 to return and which to use for encoding: [hide]Need I say that the circular distance between two cards of the same suit is never greater than 6?[/hide]

Title: Re: 132-card Variation on 5-card Magic Trick
Post by ManjeetBothra on May 10th, 2004, 11:01pm
but how do u decide that after transferring the cards tht the  magician who has to tell the card has to move in clockwise  or anticlockwise direction ??

on 08/07/02 at 16:07:46, william wu wrote:
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.


Title: Re: Five Card Magic Trick
Post by Nigel_Parsons on Jul 11th, 2004, 12:20pm
An additional method of encoding one bit of information is the inversion of a card. In a standard deck, roughly half (A 3 5 6 7 8 9) of the cards have a right-way-up. If the four cards are all of the same orientation it would have one meaning, if any  showed differing orientations this would have another.

Clearly if you receive 5 cards which cannot be oriented differently you must pass on 4 with the message that the fifth is also undifferentiable. (hence a 2 4 10 J Q or K)

If you receive 5 cards in which only one card is orientable you pass this back with three others. (message is 5th card was not orientable) The orientable card must be in the 4 otherwise you would pass the message in the previous paragraph.

If you receive 2 or more orientable cards you pass back at least 2, and whether their orientation matches or opposes gives your message.

I don't know how much this helps, but it avoids the need for secret handshakes, thumbs in certain positions etc.,

Title: Re: Five Card Magic Trick
Post by sushma on Dec 4th, 2004, 11:28am
how abt this?
i guess it works

the cards in the deck would be numbered 1 to 52.
first magician would choose the card in the middle of the sorting order, eg: 1,3, 34, 51, 52 are the five cards say then he would choose 34 and then arrange the reamining in a particular order.
As someone rightly said, we would arrange the remaining four cards in such a way that each permutation corresponds to a number which is to be added to the 2nd highest of the cards or subtracted from 3rd highest.
Now i'll talk abt how to assign the number to each combination and how to decide whether to add or subtract.
the four cards can be arranged in 24 ways and say
(least, second least, third least, fourth least)  corresponds to the muber 1.
similarly (least, third least, second least, fourth least) correspobd to the number 2.
similarly 24 numbers can be assigned for 24 permutations.
now we can give the set of 4 cards with all the faces up or all the faces down.
faces up --> add the number to the 2nd highest
faces down --> subtract the number from 3rd highest

ne suggestions on how to make this better?
acc to me if the number of cards is more than 52, this sol doesn't work!!! ne bright ideas r welcome

~Sushma

Title: Re: Five Card Magic Trick
Post by Icarus on Dec 4th, 2004, 12:45pm
If you read the replies on the first page, you will see a link that goes to a description on how to do this puzzle with 132 cards.

Title: Re: Five Card Magic Trick
Post by Dostoevsky's Mouse on Apr 24th, 2005, 4:07am
       I came up with this yesterday, and while I see that it isn't technically the "correct" solution, I'm pretty sure it's equally accurate.  Let me know if you guys see any problems with it.

To Denote the Cards:

       "Mystery Card" -- The card Magician #2 must guess.
       "Suit Card" -- The top card in the stack of four.  Shares the suit of the Mystery Card.
       "Value Cards" -- The three bottom cards in the stack of four, used to encode the numerical value of the Mystery Card.

The Strategy:

       Mentally label your three Value Cards "1," "2," and "3," in order from low to high (Ace high, and Clubs < Diamonds < Hearts < Spades).  For instance, if the cards were an Ace, a Jack, and a 4, they would have the following relative values:
       4 = 1 (low card)
       J = 2 (middle card)
       A = 3 (high card).

       There are six possible ways to arrange these cards: 123, 132, 213, 231, 312, and 321.  Note that if you discount the Aces, there are twelve possible values for the Mystery Card (2-10, J, Q, and K).  Assign each of the six possible Value Card combinations to two of the twelve possible Mystery Card values, as follows:
       Combination 123 = Mystery Card is either 2 or 3.
       Combination 132 = Mystery Card is either 4 or 5.
       Combination 213 = Mystery Card is either 6 or 7.
       Combination 231 = Mystery Card is either 8 or 9.
       Combination 312 = Mystery Card is either 10 or J(11).
       Combination 321 = Mystery Card is either Q(12) or K(13).

       This narrows the Mystery down to two possible cards.  All that remains to be encoded is whether the the answer is even or odd.

       To do this, choose your Mystery Card in the following manner.  Check to see whether your two same-suit cards are both odd, both even, or one of each.  If both cards are odd, or both cards are even, designate the higher card as the Mystery Card.  If one is odd and one is even, designate the lower card as the Mystery Card.

       How does this work?  Well, say we arrange our cards 10d, Jc, 4s, Ac.  The Suit Card, 10d, tells our partner he's looking for Diamonds.  The order of the Value Cards, 213, tells him he's looking for a 6 or a 7.  And the Suit Card is a 10, an even-numbered card, which tells him immediately that if the Mystery Card is higher, it must be even; if lower, it must be odd.  Since both 6 and 7 are lower than 10, the answer must be 7.  We would only have made the Mystery Card lower than the Suit Card if one was odd and one was even.  Had both cards been even, the 10 -- the higher card -- would have been designated the Mystery Card instead.  

       This rule works for every card except the Ace, for which there is a separate rule:  

       Say your two matching-suit cards are the Ace and the 4 of Clubs.  Because 4 is even, make it your Suit Card, and make the Ace your Mystery Card.  However, arrange the three Value Cards in the order 132, to indicate that the Mystery Card is a 4 or a 5.  Your partner will know that the Mystery Card is not really a 4 or a 5.  How?  Well, the 4 of Clubs is already in his hand; it's the Suit Card.  The 5 of Clubs is higher than the 4, but it's odd while 4 is even, which breaks the rule for selecting a Mystery Card.  The only answer is the Ace.

       Now say your two matching-suit cards are the Ace and the 5 of Clubs.  Because 5 is odd, make it your Mystery Card, and make the Ace your Suit Card.  Arrange the Value Cards 132, to indicate a value of 4 or 5.  Your partner will know, by seeing the Ace used as a Suit Card, that the Mystery Card is odd, and hence, the 5.  If it had been even, you would have followed the rules in the previous paragraph, and the Ace would have been the Mystery Card.

Strategy Summary:

Arrangement of Value Cards:
       123 = 2 or 3
       132 = 4 or 5
       213 = 6 or 7
       231 = 8 or 9
       312 = 10 or J
       321 = Q or K

Choosing the Mystery Card:
       If the two same-suit cards are both odd or both even, the higher becomes the Mystery Card.
       If the two same-suit cards are mismatched, one odd and one even, the lower becomes the Mystery Card.  
       If the two same-suit cards comprise an Ace and an odd-numbered card, the odd card becomes the Mystery Card.  
       If the two same-suit cards comprise an Ace and an even-numbered card, the Ace becomes the Mystery Card -- but encode the value of the even card.

Title: Re: Five Card Magic Trick
Post by scepe on Aug 24th, 2006, 5:47pm
The question goes on to state how *large* of a deck of cards can you encode.  So far, it looks like people have only come up with a way to encode the 52 cards.  (As soon as I said this, I read a bit more and found the .pdf on the first page.  oops.)

One thing I haven't seen mentioned is the Orientation of the cards.  A spade upside down could represent a bit turned on, as opposed to a spade facing right side up.  This follows the requirement that the cards are neatly aligned and face down when passed.  The passer and passee would have to have a system to know how to handle the cards once they've been passed, but yeah.

Seems like this would give 4! * 2^4 possible card combos.  The way I had been doing 'that extra bit' of info commented on for the 52 card deck was just whether or not the cards were all oriented the same way or not.  But, I do realize that some decks of cards are non orientable.  My Marlboro deck, however, is.  :)

Any of that aside, when considering a 'larger' number of cards, we'd have to assume no duplicates, no?  There would have to be some discernable difference whether it be a new suit, or a different look to the cards in order to give each card an absolute number.

Title: Re: Five Card Magic Trick
Post by Bishamon on Jun 8th, 2007, 3:52am
For the second magician to identify the card, he would need the suit and the value.

Like someone said earlier in this thread, there is bound to be at least 2 cards that have the same suit amongst the five. Choose one of them to be returned to the spectator and put the second card of the same suit on top of the pile to be returned.

For figuring out the value of the card(2,3,4,5,6,7,8,9,J,Q,K,A) assign each type of card a value between 1 and 13.

The four cards that are being returned to the magician B can be arranged to represent a 16 different values by doing the following.

Each card can facing up or down.(i.e. its colorful side(dunno, wat u call the side) facing up could be 1 and other side facing up 0.)

we can get a sequence of 4 binary digits from which the value can be determined.

P.S. : I am sorry if this solution has been proposed before. I read through all those above and although most were suggesting some similar, I do not recollect coming across the exact same solution.




-Edited grammatical mistakes.



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