The chance of drawing a "Continue" ticket (with value $x$) is $1-p$. The chance of drawing a "Stop" ticket (with value $0$) is $p$. Write these expectations on their respective tickets: these are the values of the tickets. On one is written "Stop, you tossed heads" on the other is written "Continue, you tossed tails." The expected number of additional tosses in the first case is $0$ while the expected number of additional tosses in the second case is $x$, say-we don't know it yet and have to figure it out. Model the game by drawing a ticket out of a box. Tosses_to_HEAD <- counter # Append number in counter after getting heads. Head <- head + rbinom(1, 1, p) # Toss a coin and add to 'head'Ĭounter <- counter + 1 # Add 1 to 'counter' Head <- 0 # Set the variable 'head' to 0 with every loop.Ĭounter <- 0 # Same forlocal variable 'counter'. Tosses_to_HEAD <- 0 # Setting up an empty vector to add output to. Reps <- 10000 # Total number of simulations. We can run a Monte Carlo simulation to prove it: set.seed(1) Hence we can expect to make two tosses before getting the first head with the the expected number of tails being $E(n+r) - r = 1$. The last steps left implicit should be as follows: The derivation of the expected value can be found here. With k being the total number of tosses including the first 'heads' that terminates the experiment.Īnd the expected value of X for a given p is $1/p=2$. The number of failures k - 1 before the first success (heads) with a probability of success p ("heads") is given by: This can be answered using the geometric distribution as follows:
0 Comments
Leave a Reply. |