R Markdown

1 A die is rolled 24 times. Use the CLT to estimate the probability that: a. the sum is greater than 84 b. the sum is equal to 84

The expected value is 3.5 * 24 = 84 The variance is \(24 * \frac{35}{12} =70\) The standard deviation is $=$8.3666003

Since the expected value is 84, the odds of it being above or below that value are 50%.

  1. We can think of this probability as being the odds of getting a roll between 83.5 and 84.5, with a resulting distance of 0.5 / 1 s.d. distance from the mean on each side. This distance is equivalent to 0.0597614

The probability is then the area under the curve for the area +/- 0.06 S.D. from the mean. Using r’s pnorm function for the bounds 83.5 and 84.5, the difference in cumulative probability is 4.8% - thus the probability of obtaining the expected value of 84 is equivalent to about 5%.

pnorm(84.5, mean = 84, sd = sqrt(70))- pnorm(83.5, mean = 84, sd = sqrt(70))
## [1] 0.04765436

As the number of rolls and expected value increases, the likelihood of obtaining the expected value will decrease. For 1,000 rolls, that probability is 0.7%

stdev = sqrt(1000*35/12)
pnorm(3500.5, mean = 3500, sd = stdev) - pnorm(3499.5, mean = 3500, sd = stdev)
## [1] 0.00738687

2.A random walker starts at 0 on the x-axis and at each time unit moves 1 step to the right or 1 step to the left with probability 1/2. Estimate the probability that, after 100 steps, the walker is more than 10 steps from the starting position.

~2.3%. 10 steps is 2 standard deviations from the mean, whose area under the curve of a normal distribution is ~2.3%

n = 100
p = 0.5
q = 1 - p
var = n*p*q
sd = sqrt(var)
1 - pnorm(10, mean = 0, sd = sd)
## [1] 0.02275013
  1. A tourist in Las Vegas was attracted by a certain gambling game in which the customer stakes 1 dollar on each play; a win then pays the customer 2 dollars plus the return of her stake, although a loss costs her only her stake. Las Vegas insiders, and alert students of probability theory, know that the probability of winning at this game is 1/4. When driven from the tables by hunger, the tourist had played this game 240 times. Assuming that no near miracles happened, about how much poorer was the tourist upon leaving the casino?

The expected loss from one round is $0.25. From 240 rounds, it is $60.

What is the probability that she lost no money? Zero. With an expected value of $60, and a standard deviation of sqrt(2400.250.75) = 6.7, a corresponding z score of 60/6.7 = ~8.96, there is approximately zero chance she will have any net winnings.

ExpectedValue = 0.25*2 + 0.75*-1
ExpectedLosses = ExpectedValue*240
n = 240
p = 0.25
q = 1- p
stdev = sqrt(n*p*q)
pnorm(0, mean = -60, sd = stdev)
## [1] 1
plot(density(rnorm(240, mean = -60, sd = sqrt(240*0.25*0.75))), 
     main = "Expected Winnings")