A quick question on Expectation and Variance

66 Views Asked by At

Question:

  1. For a particular flight, there are 100 seats available and 103 tickets have been sold
  2. the probability that a passenger may not show up, is $p$. (where $0 < p < 1$ )

What is the variance of the number of people who show up for the flight?

From my understanding,

$Var(x) = E[x^2] - (E[x])^2$

$ x$ ~ $Binomial(n, 1-p)$,

=> $E[x] = n*p = 103(1-p)$

But for $E[x^2]$,

for $x^2$ is that also a binomial distribution like $x$? (I get stucked here)

How could we calculate $E[x^2]$ in this case?


Many thanks!

1

There are 1 best solutions below

0
On

First of all $$\mathrm{Var} X = \mathbb{E}\left[X^2\right] - \mathbb{E}[X]^2.$$

As you noted correctly, $$ \mathbb{E}[X] = np = 103(1-p) $$ Now, for each of the passengers $x_i$ you get a Bernoulli distribution with 1 as success as 0 as a failure, and $$ \mathbb{E}[x_i^2] = 1^2p + 0^2(1-p)=p $$ so $$ \mathrm{Var} x_i = \mathbb{E}\left[x_i^2\right] - \mathbb{E}[x]^2 = p - p^2 = p(1-p). $$

In our case, we have $X = \sum_{i=1}^n x_i$ which are independent and identically distributed random variables, so $$ \mathrm{Var} X = \sum_{i=1}^n \mathrm{Var\ } x_i = \sum_{i=1}^n p(1-p) = np(1-p). $$

The alternative way is to remember that your random variable $X$ can take on values $0, 1, \ldots, n =103$ with probability $$p_k = \binom{n}{k} p^k (1-p)^{n-k},$$ so just like $$ \mathbb{E}[X] = \sum_{k=0}^n k \cdot p_k = \sum_{k=0}^n k \cdot \binom{n}{k} p^k (1-p)^{n-k} $$ we also have (using the Law of the Unconscious Statistician) $$ \mathbb{E}\left[X^2\right] = \sum_{k=0}^n k^2 \cdot p_k = \sum_{k=0}^n k^2 \cdot \binom{n}{k} p^k (1-p)^{n-k} $$ To compute something like that analytically you note that $$ \sum_{k=0}^n k^2 \cdot \binom{n}{k} p^k (1-p)^{n-k} = (1-p)^n \sum_{k=0}^n \binom{n}{k} k^2 \left(\frac{p}{1-p}\right)^k $$ which can be obtained by manipulating the second derivative of $$ \sum_{k=0}^n \binom{n}{k} z^k $$ and let $z = p/(1-p)$.