Suppose that XP BernoulliP and P Uniform01 How do I find t
Suppose that X|P ~ Bernoulli(P) and P ~ Uniform(0,1). How do I find the marginal distribution of X?
Solution
Assuming that
 X= 1 when the outcome is a success
 X = 0 when outcome is a failure
 If p is the probability of a success then the pmf is, p(0) =P(X=0) =1-p p(1) =P(X=1) =p
P is a Bernoulli random variable if it has the above pmf for p between 0 and 1.
Expected value of Bernoulli r. v.:
 E(X) = 0*(1-p) + 1*p = p
Variance of Bernoulli r. v.:
 E(X2) = 02*(1-p) + 12*p = p
 Var(X) = E(X2) - (E(X))2 = p - p2 = p(1-p)
------------------
For multiple trials
For each i{1,2,…,k}, Yi has the binomial distribution with parameters n and pi:
P(Yi=j) = (nj)pji(1pi)nj, j{0,1,…,n}
There is a simple probabilistic proof. If we think of each trial as resulting in outcome i or not, then clearly we have a sequence of n Bernoulli trials with success parameter pi.
Random variable Yi is the number of successes in the n trials.

