The Brain Teaser Thread

Page 7 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

QED

Diamond Member
Dec 16, 2005
3,428
3
0
Originally posted by: DrPizza

I hope QED's solution is more elegant than mine to this problem; mine was rather lengthy in explanation as to the rules I used for which card to give back to the audience member. I'm sure there's a simpler solution, but I was satisfied with any solution

I'd be very interested in seeing what you came up with... if you want, you can PM me.

As for my solution, here's a 3rd hint for everyone: given any five cards, at least two of them must be the same suit.
 

ng12345

Senior member
Jan 23, 2005
408
0
86
I actually did this problem as a magic trick back when I was 12 or 13

another hint -- since 2 cards (A&B) are always the same suit -- consider card A to be the one you give back, and B the one that is Penn's hand --> perhaps you can use the other 3 cards to indicate the difference between A & B?

This is kind of fun

BTW for the weights question -- good call on the powers of 3
 

DrPizza

Administrator Elite Member Goat Whisperer
Mar 5, 2001
49,601
167
111
www.slatebrookfarm.com
Oh crud. At first I thought I had an easy solution, then I realized it didn't work:
4th card has the same suit as the one handed back. Then, there are 24 arrangements of 4 cards; the order of which would determine the value. Ooops, then I use that 4th card again. So, for a while I was stumped. The other 3 cards are only good at giving a number from 1 to 6.
-----Solution:
What stopped me was using a system where I always gave back the highest of the two cards, or always gave back the lowest of the two cards. I worked through a bunch of possible cases and was only able to encode about half of them. But, that left quite a few that I couldn't quite get using that method. For example, what would I do if they had a 2 and 10 of hearts? They're 8 cards apart - I couldn't possibly encode "8". Eventually I stared at a deck of cards in order - omg! There's another 2 that's 5 cards past the 10. I can always go 6 cards or less past one of the two cards to get to the other card.

To order the 3 non-suit matching cards (well, one could even match the suit), decide on an order for suits, in case of pairs. Then think of the cards in order: 2, 5, 9 would represent 123. 2 5hearts 5 diamonds would represent 132 (I'd go alphabetical order for the suits: CDHS; so 5hearts is higher than 5 diamonds)

The possible "orders" are:
123
132
213
231
312
321

These would represent 1,2,3,4,5,6 respectively.

So, if I was given the hand:
8, J, 5, QHearts
I'd go 4 past the Q to 3 (it'll be of hearts)

9H, 9C, Jack, 4C: 7 of clubs:
213 = 3 3 cards past the 4 is a 7.
321
 
Feb 6, 2007
16,432
1
81
Originally posted by: QED
Originally posted by: DrPizza

I hope QED's solution is more elegant than mine to this problem; mine was rather lengthy in explanation as to the rules I used for which card to give back to the audience member. I'm sure there's a simpler solution, but I was satisfied with any solution

I'd be very interested in seeing what you came up with... if you want, you can PM me.

As for my solution, here's a 3rd hint for everyone: given any five cards, at least two of them must be the same suit.

The "two must be the same suit" line seems misleading. If the audience member picks 5 cards at random, they could end up with 2 hearts, and 1 of every other suit, or they could end up with 5 hearts, or no hearts, or any combination of suits to add up to 5.

Let's say the audience draws 5 hearts, and keeps one. Penn comes out and sees 4 hearts. Now let's say instead of 5 hearts, the person draws 4 hearts and 1 diamond, and decides to hold the diamond. Penn comes out and sees 4 hearts. Identical arrangement, different card held by the audience member. So it can't just be that there are two of one suit, there has to be some further indicator of what suit the person is holding.

-EDIT- Oh, I didn't see that Teller picks which card the audience member holds. That changes things.
 

brikis98

Diamond Member
Jul 5, 2005
7,253
8
0
Came up with a solution with a buddy of mine last night, but it looks like Dr Pizza beat me to it. I'll try my writeup anyway:

1. Before the show, Penn and Teller decide on an "ordering" for the cards. First, they arbitrarily order the suits: for example, clubs > diamonds > hearts > spades. Next, they assign a value between 1 and 13 for each type of card: an ace is a 1, 2-10 are 2-10, jack is 11, queen is 12, king is 13. Now, it's easy to compare two cards: jack of hearts > 3 of hearts. A 2 of clubs > a king of spades.
2. Also before the show, Penn and Teller agree on "values" for the 6 possible arrangements of 3 labels. For example, if the labels are A, B and C, :

ABC = 1
ACB = 2
BAC = 3
BCA = 4
CAB = 5
CBA = 6

3. Note that, if we have 5 cards, since there are only 4 suits, at least two of the cards will always be of the same suit.
4. Teller picks the card he gives to the audience member to keep - lets call this card "K" - so that it is the same suit as at least one card "S" that he places in the "pile". Teller will make S the top card in the pile. Just by looking at S, Penn instantly knows what suit K is.
5. Note that, given any two cards X and Y of the same suit, we can pick one as the "start" card so that we need to go forward in the suit at most 6 cards to get to the other. For example, if X = 4 and Y = 7, we pick X as the "start" card and we can go forward 3 cards (5, 6, 7) to get from X to Y. If X = 1 and Y = 10, we pick Y as the start card and go forward 4 cards (jack, queen, king, ace) to get to X. In this fashion, no two cards in the same suit are ever more than 6 cards apart.
6. Since S and K are of the same suit, they are no more than 6 cards apart. Teller just picks S the "start" card. When Penn picks it up, he knows not only the suit of K, but also that he needs to go forward at most 6 cards to get the value of K. All that remains is to arrange the 3 remaining cards in the pile to tell Penn how many cards to go forward.
7. As agreed to in step 1, we can easily label the 3 bottom cards in the pile A, B and C so that A > B > C.
8. Using this labeling, Teller arranges these bottom 3 cards, as discussed in step 2, to represent the number of cards you need to go forward to get from S to K.

Examples:

Teller gets: 4C 3D 10S 5C AceD
K = 3D (audience member gets this)

The pile of 4 cards (in order):
AceD
4C
5C
10S

Penn walks out, picks up the pile. He sees the top card is an ace of diamonds. He mentally labels the next 3 cards as BAC (5C > 4C > 10S). From step 2, we know BAC = 3. So Penn goes forward 3 cards from the Ace of diamonds to get the 3 of diamonds, which is exactly what the audience member has. Magic!
 

QED

Diamond Member
Dec 16, 2005
3,428
3
0
Great job brikis98 and DrPizza... that's exactly it. I love this problem because, again, at first glance it looks like you won't
have enough information for this to be possible. It turns out you have _just_ enough. Or do you?

Now onto the next challenge: Penn and Teller repeat the same trick, only this time they raise the stakes and use two decks of cards (say, one red and one blue) combined. The audience member again picks any 5 cards from the combined deck (all blue, all red, or any combination thereof). Teller takes the cards and looks at them, gives one of them back to the audience member, arranges the remaining four, and hands them to Penn. Penn can now tell not only what card the audience member has, but also whether it came from the red deck or the blue deck. How?

As if this wasn't impossible enough already, both decks also contain two jokers (for a total of 4 jokers) which the audience member may, or may not, be holding.

EDIT: Oh, Penn can only see the front of the four cards he is given. He CANNOT see the backs of the cards (i.e. whether they came from the red deck or blue deck), so there is no information encoded in that way.
 

ng12345

Senior member
Jan 23, 2005
408
0
86
I think to start off -- to address the issue of the joker

If there is only 1 joker, it would never be given to the audience member and could instead serve as part of the combination portion of the information.

edit: on second thought, there would be a problem if all 4 suits are represented and there is a joker in the set of 5 cards

If there is more than 1 joker, it would always be given to the audience member, the remaining cards could be used to determine the color of the deck:

if all 4 jokers are in the set of 5 cards, Penn knows one is in the audience's hand, and he knows which is missing from the 4 cards he holds.

If there are 3 jokers in the set of 5 cards, the first card will be the one that matches the one in the audience members hand

If there are 2 jokers in the set of 5 cards, one will be in the audience members hand, and one will take the place of the first card, and the other 3 cards need to be arranged in a way to indicate color of deck -- which can easily be done using the previous solution and designating combinations 1-3 as one color deck and 4-6 as the other color -- given/we are throwing away a lot of information here

 

brikis98

Diamond Member
Jul 5, 2005
7,253
8
0
Originally posted by: QED
Great job brikis98 and DrPizza... that's exactly it. I love this problem because, again, at first glance it looks like you won't
have enough information for this to be possible. It turns out you have _just_ enough. Or do you?

Now onto the next challenge: Penn and Teller repeat the same trick, only this time they raise the stakes and use two decks of cards (say, one red and one blue) combined. The audience member again picks any 5 cards from the combined deck (all blue, all red, or any combination thereof). Teller takes the cards and looks at them, gives one of them back to the audience member, arranges the remaining four, and hands them to Penn. Penn can now tell not only what card the audience member has, but also whether it came from the red deck or the blue deck. How?

As if this wasn't impossible enough already, both decks also contain two jokers (for a total of 4 jokers) which the audience member may, or may not, be holding.

are the actual cards from each deck blue and red - that is, can you distinguish a card taken from a blue deck from one taken from a red deck?
 

QED

Diamond Member
Dec 16, 2005
3,428
3
0
Originally posted by: brikis98
Originally posted by: QED
Great job brikis98 and DrPizza... that's exactly it. I love this problem because, again, at first glance it looks like you won't
have enough information for this to be possible. It turns out you have _just_ enough. Or do you?

Now onto the next challenge: Penn and Teller repeat the same trick, only this time they raise the stakes and use two decks of cards (say, one red and one blue) combined. The audience member again picks any 5 cards from the combined deck (all blue, all red, or any combination thereof). Teller takes the cards and looks at them, gives one of them back to the audience member, arranges the remaining four, and hands them to Penn. Penn can now tell not only what card the audience member has, but also whether it came from the red deck or the blue deck. How?

As if this wasn't impossible enough already, both decks also contain two jokers (for a total of 4 jokers) which the audience member may, or may not, be holding.

are the actual cards from each deck blue and red - that is, can you distinguish a card taken from a blue deck from one taken from a red deck?

See my edit above. The backs of the cards are red and blue. The audience and Teller can see the backs. Penn, however, only sees the face (front) of the four cards he is given-- he cannot see their back and thus has no idea which of those four came from the blue deck or the red deck.
 

brikis98

Diamond Member
Jul 5, 2005
7,253
8
0
Originally posted by: QED
Originally posted by: brikis98
Originally posted by: QED
Great job brikis98 and DrPizza... that's exactly it. I love this problem because, again, at first glance it looks like you won't
have enough information for this to be possible. It turns out you have _just_ enough. Or do you?

Now onto the next challenge: Penn and Teller repeat the same trick, only this time they raise the stakes and use two decks of cards (say, one red and one blue) combined. The audience member again picks any 5 cards from the combined deck (all blue, all red, or any combination thereof). Teller takes the cards and looks at them, gives one of them back to the audience member, arranges the remaining four, and hands them to Penn. Penn can now tell not only what card the audience member has, but also whether it came from the red deck or the blue deck. How?

As if this wasn't impossible enough already, both decks also contain two jokers (for a total of 4 jokers) which the audience member may, or may not, be holding.

are the actual cards from each deck blue and red - that is, can you distinguish a card taken from a blue deck from one taken from a red deck?

See my edit above. The backs of the cards are red and blue. The audience and Teller can see the backs. Penn, however, only sees the face (front) of the four cards he is given-- he cannot see their back and thus has no idea which of those four came from the blue deck or the red deck.

just to check:

1. are all jokers identical? or do jokers also have "suits" or some way to tell one from the other?
2. again, are we allowed to use orientation, cards upside down, etc or, just as before, is the only cue the actual cards plus their order?
 

QED

Diamond Member
Dec 16, 2005
3,428
3
0
Originally posted by: brikis98

just to check:

1. are all jokers identical? or do jokers also have "suits" or some way to tell one from the other?
2. again, are we allowed to use orientation, cards upside down, etc or, just as before, is the only cue the actual cards plus their order?

1. For the purposes of the card trick, it matters not if they jokers are identical or not. If it makes solving it easier, they can be assigned to a suit. Or they could all be identical and indistiguishable (other than which deck they came from, of course) if it makes solving easier.

2. Only the information from the first problem is available in the second problem-- strictly the only information used by Penn is the face and suit values of the 4 cards, and perhaps (who am I kidding? lol) their order.

EDIT: Actually, Penn can look at the back of the four cards. This is necessary as if 2 or 4 of the cards are identical (i.e. the same card, but from different decks) then there won't be enough information to determine the 5th card. For the same reason, the jokers must be distinguisable.
 

ng12345

Senior member
Jan 23, 2005
408
0
86
hmm... looks like no new posts -- is this an extension of the first problem or does it require a completely different solution?

I was thinking that you could create a supersuit -- each suit would consist of 27 cards, 13R,13B,and 1 joker (you can make the red suits have a red deck joker and the black suits have a blue deck joker)

the main thing that I can't figure out is the fact that Penn can't distinguish between a red deck 3 of hearts and a blue deck 3 of hearts -- so even though there are 108 unique cards, Penn can only tell 53 of them apart, or 54 if the jokers are different
 

QED

Diamond Member
Dec 16, 2005
3,428
3
0
Originally posted by: ng12345
hmm... looks like no new posts -- is this an extension of the first problem or does it require a completely different solution?

I was thinking that you could create a supersuit -- each suit would consist of 27 cards, 13R,13B,and 1 joker (you can make the red suits have a red deck joker and the black suits have a blue deck joker)

the main thing that I can't figure out is the fact that Penn can't distinguish between a red deck 3 of hearts and a blue deck 3 of hearts -- so even though there are 108 unique cards, Penn can only tell 53 of them apart, or 54 if the jokers are different

Well this is somewhat of an extension of the first problem in that the underlying problem is identical, except that the solution will be somewhat different since you are trying to squeeze even more information from the same 4 cards in the first problem.

If it helps, you can easily think of the cards as numbers from 1 through 108 (or 0 through 107 if you like counting from zero), and using your notion of supersuits it would not be that difficult to quickly convert (even mentally) a card's face, deck, and back color into a number or vice versa.

Therefore, if you'd like you you can make this a strictly mathematic endeavor. You change the question to how, given any 5 unique numbers between 0 through 107, can you use some 4 of those numbers (and their order) to exactly describe or calculate the 5th number?

It turns out there is a way to do this... and in fact it works even if the numbers are between 0 and 119 (i.e. you could add yet another 12 cards to the second problem and there would still be enough information for Penn to tell you exactly which card the audience member has).
 

DrPizza

Administrator Elite Member Goat Whisperer
Mar 5, 2001
49,601
167
111
www.slatebrookfarm.com
Well, there are 111,469,176 different 5 card combinations possible.

From each combination, you get to pick a card to give to the audience member.
For 4 cards, there are 128,618,280 different permutations. Since the number of permutations of 4 cards is greater than the number of possible 5 card combinations, seems to me that a solution exists. I've been thinking about it, but can't come up with anything yet.

An attempt: (really, just kinda thinking out loud... maybe something I think of will tip someone off)

As before, the 1st (or 4th) card serves as a reference point. Somehow, you have to use the other 3 cards to not only encode a number between 1 and 6, but you also have to get another number. There's one (and only one?) thing that hasn't been used yet to convey information: The suit of the 1st (or 4th) card. Hmmm... I'm still stumped.
 

ng12345

Senior member
Jan 23, 2005
408
0
86
Originally posted by: QED
Originally posted by: ng12345
hmm... looks like no new posts -- is this an extension of the first problem or does it require a completely different solution?

I was thinking that you could create a supersuit -- each suit would consist of 27 cards, 13R,13B,and 1 joker (you can make the red suits have a red deck joker and the black suits have a blue deck joker)

the main thing that I can't figure out is the fact that Penn can't distinguish between a red deck 3 of hearts and a blue deck 3 of hearts -- so even though there are 108 unique cards, Penn can only tell 53 of them apart, or 54 if the jokers are different

Well this is somewhat of an extension of the first problem in that the underlying problem is identical, except that the solution will be somewhat different since you are trying to squeeze even more information from the same 4 cards in the first problem.

If it helps, you can easily think of the cards as numbers from 1 through 108 (or 0 through 107 if you like counting from zero), and using your notion of supersuits it would not be that difficult to quickly convert (even mentally) a card's face, deck, and back color into a number or vice versa.

Therefore, if you'd like you you can make this a strictly mathematic endeavor. You change the question to how, given any 5 unique numbers between 0 through 107, can you use some 4 of those numbers (and their order) to exactly describe or calculate the 5th number?

It turns out there is a way to do this... and in fact it works even if the numbers are between 0 and 119 (i.e. you could add yet another 12 cards to the second problem and there would still be enough information for Penn to tell you exactly which card the audience member has).

But now you have changed the problem -- since each card is unique -- before, the cards were not unique (at least not to Penn) --> he could only see 53 unique cards since he couldn't tell if a card was from the red or blue deck.

Your current problem actually works up to 124 cards I believe (since the limit is where the number of 5 card combinations is less than or equal to the number of 4 card permutations)

before you were dealing with C(108,5) and P(53,4), where there is not enough information. If he can look at the back of the card (and thus see the color of the deck), then there would be 106 unique cards (if jokers are indistinguishable) and then there is enough information.

Since it is entirely mathematical, before we were using the first card to constrain the hidden card to a subset and then the other three cards chose an element from that subset. We could probably increase the amount of information if we didn't limit ourselves to locking in that first card.
 

QED

Diamond Member
Dec 16, 2005
3,428
3
0
Originally posted by: ng12345
Originally posted by: QED
Originally posted by: ng12345
hmm... looks like no new posts -- is this an extension of the first problem or does it require a completely different solution?

I was thinking that you could create a supersuit -- each suit would consist of 27 cards, 13R,13B,and 1 joker (you can make the red suits have a red deck joker and the black suits have a blue deck joker)

the main thing that I can't figure out is the fact that Penn can't distinguish between a red deck 3 of hearts and a blue deck 3 of hearts -- so even though there are 108 unique cards, Penn can only tell 53 of them apart, or 54 if the jokers are different

Well this is somewhat of an extension of the first problem in that the underlying problem is identical, except that the solution will be somewhat different since you are trying to squeeze even more information from the same 4 cards in the first problem.

If it helps, you can easily think of the cards as numbers from 1 through 108 (or 0 through 107 if you like counting from zero), and using your notion of supersuits it would not be that difficult to quickly convert (even mentally) a card's face, deck, and back color into a number or vice versa.

Therefore, if you'd like you you can make this a strictly mathematic endeavor. You change the question to how, given any 5 unique numbers between 0 through 107, can you use some 4 of those numbers (and their order) to exactly describe or calculate the 5th number?

It turns out there is a way to do this... and in fact it works even if the numbers are between 0 and 119 (i.e. you could add yet another 12 cards to the second problem and there would still be enough information for Penn to tell you exactly which card the audience member has).

But now you have changed the problem -- since each card is unique -- before, the cards were not unique (at least not to Penn) --> he could only see 53 unique cards since he couldn't tell if a card was from the red or blue deck.

Your current problem actually works up to 124 cards I believe (since the limit is where the number of 5 card combinations is less than or equal to the number of 4 card permutations)

before you were dealing with C(108,5) and P(53,4), where there is not enough information. If he can look at the back of the card (and thus see the color of the deck), then there would be 106 unique cards (if jokers are indistinguishable) and then there is enough information.

Since it is entirely mathematical, before we were using the first card to constrain the hidden card to a subset and then the other three cards chose an element from that subset. We could probably increase the amount of information if we didn't limit ourselves to locking in that first card.

Ohh.. you are right. Penn cannot see the back of the cards, so this is not exactly mathematically like from a set of 5 numbers choosing 4 and ordering them in such a way that uniquely identifies the 5th number-- so scratch that.


 

QED

Diamond Member
Dec 16, 2005
3,428
3
0
Actually, I just realized that Penn has to be able to look at the back of the four cards. This is necessary as if 2 or 4 of the cards are identical (i.e. the same card, but from different decks) then there won't be enough information to determine the 5th card. For the same reason, the jokers must be distinguisable as well.
The solution I had in mind works 99% percent of the time without Penn needing to see the backs of the cards, but in those cases above it will not work.

Here's a hint towards the solution: Assign a value of 0 through 107 for each card in the combined deck in any fashion you choose. Label the 5 cards the audience
member picked as C_0, C_1, C_2, C_3, and C_4 and order them such that C_0< C_1< C_2 < C_3 < C_4. Teller hands back card C_i, where
i is congruent to ( C_0 + C_1 + C_2 + C_3 + C_4 ) modulo 5.
 

ng12345

Senior member
Jan 23, 2005
408
0
86
then Penn would take the remaining 4 cards sum them up and take mod 5 of that.

Knowing the mod 5 of the remaining 4 cards, he will know the subset of cards the 5th card must be from.

for example:
take C = {3,35,56,93,100} WHERE C[0]=3 C[1]=35 C[2]=56 C[3]=93 C[4]=100 (in keeping with your convention)
then sum(C)mod 5 = 282 mod 5 = 2; Teller will give #56 (C[2]) back to the audience member and give C'={8,35,93,100} to Penn in a certain order

For Penn:
Let C' be the set of cards that he was given
Let C* be the set of possible cards that the audience member holds

Penn will sum(C') mod 5 = 236 mod 5 = 1
Knowing this information he can determine the subset of cards this will come from since if the card was:
C[0] then sum(C)mod 5 = 0 and C[0] mod 5 must be 4; thus C* can be = {4}; must be <8, or 8 would have been C_0
C[1] then sum(C)mod 5 = 1 and C[1] mod 5 must be 0; thus C* can be = {10,15,20,25,30}
C[2] then sum(C)mod 5 = 2 and C[2] mod 5 must be 1; thus C* can be = {36,41,46,51,56,61,66,71,76,81,86,91}
C[3] then sum(C)mod 5 = 3 and C[3] mod 5 must be 2; thus C* can be = {97};
C[4] then sum(C)mod 5 = 4 and C[4] mod 5 must be 3; thus C* can be = {103}

Thus Penn knows that C*={4,10,15,20,25,30,36,41,46,51,56,61,66,71,76,81,86,91,97,103}

Thus based on this information, Penn will have narrowed it down to a set of 20 cards (in this case); I think the largest set would have 22 cards. The order of the remaining 4 cards P(4,4)=24 can determine which element in the set it is. For example, we could arbitrarily set them being ordered smallest to largest as the first element in this set.

I think you could create some equations to simplify calculating the set:
Let k equal the set of integers where k>=0
C*=5k- sum(C') mod 5 when 5k<C'[0]
C*=5k - sum(C') mod 5 + 1, when C'[0]<5k<C'[1]
C*=5k - sum(C') mod 5 + 2, when C'[1]<5k<C'[2]
C*=5k - sum(C') mod 5 + 3, when C'[2]<5k<C'[3]
C*=5k - sum(C') mod 5 + 4 ,when 5k>C'[3]

which could be further simplified to C*=5k-sum(C') mod 5 + N, where N = the position of the card that was removed

In words: The set of possible cards in the audience member's hand can be determined by subtracting the sum of the 4 cards in Penn's hand modulo 5 from 5k, where k is the set of positive integers, and adding to it the possible position of the card removed. The element of this set can then be determined by the order in which the 4 cards are placed:

A<B<C<D
1 ABCD
2 ABDC
3 ACBD
4 ACDB
5 ADBC
6 ADCB
.
.
.
24 DCBA

Though complicated looking, I believe k can match up with the number assigned to these combinations; so as Penn, you would have to memorize the 24 combinations. In this case, you would use combination 11 (it is the 11th element in C*). If k=11, then 5*k=55 which is between C'[1] and C'[2], so then N=2 and C'mod5=1 so 5*k-1+2=56.

Similarly, it should be easy for Teller to know which combination to put the cards in as he can quickly do the equation backwards. He is removing C[2] since the sum modulo 5 was 2, and he can quickly calculate the modulo 5 of the sum of the remaining cards to be 1, and determine that 5k=55 and k=11.

In looking over the problem, this method will represent 24 elements k=1...24 and cards 1 to 124. I made a slight mistake in my equation since I am not representing 0 to 123.

As an aside, and out of curiosity -- what do you do QED?
 

QED

Diamond Member
Dec 16, 2005
3,428
3
0
Originally posted by: ng12345
then Penn would take the remaining 4 cards sum them up and take mod 5 of that.

Knowing the mod 5 of the remaining 4 cards, he will know the subset of cards the 5th card must be from.

for example:
take C = {3,35,56,93,100} WHERE C[0]=3 C[1]=35 C[2]=56 C[3]=93 C[4]=100 (in keeping with your convention)
then sum(C)mod 5 = 282 mod 5 = 2; Teller will give #56 (C[2]) back to the audience member and give C'={8,35,93,100} to Penn in a certain order

For Penn:
Let C' be the set of cards that he was given
Let C* be the set of possible cards that the audience member holds

Penn will sum(C') mod 5 = 236 mod 5 = 1
Knowing this information he can determine the subset of cards this will come from since if the card was:
C[0] then sum(C)mod 5 = 0 and C[0] mod 5 must be 4; thus C* can be = {4}; must be <8, or 8 would have been C_0
C[1] then sum(C)mod 5 = 1 and C[1] mod 5 must be 0; thus C* can be = {10,15,20,25,30}
C[2] then sum(C)mod 5 = 2 and C[2] mod 5 must be 1; thus C* can be = {36,41,46,51,56,61,66,71,76,81,86,91}
C[3] then sum(C)mod 5 = 3 and C[3] mod 5 must be 2; thus C* can be = {97};
C[4] then sum(C)mod 5 = 4 and C[4] mod 5 must be 3; thus C* can be = {103}

Thus Penn knows that C*={4,10,15,20,25,30,36,41,46,51,56,61,66,71,76,81,86,91,97,103}

Thus based on this information, Penn will have narrowed it down to a set of 20 cards (in this case); I think the largest set would have 22 cards. The order of the remaining 4 cards P(4,4)=24 can determine which element in the set it is. For example, we could arbitrarily set them being ordered smallest to largest as the first element in this set.

I think you could create some equations to simplify calculating the set:
Let k equal the set of integers where k>=0
C*=5k- sum(C') mod 5 when 5k<C'[0]
C*=5k - sum(C') mod 5 + 1, when C'[0]<5k<C'[1]
C*=5k - sum(C') mod 5 + 2, when C'[1]<5k<C'[2]
C*=5k - sum(C') mod 5 + 3, when C'[2]<5k<C'[3]
C*=5k - sum(C') mod 5 + 4 ,when 5k>C'[3]

which could be further simplified to C*=5k-sum(C') mod 5 + N, where N = the position of the card that was removed

In words: The set of possible cards in the audience member's hand can be determined by subtracting the sum of the 4 cards in Penn's hand modulo 5 from 5k, where k is the set of positive integers, and adding to it the possible position of the card removed. The element of this set can then be determined by the order in which the 4 cards are placed:

A<B<C<D
1 ABCD
2 ABDC
3 ACBD
4 ACDB
5 ADBC
6 ADCB
.
.
.
24 DCBA

Though complicated looking, I believe k can match up with the number assigned to these combinations; so as Penn, you would have to memorize the 24 combinations. In this case, you would use combination 11 (it is the 11th element in C*). If k=11, then 5*k=55 which is between C'[1] and C'[2], so then N=2 and C'mod5=1 so 5*k-1+2=56.

Similarly, it should be easy for Teller to know which combination to put the cards in as he can quickly do the equation backwards. He is removing C[2] since the sum modulo 5 was 2, and he can quickly calculate the modulo 5 of the sum of the remaining cards to be 1, and determine that 5k=55 and k=11.

In looking over the problem, this method will represent 24 elements k=1...24 and cards 1 to 124. I made a slight mistake in my equation since I am not representing 0 to 123.

As an aside, and out of curiosity -- what do you do QED?

Very good... that' s pretty much the same answer I got. Penn and Teller do not necessarily have to memorize the 24 permutations of the cards and their associated values if they use the factoradic ("base factorial") numbering system.

As for what I do... I'm a former teacher and math professor, but now I do systems analyst work. My current line of work is interesting, but I miss the interaction with students... how about you, ng12345?

 

QED

Diamond Member
Dec 16, 2005
3,428
3
0
Ok.. new brain teaser/puzzle. This one is actually fairly simple, but has broad applications in everyday life:

You will generally find competing gas stations are usually very tightly clustered together within a neighborhood (in some areas it's not
uncommon to have 4 gas stations on each corner of a busy intersection!), instead of being equally spread out throughout the whole neighborhood. Some of this can be explained by zoning laws and the uneven distribution of people within an area, etc. But even in an ideal world (one with no zoning laws, all gas stations had the same cheap price, and people are evenly distributed across the neighborhood) gas stations would still cluster-- even though it would be better for consumers if they spread out so you wouldn't have to drive as far to get gas. Why is that?
 

ng12345

Senior member
Jan 23, 2005
408
0
86
Hmm -- I guess I don't necessarily know how to answer the question from a mathematical point of view

I posit that the reason gas stations cluster is that they cluster around areas of high demand, i.e. a busy intersection. Each gas station can only support so many cars, and by having more than one around, you avoid saturation. Additionally, through there is some brand loyalty, people will favor going to the gas station that is on the closest corner, or at least avoid having to make a u-turn to get to a gas station. Additionally, having 4 gas stations at an intersection will make the location known to commuters as a place to get gas, thereby driving more business to the intersection.

So even though, spacing them out may be better for the consumer by decreasing driving to the gas station, clustering is beneficial for the gas distributor.

I am a "professional" student -- will be finishing up a masters degree in May and my MD next June -- which means I will have spent the last ... 19 years of my life in school :-/
 
Feb 6, 2007
16,432
1
81
Originally posted by: QED
Ok.. new brain teaser/puzzle. This one is actually fairly simple, but has broad applications in everyday life:

You will generally find competing gas stations are usually very tightly clustered together within a neighborhood (in some areas it's not
uncommon to have 4 gas stations on each corner of a busy intersection!), instead of being equally spread out throughout the whole neighborhood. Some of this can be explained by zoning laws and the uneven distribution of people within an area, etc. But even in an ideal world (one with no zoning laws, all gas stations had the same cheap price, and people are evenly distributed across the neighborhood) gas stations would still cluster-- even though it would be better for consumers if they spread out so you wouldn't have to drive as far to get gas. Why is that?

Because the same tanker trucks are filling up the tanks at each individual station; if they had to make multiple trips around town, they'd charge more in delivery costs, causing gas to be more expensive in different areas.
 

QED

Diamond Member
Dec 16, 2005
3,428
3
0
Originally posted by: Atomic Playboy
Originally posted by: QED
Ok.. new brain teaser/puzzle. This one is actually fairly simple, but has broad applications in everyday life:

You will generally find competing gas stations are usually very tightly clustered together within a neighborhood (in some areas it's not
uncommon to have 4 gas stations on each corner of a busy intersection!), instead of being equally spread out throughout the whole neighborhood. Some of this can be explained by zoning laws and the uneven distribution of people within an area, etc. But even in an ideal world (one with no zoning laws, all gas stations had the same cheap price, and people are evenly distributed across the neighborhood) gas stations would still cluster-- even though it would be better for consumers if they spread out so you wouldn't have to drive as far to get gas. Why is that?

Because the same tanker trucks are filling up the tanks at each individual station; if they had to make multiple trips around town, they'd charge more in delivery costs, causing gas to be more expensive in different areas.

That does probably explain a big portion of it. But the same phenomon can be seen with just about every other competitive business--even those with little or no common distribution costs. For instance, you will often find clusters of fast-food restaurants together, even if they aren't serviced by the same supply trucks.

So from a very practical point of view, you are right.

But in a theoretical mathematic world, why would competing businesses ever choose to practically share locations with their competitors instead of opening their own distinct location?
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |