 All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars  perplexus dot info  Guessing suit (Posted on 2015-07-20) A player draws the cards from the a 52-card deck one by one, without putting them back in the deck.
Every time before drawing a card he guesses the suit of the card he will draw.
He decides to always guess the suit that occurs most frequently in the remaining deck (if there are several such suits, he chooses any one of them).

Prove that he will guess the right suit at least 13 times. Comments: ( Back to comment list | You must be logged in to post comments.) simulation | Comment 7 of 13 | Following the strategy, the following is the distribution of the number of hits:

` 1     0 2     0 3     0 4     0 5     0 6     0 7     0 8     0 9     010     011     012     013   67314  302215  694816 1186317 1518918 1661619 1485120 1165621  835022  519423  295324  151925   70126   29227   11328    3929    1230     631     332     033     034     035     036     037     038     039     040     041     042     043     044     045     046     047     048     049     050     051     052     0`

The overall average number of hits was 18.41549.

DefDbl A-Z
Dim crlf\$, sremain(4), shist(52)

Form1.Visible = True

Text1.Text = ""
crlf = Chr\$(13) + Chr\$(10)

For x = 1 To 10
Randomize Timer
For tr = 1 To 10000
For i = 1 To 4
sremain(i) = 13
Next
tremain = 52: score = 0
For turn = 1 To 52
mx = sremain(1): wh = 1
For i = 2 To 4
If sremain(i) > mx Then mx = sremain(i): wh = i
Next
r = Int(Rnd(1) * tremain + 1)
For i = 1 To 4
If sremain(i) >= r Then nxtcard = i: Exit For
r = r - sremain(i)
Next
If nxtcard = wh Then score = score + 1
sremain(nxtcard) = sremain(nxtcard) - 1
tremain = tremain - 1
Next turn
shist(score) = shist(score) + 1
Next tr
Next x
wttot = 0
For i = 1 To 52
Text1.Text = Text1.Text & mform(i, "##") & mform(shist(i), "#####0") & crlf
wttot = wttot + i * shist(i)
ntot = ntot + shist(i)
Next
Text1.Text = Text1.Text & wttot / ntot & crlf

Text1.Text = Text1.Text & crlf & " done"

End Sub

Function mform\$(x, t\$)
a\$ = Format\$(x, t\$)
If Len(a\$) < Len(t\$) Then a\$ = Space\$(Len(t\$) - Len(a\$)) & a\$
mform\$ = a\$
End Function

 Posted by Charlie on 2015-07-21 10:25:25 Please log in:

 Search: Search body:
Forums (0)