Find marginal distribution of Y while knowing distribution of X and $Y|X$ Assume that X is uniformly distributed on (0, 1) and that the conditional distribution of Y given $X = x$ is a binomial distribution with parameters $(n, x)$. Then we say that Y has a binomial distribution with fixed size n and random probability parameter.
I have to find the marginal distribution of Y.
So I have to use that:
$$P(Y=y)=\sum_{x=y}^{\infty}P(Y=y|X=x)P(X=x)$$
But when we have that X is uniformly distributed I think the sum becomes a integral so we get:
$$P(Y=y) =\int_0^1 \binom{n}{y} x^y(1-x)^{n-y}dx$$
But what to do next? I think maybe take the binomial coefficient out from the integral, but how then using this to find the marginal distribution of Y? Hope anyone can help me? Do I also have to use that Y has a binomial distribution with fixed size n and random probability parameter?

Using the definition of the Beta function and that $n$ and $y$ are integers with $0 \le y \le n$ on the support
$$\int_0^1 \binom{n}{y} x^y(1-x)^{n-y}dx  \\ =\binom{n}{y}\int_0^1 x^y(1-x)^{n-y}dx \\ =\binom{n}{y}\operatorname{B}(y+1,n-y+1) \\= \binom{n}{y}\frac{\Gamma(y+1)\Gamma(n-y+1)}{\Gamma(n+2)} \\= \frac{n!}{y!(n-y)!}\frac{y!(n-y)!}{(n+1)!} \\= \frac1{n+1}$$
So the marginal distribution for $Y$ has $Y$ uniformly distributed on $\{0,1,2,\ldots,n-1,n\}$
