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

Let $X$ be some random variable. Now define a new random variable $Y$ such that it has a probability $p$ of taking some fixed number $a$, and a probability $(1-p)$ of being determined by $X$.

What is the expected value of $Y$? Is it true that it is just $E[Y] = pa + (1-p)E[X]$? If this is the case, how do I prove this?

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

Write $Y=Ba+(1-B)X$ where $B$ is independent of $X$, $\mathrm P(B=1)=p$ and $\mathrm P(B=0)=1-p$ (the random variable $B$ is called a Bernoulli random variable).

Then, $Y$ has the distribution described in the post and, by linearity of the expectation and independence of $B$ and $X$, $\mathrm E(Y)=\mathrm E(B)a+\mathrm E(1-B)\mathrm E(X)=pa+(1-p)\mathrm E(X)$.

share|cite|improve this answer
@madprob Thanks for the edit. – Did Jul 5 '12 at 16:59

Your Answer


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