# Can a function that selects between two random variables increase the variance more than twofold?

Let $$X_1,X_2$$ be two real-valued zero-mean random variables, and assume w.l.o.g. that $$\text{Var}[X_1]\ge\text{Var}[X_2]$$.

Let $$f:\mathbb R^2\to\{1,2\}$$ be a selection'' function, and define $$Y=X_{f(X_1,X_2)}$$ to be the selected (real-valued) random variable.

Is it possible to upper bound $$\text{Var}[Y]$$ as a function of $$\text{Var}[X_1]$$? For example,

Is it correct that $$\text{Var}[Y]\le 2\text{Var}[X_1]$$?

• No. Counter-examples are easy if $X_1$ and $X_2$ have different means Commented Mar 25, 2020 at 18:59
• @Henry - you're right, forgot to mention that both have zero-mean, thanks! Commented Mar 25, 2020 at 19:00
• I found a discrete example where $\operatorname{Var}X_1<\operatorname{Var}Y<2\operatorname{Var}X_1$. Where does the factor of 2 come from in your conjecture?
– Karl
Commented Mar 25, 2020 at 19:28
• @Karl - I had a similar example. I think that (maybe) for $k$ variables there should be a $k$ factor there, but am having hard times proving it even for $k=2$. Commented Mar 25, 2020 at 19:37

Let $$A_1, A_2$$ be the disjoint events $$\{f=1\}, \{f=2\}$$. Then we can write $$Y = 1_{A_1} X_1 + 1_{A_2} X_2.$$ Note that $$Y^2 = 1_{A_1} X_1^2 + 1_{A_2} X_2^2$$ Now \begin{align*} \operatorname{Var}(Y) &\le E[Y^2] \\ &= E[1_{A_1} X_1^2] + E[1_{A_2} X_2^2] \\ &\le E[X_1^2] + E[X_2^2] \\ &= \operatorname{Var}(X_1) + \operatorname{Var}(X_2) && \text{(since E[X_1]=E[X_2]=0)}\\ &\le 2 \operatorname{Var}(X_1). \end{align*}

This is true (your conjecture about constant $$k$$ for $$k$$ variables is also true), and is a consequence of law of total variance. More specifically, this is the law of total variance

$$Var(Y) = \mathbb{E}[Var(Y | F)] +Var(\mathbb{E}[Y \mid F])$$

where I am denoting $$f(X_1, X_2)$$ as $$F$$.

Further simplification gives

$$Var(Y) \leq \sum_i Var(X_i \mid f = i) P(f = i) + \mathbb{E}[X_i \mid f = i]^2 P(f = i)$$

which means

$$Var(Y) \leq \sum_i \mathbb{E}[ X_i^2 \mid f = i] P(f = i)$$

Now, law of total probability here, coupled with the fact that $$X_i^2 \geq 0$$ and $$X_i$$ have 0 mean, gives you what you want.

$$\sum_i \mathbb{E}[ X_i^2 \mid f = i] P(f = i) \leq \sum_i \mathbb{E}[ X_i^2 \mid f = i] P(f = i) +$$ $$\sum_{j \neq i} \mathbb{E}[ X_i^2 \mid f = j] P(f = j) = \sum_i \mathbb{E} X_i^2 = \sum_i Var(X_i)$$
• Thanks so much for the answer! Can you please explain the last transition? i.e., why $\sum_i \mathbb{E}[ X_i^2 \mid f = i] P(f = i) \le 2 Var(X_1)$? Commented Mar 25, 2020 at 22:12