# Mean of a binomial distribution

During an election, a proportion $p$ of voters choose candidate $A$, while a proportion $1-p$ choose candidate $B$. A number of $n$ voters have been polled before the election. Let $X_i$ be $1$ or $0$ according to whether or not the $i$th person will vote for $A$. The random variables are independent. What is the expected value $E[\bar X_n]$ and variance $\sigma^2_{\bar X_n}$? where $$\bar X_n = \frac{X_1+...+X_n}{n}$$ Use $\bar X_n$ as an estimator for $p$. Based on the Chebyshev inequality, find the smallest value of $n$ such that $$P(|\bar X_n - p|<= 0.2) >= 0.9$$

-
This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level. – Did Dec 2 '13 at 9:07
"The mean is the sum of indicator variables 1...n over n". Sorry? Could you explain? The formula now added for the mean bar-X_n has no indicator variables in it... – Did Dec 2 '13 at 9:08
@Did : Edited :) – Artemisia Dec 2 '13 at 9:12
Do mean to say here that the $X_{i}$ are i.i.d. and Bernoulli-distributed? (In that case $X=X_{1}+\cdots+X_{n}$ is binomially distributed.) – drhab Dec 2 '13 at 9:20
Come on, Artemisia... Do something about it! People are getting unpatient here. I am the living proof of that and there is a good chance that I am not the only one :-) . – drhab Dec 2 '13 at 9:25

Here $X_{1},\ldots,X_{n}$ are iid with Bernoulli distribution.

Then $S_{n}=X_{1}+\cdots+X_{n}$ is binomially distributed with parameters $p:=P\left\{ X_{1}=1\right\}$ and $n$.

Here $\bar{X}_{n}=\frac{1}{n}S_{n}$ wich makes it easy to find:

$E\left[\bar{X}_{n}\right]=\frac{1}{n}E\left[S_{n}\right]=\frac{1}{n}\times np=p$

and:

$\text{Var}\left(\bar{X}_{n}\right)=\frac{1}{n^{2}}\text{Var}\left(S_{n}\right)=\frac{1}{n^{2}}\times np\left(1-p\right)=\frac{p\left(1-p\right)}{n}$.

Edit

The fact that $S_{n}$ is binomially distributed is not of real importance here. We can also directly conclude that:

$E\left[\bar{X}_{n}\right]=\frac{1}{n}\left(E\left[X_{1}\right]+\cdots+E\left[X_{n}\right]\right)=\frac{1}{n}\left(p+\cdots+p\right)=p$

and:

$\text{Var}\left(\bar{X}_{n}\right)=\frac{1}{n^{2}}\left(\text{Var}\left(X_{1}\right)+\cdots+\text{Var}\left(X_{n}\right)\right)=\frac{1}{n^{2}}\left(p\left(1-p\right)+\cdots+p\left(1-p\right)\right)=\frac{p\left(1-p\right)}{n}$

-
Thanks :) Sorry for the prior confusions. There is an addendum to the question... I will add that now. – Artemisia Dec 2 '13 at 9:41
I have made an edit to my answer, showing that 'binomial' is not of essential importance here. – drhab Dec 2 '13 at 9:50
I am sure that you mean well :-) but it is not very sensible to put an addendum to the question after accepting an answer. By doing so it seems that you accepted an incomplete answer and the person who answered can feel manipulated to make his answer complete. – drhab Dec 2 '13 at 10:02
I understand, haha :) but the addendum is not really relevant to the previous part so I just thought of adding it. I am not sure what the other user intends in his comments- A bit too vague for my comfort. – Artemisia Dec 2 '13 at 10:18
I can assure you that @Did is of very high level! However, a consequence is that his demands - when it concerns questions - are high. I wouldn't say too high and I am speaking from an experience that is very short. Advice: keep him as your friend because he can help you a lot... I can assure you that! – drhab Dec 2 '13 at 10:26