# Imagine the following simple game: flip a fair coin repeatedly, winning $1 for every head and losing

## Question:

Imagine the following simple game: flip a fair coin repeatedly, winning $1 for every head and losing $1 for every tail. Your net winnings will potentially oscillate between positive and negative numbers as play continues. How many times do you think net winnings will change signs in, say, 1000 coin flips? 5000 flips?

a. Let X = the number of sign changes in 1000 coin flips. Write a program to simulate X, and use your program to estimate the probability of at least 10 sign changes.

b. Use your program to estimate both E(X) and SD(X). Does your estimate for E(X) match your intuition for the number of sign changes?

c. Repeat parts (a)–(b) with 5000 flips.

## Step by Step Answer:

**Related Book For**

## Modern Mathematical Statistics With Applications

**ISBN:** 9783030551551

3rd Edition

**Authors:** Jay L. Devore, Kenneth N. Berk, Matthew A. Carlton