Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following problem where, given $X_n$ is a random variable that equals the number of tails minus the number of heads when n fair coins are flipped, what is the expected value of $X_n$?

I am having a difficulty getting started on this problem. Could someone offer a suggestion as to how this problem should be modeled?

share|cite|improve this question
up vote 2 down vote accepted

We can start and finish by saying that by symmetry the expected number is $0$.

Or let $X$ be the number of tails. So $n-X$ is the number of heads. Thus tails minus heads is $2X-n$. This has mean $2E(X)-n$, which is $0$. This second argument will also give the answer for a coin that is biased, having probability $p$ of tails. Then the expected value of the difference is $2pn-n$.

share|cite|improve this answer
Why does 2E(X)-n equal 0? – shachna 2 days ago
@shachna: The number $X$ of tails has binomial distribution $p=1/2$. So $E(X)=(1/2)n$. Equivalently, $2E(X)-n=0$. – André Nicolas 2 days ago

The key is linearity of expectation, and I suggest finding a way to write $X_n$ as a sum of simple 'indicators' corresponding to individual coin flips. So you would be thinking, "if I see a heads, then value to add is __.... and tails ......"

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.