You are the perfomer, Mr X the viewer, whom you instruct as follows:
" 1.Shuffle this deck (a standard deck contains 52 cards) thoroughly and deal out nine cards in a row, face down.
2.Choose a card, look at it, be sure to remember it, and assemble the nine cards into a stack face down, with the chosen card at the top.
3.Add this stack to the bottom of the deck.
4.
Now deal cards one at a time from the top of the deck into a pile, face up, counting backward from 10 as you do so.
If at some point the card’s rank matches the number said, then begin dealing into a new pile at that point, counting again backward from 10.
Court cards i.e. J, Q, K count as 10.
If you reach 1 without a match occurring, then “close” that pile by dealing a facedown card onto it, and start a new pile.
Contrary to formal English definition this puzzle approves existence of 1card pile.
5.
Keep this up until you’ve created four piles. Now add the values of any faceup cards on top of the piles (if there is a face down card  consider it as zero value), count down through the remaining cards (face down) until you’ve reached the position corresponding to the sum, and turn the last card , that complets your count face up and
BINGO it is indeed your chosen card.
Hey, you did it! ...How?? "
This works because ....(fill in your explanation).
The chosen card is the 9th counting from the bottom, so there are 43 cards above it in the deck.
Each creation of one of the four piles in effect "burns", either immediately or postponed, 11 cards from the top. This totals 44 and the trick relies on at least one of these burned cards being in the postponed category so that the last one is the 44th card, the one chosen.
The randomness of the countdown from 10 matching some card's value is illusory. If the match is on, say 3, you're on count 3, which means you are on the 8th card placed on the pile that is forming and you're leaving a marker that will later be used to count out 3 more cards, for a total of 11. If there's no match, you pick an 11th card, which counts as zero later as it's placed face down on the top.
When this was on the queue I worried about what the face cards counted as. But counting them as 10, as Ady added, is just like any other 10. If they counted as 11, 12 and 13, they would act just like any other nonmatch, so it wouldn't make a difference. It required me to write a simulation program before I could understand the details fully enough.
If no match occurs in any of the pile formations, all 44 of the cards to be burned will have been immediate, leaving only 8 cards in the main deck, with zero to be counted out later, preventing the last step from taking placethere are no cards to start counting out as indeed the four piles are all topped with zero value, and the the chosen card is the top card on the last pile formed.
In a simulation of 10,000 trials the exceptional case described happened 141 times. (That's an interesting probability question in itself, and its answer would be affected by the values chosen for the face cards. I seem to remember that in uncomplicated cases of card matching the probability is related to the number e.)
It would seem that it would be advantageous to have the subject deal out only 8, rather than 9, cards at the beginning, to be placed under the rest of the deck. And, of course, change the rule so that the magically appearing card is the top one that's left after dealing out the sum of the top values of the four decks. That way, if no further dealing is needed, the chosen card is always on top of the remaining 8 cards, no exception.
DefDbl AZ
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For trial = 1 To 10000
d$ = "111122223333444455556666777788889999xxxxjjjjqqqqkkkk"
d0$ = ""
For i = 1 To 52
r = Int(Rnd(1) * Len(d$) + 1)
d0$ = d0$ + Mid(d, r, 1)
d = Left(d, r  1) + Mid(d, r + 1)
Next
goal$ = Mid(d0, 53  9, 1) ' this is the designated card chosen randomly and placed 9 from the bottom
' actual goal is to have 9 cards remaining in deck (8 after the countdown)
ReDim deck$(4)
For newdeck = 1 To 4
For countdn = 10 To 1 Step 1
v = Val(Left(d0, 1)): If v = 0 Then v = 10
cd$ = Left(d0, 1)
d0 = Mid(d0, 2)
deck$(newdeck) = deck$(newdeck) + cd
If v = countdn Then
Exit For
End If
Next countdn
If countdn = 0 Then ' Exit For was never taken
d0 = Mid(d0, 2)
deck$(newdeck) = deck$(newdeck) + "0"
End If
Next
countout = 0
For i = 1 To 4
c$ = Right(deck(i), 1)
v = Val(c)
If v = 0 And c <> "0" Then v = 10
countout = countout + v
Next
If countout > 0 Then d0 = Mid(d0, countout)
If Len(d0) < 9 Then
Text1.Text = Text1.Text & Str(Len(d0)) & Str(trial) & crlf
zct = zct + 1
End If
Next trial
Text1.Text = Text1.Text & crlf & zct & " done"
End Sub

Posted by Charlie
on 20150819 15:17:04 