Expectation, variance and indicator variables If we have three events $A_i$ with $i=1,2,3$ with probability $\frac{1}{5}, \frac{1}{4}, \frac{1}{3}$ respectively. Let $X$ be the number of these events that occur. 
Trying to write down a formula for $X$ in terms of indicators in order to find the expectation of $X$. Afterwards trying to find $\operatorname{Var}(X)$ if each event is disjoint (case 1), each event is independent (case 2), and $A_{1} \subseteq A_{2} \subseteq A_{3} $(case 3).
Any suggestions of how to tackle this problem? 
 A: If $I(A)$ denotes the indicator of event $A$, then you've got $X = I(A_1) + I(A_2) + I(A_3)$, because you count 1 every time the corresponding event occurs. Apply the linearity of expectation to get $$E(X) = E(I(A_1)) + E(I(A_2)) + E(I(A_3)) = P(A_1) + P(A_2) + P(A_3).$$
For the variance, use the formula ${\rm Var}(X) = E(X^2) - [E(X)]^2$. You've already got the second term of this formula; for the first, expand out $X^2$ as a sum of products of indicators, then simplify using the fact that  $I(A)I(B) = I(AB)$ and $I(A)I(A) = I(A)$ (for arbitrary events $A$ and $B$, writing $AB$ for their intersection), then apply linearity of expectation.
The three cases you've cited will tell you how to simplify further: In case 1, $P(AB) = 0$ when $A$ and $B$ are disjoint; in case 2, $P(AB) = P(A) P(B)$ when $A$ and $B$ are independent; and in case 3, $P(AB) = P(A)$ if $A$ is contained in $B$.
A: $$X=1_{A_1}+1_{A_2}+1_{A_3}$$
For expectiation you can use the linearity of the expectation function.
For variance in case of independent events you can use that $$\operatorname{Var}(U+V)=\operatorname{Var}U+\operatorname{Var}V$$ if $U$ and $V$ are independent.
For variance in case of disjoint events you can use that $$\operatorname{Var}(X)=\mathbb EX^2-(\mathbb EX)^2$$
The last approach will also help you out in case $3$.

edit:
For an event $A$ we have: $$\mathbb{E}1_{A}=P\left(A\right)1+P\left(A^{c}\right)0=P\left(A\right)$$
Apply this to find the expectation of $X$ on base of:
$$\mathbb{E}X=\mathbb{E}\left(1_{A_{1}}+1_{A_{2}}+1_{A_{3}}\right)=\mathbb{E}1_{A_{1}}+\mathbb{E}1_{A_{2}}+\mathbb{E}1_{A_{3}}$$
For events $A$ and $B$ we have: $${\rm Covar}\left(1_{A},1_{B}\right)=\mathbb{E}1_{A}1_{B}-\mathbb{E}1_{A}\mathbb{E}1_{B}=\mathbb{E}1_{A\cap B}-\mathbb{E}1_{A}\mathbb{E}1_{B}=P\left(A\cap B\right)-P\left(A\right)P\left(B\right)$$
Special cases:


*

*If $A=B$ then $P\left(A\cap B\right)=P\left(A\right)=P\left(B\right)$ so
that: $${\rm Var}1_{A}={\rm Covar}\left(1_{A},1_{A}\right)=P\left(A\right)-P\left(A\right)^{2}=P\left(A\right)\left(1-P\left(A\right)\right)$$

*If $A$ and $B$ are independent then $P\left(A\cap B\right)=P\left(A\right)P\left(B\right)$
so that: $${\rm Covar}\left(1_{A},1_{B}\right)=0$$

*If $A$ and $B$ are disjoint then $P\left(A\cap B\right)=P\left(\varnothing\right)=0$
so that: $${\rm Covar}\left(1_{A},1_{B}\right)=-P\left(A\right)P\left(B\right)$$

*If $A\subseteq B$ then $P\left(A\cap B\right)=P\left(A\right)$ so
that: $${\rm Covar}\left(1_{A},1_{B}\right)=P\left(A\right)-P\left(A\right)P\left(B\right)=P\left(A\right)\left(1-P\left(B\right)\right)$$
In the cases you describe find the variance of $X$ on base of:
$${\rm Var}X={\rm Var}\left(1_{A_{1}}+1_{A_{2}}+1_{A_{3}}\right)=$$$${\rm Var}1_{A_{1}}+{\rm Var}1_{A_{2}}+{\rm Var}1_{A_{3}}+2{\rm Covar}\left(A_{1},A_{2}\right)+2{\rm Covar}\left(A_{1},A_{3}\right)+2{\rm Covar}\left(A_{2},A_{3}\right)$$
