I ran a diagnostic version (i.e. pre-arranging all cards into number/face/suit order) and ran the trick "open" (with all cards faced up) I sort-of saw how some of it worked (e.g. at one point the deck has only even cards) - so my guess is it's similar to interleaving (ref Reed-Solomon interleaving used in comms Forward Error Correction - this relies on certain "factors" which must be prime number (15/9)) - but I could be wrong and didn't think any further about it. (It reminded me that I once coded a variable-sized interleaver/de-interleaver in TMS 320C25.)
So there are 3 cards, let's call them a, b and c. And 4 'piles' containing 10,15,15 and 9 cards respectively. So, we place a on top of pile 1 - that makes it the 11th card from the bottom. Then we cut the second pile into 2 sub piles (this is where the redirection happens - so pay attention for later on this bit) The top of these sub-piles is placed on top of pile 1. Then card b is placed ON TOP of the remainder of pile 2. Then card c is placed on top of pile number 3. The nine cards of pile number 4 are then picked up. Pile 3 has 15 cards + c at the top of them (16 cards in total) and is added to the bottom of the pile number 4 - that means that c is 10 cards from the top. Then pile number 2 containing an unknown number of cards is added to the bottom of the pile in hand, with the top card being card b. This means that card c is 10 cards from the top, and card b is now 9+1+15+1=25 cards from the top. Then the remaining card pile is added to the bottom of the pile. This is where the redirection comes in. There is an unknown number of cards at the top of that pile that were originally from pile 2. BUT, all we've done is recombine pile 2 back into it's original 15-card configuration. That means we can be certain that card a is now 9+1+15+1+15+1 cards from the top. So, going back over what we have Card c is at position 10 Card b is at position 26 Card a is at position 42
Now, if we take each alternate card out of and make it face-up - that's cards from positions: 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51 now face up Leaving the rest - so now Card c is at position 10-5 = 5 Card b is at position 26-13=13 Card a is at position 42-21=21 You've extracted 52/2 cards, so there's only 26 left at this point.
Do the second alternate card thing - only this time, make sure you do it the other way around, so that (using the new positions) 2,4,6,8,10,12,14,16,18,20,22,24,26 are extracted (face up) Having removed those, there are now 26/2 = 13 cards left
Now the remaining cards a,b c are at positions: 5-2=3 13-6=7 21-10=11
Do it again, removing this time (new positions) 2,4,6,8,10,12 Leaving 6 cards and leaving a, b and c at positions: 3-1=2 7-3=4 11-5=6 (Notice now how the a,b,c cards are getting closer to one another each time?)
Smart! Well done! Of course, you'll be on The Magic Circle's hit list now.
{Oh, and I must have been talking bollocks :) But it really did remind me of interleaving - You arrange 9 columns of 64 , and add data at index (27xn) modulo 64. Being a prime the column will fill, but psuedo-randomly. Continue filling the next column and so on. Then extract the data in Row order. This effectively scambles the data -meaning burst errors are ditributed when the data's de-interleaved... Which, indidently uses a step of 13 (i.e. 13xn mod 64) }
So...someone explain this!
ReplyDeleteI ran a diagnostic version (i.e. pre-arranging all cards into number/face/suit order) and ran the trick "open" (with all cards faced up)
ReplyDeleteI sort-of saw how some of it worked (e.g. at one point the deck has only even cards) - so my guess is it's similar to interleaving (ref Reed-Solomon interleaving used in comms Forward Error Correction - this relies on certain "factors" which must be prime number (15/9)) - but I could be wrong and didn't think any further about it.
(It reminded me that I once coded a variable-sized interleaver/de-interleaver in TMS 320C25.)
It's a bit of a swizz (obviously)
ReplyDeleteSo there are 3 cards, let's call them a, b and c.
And 4 'piles' containing 10,15,15 and 9 cards respectively.
So, we place a on top of pile 1 - that makes it the 11th card from the bottom.
Then we cut the second pile into 2 sub piles (this is where the redirection happens - so pay attention for later on this bit)
The top of these sub-piles is placed on top of pile 1.
Then card b is placed ON TOP of the remainder of pile 2.
Then card c is placed on top of pile number 3.
The nine cards of pile number 4 are then picked up.
Pile 3 has 15 cards + c at the top of them (16 cards in total) and is added to the bottom of the pile number 4 - that means that c is 10 cards from the top.
Then pile number 2 containing an unknown number of cards is added to the bottom of the pile in hand, with the top card being card b.
This means that card c is 10 cards from the top, and card b is now 9+1+15+1=25 cards from the top.
Then the remaining card pile is added to the bottom of the pile.
This is where the redirection comes in.
There is an unknown number of cards at the top of that pile that were originally from pile 2.
BUT, all we've done is recombine pile 2 back into it's original 15-card configuration.
That means we can be certain that card a is now 9+1+15+1+15+1 cards from the top.
So, going back over what we have
Card c is at position 10
Card b is at position 26
Card a is at position 42
Now, if we take each alternate card out of and make it face-up - that's cards from positions:
1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51 now face up
Leaving the rest - so now
Card c is at position 10-5 = 5
Card b is at position 26-13=13
Card a is at position 42-21=21
You've extracted 52/2 cards, so there's only 26 left at this point.
Do the second alternate card thing - only this time, make sure you do it the other way around, so that (using the new positions)
2,4,6,8,10,12,14,16,18,20,22,24,26 are extracted (face up)
Having removed those, there are now 26/2 = 13 cards left
Now the remaining cards a,b c are at positions:
5-2=3
13-6=7
21-10=11
Do it again, removing this time (new positions)
2,4,6,8,10,12
Leaving 6 cards and leaving a, b and c at positions:
3-1=2
7-3=4
11-5=6
(Notice now how the a,b,c cards are getting closer to one another each time?)
OK, last time, now remove cards
1,3,5
And guess what - you're magic!
Smart! Well done! Of course, you'll be on The Magic Circle's hit list now.
ReplyDelete{Oh, and I must have been talking bollocks :) But it really did remind me of interleaving - You arrange 9 columns of 64 , and add data at index (27xn) modulo 64. Being a prime the column will fill, but psuedo-randomly. Continue filling the next column and so on. Then extract the data in Row order. This effectively scambles the data -meaning burst errors are ditributed when the data's de-interleaved... Which, indidently uses a step of 13 (i.e. 13xn mod 64) }
S,art Card Trick to music... Same technique?
ReplyDelete