# Discrete Probability: Expected value of random variable

Question: You flip a fair red coin once, and you flip a fair blue coin once, independently of each other.

Defi ne the random variables:

X = {1 if the red coin flip resulted in heads, 0 if the red coin flip resulted in tails}

Y = {1 if the blue coin flip resulted in heads, 0 if the blue coin flip resulted in tails}

and Z = min(X,Y)

What is the expected value E(Z) of the random variable Z?

Answer: 0.25

Attempt:

For random variable x=1 correlates to pr(x) = 0.5 and x = 0 correlates to pr(x) = 0.5. Same with the y's.

Z=min(X,Y) = would just be either since their the same?

So, using the expected value formula I get that (0.5*1) + (0.5*0) = 0.5

## 2 Answers

$$Z$$ is an indicator variable and it takes value $$1$$ when both get heads.

Hence $$E[Z]=P(Z=1) = 0.5^2=0.25$$

Remark:

The assumption that $$Z$$ would follows the same distribution as $$X$$ or $$Y$$ is false.

• but why do you assume it takes 1 in your calculation? I don't follow the calculation – Toby Nov 27 '18 at 2:22
• the expectation of an indicator variable is equal to the probability that it takes value $1$. That is $E[Z]=0\cdot P(Z=0)+1 \cdot P(Z=1)=P(Z=1)$. – Siong Thye Goh Nov 27 '18 at 2:23
• the expectation of an indicator variable is equal to the probability that it takes value 1." is this always true? – Toby Nov 27 '18 at 2:30
• Proof is given in the previous comment right? – Siong Thye Goh Nov 27 '18 at 2:34
• Just wondering, for any 3 random variables say X,Y,Z would E(min(X,Y,Z)) = min(E(X),(Y),(Z))? Would this be true? – Toby Nov 27 '18 at 15:40

It is a fallacy to assume that $$X$$ and $$Y$$ are the “same” because their probability distributions have the same weights.

If the coins are independent, then by the definition of independence, $$P(X=1 \text{ and } Y=1) = P(X=1) P(Y=1).$$ There are three other possible outcomes, including

• $$X=1$$ and $$Y=0$$;
• $$X=0$$ and $$Y=1$$;
• $$X=0$$ and $$Y=0.$$

The probability of each of those events can be worked out similarly to $$P(X=1 \text{ and } Y=1).$$

In all of those cases the final probability comes out to $$0.25.$$ But the case “$$X=1$$ and $$Y=1$$” is the only case in which $$\min(X,Y)=1.$$ In every other case the result is $$0.$$ So altogether you have a $$0.75$$ chance of $$0,$$ not $$0.5.$$

• Generally, for the indicator variable, does it always take in the value of 1? Are we always looking for the indicator variable to be 1? I'm confused about the indicator variable concept – Toby Nov 27 '18 at 2:46
• "Indicator variable" is simply a convenient way for someone to say that a variable takes the value $1$ when a certain event occurs, and takes the value $0$ otherwise. That's all it is. All the variables $X,$ $Y,$ and $Z$ are indicator variables in this question, but it is the knowledge that you can only have outcomes $0$ or $1$ (due to the way the variables are defined) that makes them indicator variables, not the other way around. – David K Nov 27 '18 at 2:54
• So, if the question states that the random variables are 1 if "this scenario" happens, do we always just compute the indicator variables expected value based on its value being the scenario where it's 1? – Toby Nov 27 '18 at 3:04
• The expected value can be computed as in Siong Thye Goh's comment. It is based on the same formula you used yourself, but your mistake in your calculation was you assigned probability $0.5$ to the event $Z=1.$ That is incorrect. The event $Z=1$ has only probability $0.25.$ – David K Nov 27 '18 at 3:18