# Binomial distribution where probability parameter is also a distribution

Suppose I have $$J \sim$$ Bin$$(25, P)$$, but instead of having fixed $$P$$, I have a known PDF for continuous $$P$$, given by $$f_{P}(p)$$. How would I find $$\mathbb{E}[J]$$, given this to be the case?

You can use ParameterMixtureDistribution(https://reference.wolfram.com/language/ref/ParameterMixtureDistribution.html)

For example:

pmd = ParameterMixtureDistribution[BinomialDistribution[25, p],

• You could also use Mean[pmd] Dec 21, 2022 at 5:30