Consider an innite sequence of i.i.d. tosses T1,T2,T3, . . . of a biased coin
Consider an infinite sequence of i.i.d. tosses T1, T2, 73, . .. of a biased coin which lands on tails with probability q = = on each toss. Let N be the number of the coin toss which is the first to land on heads (so N = min(i : Ti = H}). (a) What is the name (including parameter) of the distribution of N? 1 pt (b) Write down the moment-generating function my(t) = B[et~] of N, in simplified form. Make sure to specify the domain of inputs t for which it exists. 3 pts (c) Using (b), find the first three raw moments of N. 6 pts (d) Let M be independent of N with the same distribution, and let L = N + M. From your answer to part (b), derive the moment-generating function of L. 2 pts (e) Consider a Bayesian model for K = Et_, 1 (T; = H), the number of heads tossed in the first n turns, where the parameter q has the prior distribution q ~ Uniform(0, 1) . Write down the likelihood L(q; k) of q with the observation K = k and use it to find the posterior density f (q | k) of q given K = k (up to constants, i.e., without necessarily including the correct constant of proportionality). 4 pts (f) Find the posterior mode q of q given K. Does the posterior mode actually minimise the posterior expected value of the indicator (zero-one) loss function if q # q, L(q, q) = 1(9#9) = o if q = q, or is this only notionally correct? Why or why not? 4 pts (g) Now return to the frequentist world and set up an approximate test (for large n) of the null hypothesis that the coin is fair against the alternative hypothesis that the coin is biased in favour of heads. Write down the hypotheses, the test statistic, its approximate distribution under the null hypothesis, and an approximate rejection region at the 5% significance level. 3 pts (h) Perform your hypothesis test from (g) with n = 40 coin flips, of which we observe 25 to be heads. Also provide an approximate p-value for the test. 3 pts