In: Statistics and Probability
Suppose that we have a red coin and a blue coin. The red coin has probability pR = 0.1 of landing heads, and the blue coin has probability pB = 0.2 of landing heads.
(a) Write R code to generate a sequence of coin tosses, starting with the red coin, and switching coins every time a coin lands heads.
(b) Generate 1000 such sequences, each consisting of 1000 coin tosses, and use them to construct a plot of the 2.5%, 50% and 97.5% quantiles of the proportion of red coins tossed as the number of tosses increases. (c) What is the stationary distribution of colours for this process? Comment on how this experiment relates to Birkhoff’s ergodic theorem