Finding expected values by simulation

How can we calculate expected values in practice? You know the mathematical recipe, but that requires that you start with the probability of each outcome. Expected values that are too difficult to compute in this way can be found by simulation. The procedure is as before: give a probability model, use random digits to imitate it, and simulate many repetitions. By the law of large numbers, the average outcome of these repetitions will be close to the expected value.

EXAMPLE 4 We want a girl, again

A couple plan to have children until they have a girl or until they have three children, whichever comes first. We simulated 10 repetitions of this scheme in Example 4 of Chapter 19 (page 452). There, we estimated the probability that they will have a girl among their children. Now we ask a different question: how many children, on the average, will couples who follow this plan have? That is, we want the expected number of children.

The simulation is exactly as before. The probability model says that the sexes of successive children are independent and that each child has probability 0.49 of being a girl. Here are our earlier simulation results—but rather than noting whether the couple did have a girl, we now record the number of children they have. Recall that a pair of digits simulates one child, with 00 to 48 (probability 0.49) standing for a girl.

6905 16 48 17 8717 40 9517 845340 648987 20
B G G G G B G G B G B B G B B B G
2 1 1 1 2 1 2 3 3 1

The mean number of children in these 10 repetitions is

We estimate that if many couples follow this plan, they will average 1.7 children each. This simulation is too short to be trustworthy. Math or a long simulation shows that the actual expected value is 1.77 children.

473

NOW IT’S YOUR TURN

Question 20.2

20.2 Stephen Curry’s field-goal shooting. Stephen Curry makes about 49% of the field-goal shots that he attempts. On average, how many field-goal shots must he take in a game before he makes his first shot? In other words, we want the expected number of shots he takes before he makes his first. Estimate this by using 10 simulations of sequences of shots, stopping when he makes his first. Use Example 4 to help you set up your simulation. What is your estimate of the expected value?