1

I have $X_n$ - number of heads after $n$ coin tosses with $X_n\mid P=p \sim \operatorname{Bin}(n,p) $ and $P \sim \operatorname{U}(0,1)$

To find $P(X_3=2)$, I did the following:

$$P(X_n=k)=\int_0^1 {n \choose k}x^k(1-x)^{n-k}\cdot 1 \, dx ={n \choose k} \int_0^1 x^{(k+1)-1}(1-x)^{(n+1-k)-1} \, dx= {n \choose k} \frac {\Gamma(k+1)\Gamma(n+1-k)}{\Gamma(k+1+n+1-k)}=\frac{n!(n-k)!}{k!(n-k)!(n+1)!} = \frac{1}{n+1}$$

$$P(X_3=2)=\frac{1}{3+1}=\frac{1}{4}$$

Is this correct? I would like to be sure.

Thank you!

  • By "$P\in U(0,1)$" do you mean that $P$ is uniformly distributed over $(0,1)$, and by "$X_n\mid P=p\in \mathrm{Bin}(n,p)$" that the distribution of $X_n$ conditioned on ${P=p}$ is $\mathrm{Bin}(n,p)$? – Math1000 Mar 21 '18 at 02:54
  • Yes - that is what I mean. Maybe I should have used ~ – user629034 Mar 21 '18 at 02:58
  • Since $\in$ denotes set membership, its use in this context is confusing (and incorrect). – Math1000 Mar 21 '18 at 02:59
  • 1
    Anyway, your approach is correct, and I found the same result for the integral with Mathematica. – Math1000 Mar 21 '18 at 03:04
  • Note the use of \sim and \mid and \operatorname and other features in my edit to this question. – Michael Hardy Mar 21 '18 at 03:06
  • Your bottom line is certainly right. – Michael Hardy Mar 21 '18 at 03:07
  • 1
    You have $\dfrac{n!(n-k)!}{k!(n-k)!(n+1)!}$ where you need $\dfrac{n!(n-k)!k!}{k!(n-k)!(n+1)!},$ but you obviously took into account the factor of $k!$ that you did not write here. – Michael Hardy Mar 21 '18 at 03:11
  • Here's essentially the same result proved a bit differently: https://math.stackexchange.com/questions/86542/prove-binomnk-1-n1-int-01xk1-xn-kdx-for-0-leq-k-le/86578#86578 – Michael Hardy Mar 21 '18 at 03:12

0 Answers0