To start the game of Blackjack, players are dealt two cards at random from a shuffled deck.
You write the following code to simulate the act of dealing an initial hand. To test the code, you deal a hand times and record the number of times the player makes Blackjack on their first two cards. If the code is written correctly, what do you expect to find for , the fraction of initial hands that are Blackjack?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Assumptions and Details
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Warning: I have just used brute-force. It is very inefficient and slow, but it was the best I could do. Also, the answer is not precise, and keeps on changing every time the code is run. The precise answer can be obtained by running this code several times and taking an average.
I would like to see a better solution.
To get f ^ blackjack , we divide
count_True
bycount
.When I ran this code, I got
count_True
= 4 8 2 1 5 , so the fraction f ^ blackjack ≈ 0 . 0 4 8 2