I saw a card trick on YouTube amongst my late night YouTube surfing, and thought to take a moment to give an explanation as to how it works. It's not an illusion of any sort, no slight of hand is involved. It's simple mathematics.
The trick relies on one thing: The cards for each suit are ordered, thus the n+13 th card in the deck is the card n of the next suit.
Cutting the deck doesn't change the order of the cards. If I have an array of ( 1,2,3,4,5,6,7,8 ) and I 'cut' the array at 4, my array is ( 5,6,7,8,1,2,3,4 ) thus the elements are still ordered. Flipping the deck over only affects the order in which the suits present. It also does not matter that the cards are ordered king-to-ace, ace-to-king, or 10-to-ace-jack-to-king, etc. as long as they are in the same order for each suit.
I wrote a perl script to illustrate this, exactly as the feller does it in the video. I posted a video response on YouTube.
#!/usr/bin/perl -wuse Data:: Dumper; use strict; # 1. The deck, with all suits ordered King to Acemy @deck = ( 'Kh', 'Qh', 'Jh', '10h', '9h', '8h', '7h', '6h', '5h', '4h', '3h', '2h', 'Ah', 'Kc', 'Qc', 'Jc', '10c', '9c', '8c', '7c', '6c', '5c', '4c', '3c', '2c', 'Ac', 'Kd', 'Qd', 'Jd', '10d', '9d', '8d', '7d', '6d', '5d', '4d', '3d', '2d', 'Ad', 'Ks', 'Qs', 'Js', '10s', '9s', '8s', '7s', '6s', '5s', '4s', '3s', '2s', 'As'); # 2. Cut the deck in a random place 5 times with the cards in reverse order (bottom up.)srand(time); @deck = reverse @deck; for (my $i= 0; $i< 5; $i++ ) { my @slice = splice(@deck, 0, rand($ #deck + 1)); splice(@deck,$ #deck + 1,0,@slice);}# 3. Flip the deck over, and cut 8 more times.@deck = reverse @deck; for (my $i= 0; $i< 8; $i++ ) { my @slice = splice(@deck, 0, rand($ #deck + 1)); splice(@deck,$ #deck + 1,0,@slice);}print "Deck after 13 cuts and two reversals:\n" . Data:: Dumper-> Dump([\ @deck]) . "\n"; # 4. Lay the cards out in 13 pilesmy @piles = (); for (my $i= 0; $i< 13; $i++ ) { my @pile = (); push @piles,\ @pile; }for (my $j= 0; $j<$ #deck + 1;$j+=13) { for (my $i= 0; $i< 13; $i++ ) { my @pile = @ {$piles[$i]}; push @pile, $deck[$j + $i]; $piles[$i] = \ @pile; }}# 5. List the pilesfor (my $i= 0; $i< 13; $i++ ) { my @pile = @ {$piles[$i]}; print "Pile $i:\n" . Data:: Dumper-> Dump([\ @pile]) . "\n"; } exit;
Which gives the output (manually condensed):
$ perl 13.pl
Deck after 13 cuts and two reversals:
$VAR1 = [
'3h', '2h', 'Ah', 'Kc', 'Qc', 'Jc', '10c', '9c', '8c', '7c', '6c', '5c', '4c',
'3c', '2c', 'Ac', 'Kd', 'Qd', 'Jd', '10d', '9d', '8d', '7d', '6d', '5d', '4d',
'3d', '2d', 'Ad', 'Ks', 'Qs', 'Js', '10s', '9s', '8s', '7s', '6s', '5s', '4s',
'3s', '2s', 'As', 'Kh', 'Qh', 'Jh', '10h', '9h', '8h', '7h', '6h', '5h', '4h'
];
Pile 0: $VAR1 = [ '3h', '3c', '3d', '3s' ];
Pile 1: $VAR1 = [ '2h', '2c', '2d', '2s' ];
Pile 2: $VAR1 = [ 'Ah', 'Ac', 'Ad', 'As' ];
Pile 3: $VAR1 = [ 'Kc', 'Kd', 'Ks', 'Kh' ];
Pile 4: $VAR1 = [ 'Qc', 'Qd', 'Qs', 'Qh' ];
Pile 5: $VAR1 = [ 'Jc', 'Jd', 'Js', 'Jh' ];
Pile 6: $VAR1 = [ '10c', '10d', '10s', '10h' ];
Pile 7: $VAR1 = [ '9c', '9d', '9s', '9h' ];
Pile 8: $VAR1 = [ '8c', '8d', '8s', '8h' ];
Pile 9: $VAR1 = [ '7c', '7d', '7s', '7h' ];
Pile 10: $VAR1 = [ '6c', '6d', '6s', '6h' ];
Pile 11: $VAR1 = [ '5c', '5d', '5s', '5h' ];
Pile 12: $VAR1 = [ '4c', '4d', '4s', '4h' ];
|