# Conditional probability involving coin flips

A coin has an unknown head probability $p$. Flip $n$ times, and observe $X=k$ heads. Assuming an uniform prior for $p$, then the posterior distribution of $p$ is $B(\alpha = k + 1, \beta = n - k + 1)$. Consider $Y$ = number of additional flips required until the first head appears. Find the following distributions:

• $P(Y=j|p=\theta)$, for j = 1,2,3,...
• $P(Y=j|X=k)$, for j = 1,2,3,...

I think $P(Y=j|p = \theta) = \frac{P(Y=j,p=\theta)}{P(p=\theta)}$ and similarly for part 2. But are the RV's independent? And how do I find their joint pdf?

$\mathsf P(Y=j\mid p=\theta)$ is the conditional probability of $j$ aditional flips until another head shows for a given bias for the coin (after $X=k$ in $n$ flips).   What is the (conditional) distribution used for this?   (Hint: you do not need to resort to Bayes' for this; just identify the model.)

$\mathsf P(p=\theta)$ is the prior distribution of the bias; you are told to evaluate it using two cases: (1) $p$ is Uniform$(0;1)$, (2) $p$ is Beta$(\alpha:=k+1,\beta:=n-k+1)$

Random variables $p, Y$ are not independent, and their joint probability is the product of the prior of $p$ and the conditional of $Y$ given $p$.   $\mathsf P(Y=j\mid p=\theta)~\mathsf P(p=\theta)$

Then, for each type of prior, you are tasked to find the posterior: $\mathsf P(p=\theta\mid Y=j)$, and this is where you apply Bayes' rule

$$\mathsf P(p=\theta\mid Y=j)~=~\dfrac{\mathsf P(Y=j\mid p=\theta)~\mathsf P(p=\theta)}{\int\limits_0^1\mathsf P(Y=j\mid p=t)~\mathsf P(p=t)\operatorname d t}$$

• Thanks! But I'm not sure what $P(Y=j|p=\theta)$ is. Also, this is the actual question. I'm sorry for the confusion. – user3727610 Apr 25 '16 at 1:17
• So for the first one, it's just $P(Y=j|p=\theta) =(1-\theta)^{j-1}\theta$? – user3727610 Apr 25 '16 at 3:11