Binomial expectation and variance

Suppose we have repeated Bernoulli trials X1,,Xn with XiBer(p).

The sum is a binomial variable: Sn=i=1nXi.

We know E[Xi]=p and Var[Xi]=pq.

The summation rule for expectation:

E[Sn]=i=1nE[Xi]i=1npnp

The summation rule for variance:

Var[Sn]=i=1nVar[Xi]+2i<jCov[Xi,Xj]i=1npq+20npq

Multinomial covariances

Each trial of an experiment has possible outcomes labeled 1,,r with probabilities of occurrence p1,,pr. The experiment is run n times.

Let Xi count the number of occurrences of outcome i. So XiBin(n,pi).

Find Cov[Xi,Xj].

Solution

Notice that Xi+Xj is also a binomial variable with success probability p=pi+pj. (‘Success’ is an outcome of either i or j. ‘Failure’ is any other value.)

The variance of a binomial is known to be npq.

Compute Cov[Xi,Xj] by solving:

Var[Xi+Xj]=Var[Xi]+Var[Xj]+2Cov[Xi,Xj]n(pi+pj)(1(pi+pj))=npi(1pi)+npj(1pj)+2Cov[Xi,Xj]Cov[Xi,Xj]=npipj

Hats in the air

All n sailors throws their hats in the air, and catch a random hat when they fall back down.

(a) How many sailors do you expect will catch the hat they own?

(b) What is the variance of this number?

Solution

Strangely, the answers are both 1, regardless of the number of sailors. Here is the reasoning:

(a) Let Xi=1 when sailor i catches their own hat, and Xi=0 otherwise. Thus Xi is Bernoulli with p=1/n.

Now X=i=1nXi counts the total number of hats caught by their owners.

Note that E[Xi]=1/n. Therefore:

E[X]E[i=1nXi]i=1nE[Xi]i=1n1n1

(b) We know:

Var[X]i=1nVar[Xi]+2i<jCov[Xi,Xj]

Now calculate Var[Xi]:

Use Var[Xi]=E[Xi2]E[Xi]2. Observe that Xi2=Xi. Therefore:

Var[Xi]1n1n2n1n2

Now calculate Cov[Xi,Xj]:

Cov[Xi,Xj]=E[XiXj]E[Xi]E[Xj]

We need to compute E[XiXj].

Notice that XiXj=1 when i and j both catch their own hats, and 0 otherwise. So it is Bernoulli. Then:

P[Xi=1andXj=1]1n(n1)E[XiXj]=1n(n1)

Therefore:

Cov[Xi,Xj]1n(n1)1n1n1n2(n1)

Putting everything together:

Var[X]i=1nVar[Xi]+2i<jCov[Xi,Xj]i=1nn1n2+2i<j1n2(n1)n1n+n(n1)1n2(n1)1

Months with a birthday

Suppose study groups of 10 are formed from a large population.

For a typical study group, how many months out of the year contain a birthday of a member of the group? (Assume all 12 months have equal duration.)

Solution

(1) Let Xi be 1 if month i contains a birthday, and 0 otherwise.

So we seek E[X1++X12]. This equals E[X1]++E[X12].

The answer will be 12E[Xi] because all terms are equal.


(2) For a given i:

P[no birthday in month i]=(1112)10

The complement event:

P[at least one birthday in month i]=1(1112)10

(3) Therefore:

12E[Xi]=12(1(1112)10)6.97

Pascal expectation and variance

(1) Let XPasc(,p).

Let X1,X2, be independent random variables, where:

  • X1 counts the trials until the first success
  • X2 counts the trials after the first success until the second success
  • Xi counts the trials after the (i1)th success until the ith success

Observe that X=i=1Xi.


(2) Notice that XiGeom(p) for every i. Therefore:

E[Xi]=1pVar[Xi]=1pp2

(3) Using the summation rule, conclude:

E[X]i=11ppVar[X]i=1qp2qp2