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!