# How to prove $P(A\cup B) = P(A) + P(B) - P(A\cap B)$

Let $$X$$ and $$Y$$ any random variables. $$A$$ and $$B$$ are two events $$\in \Omega$$ (the sample space):

How can I prove $$P(A \cup B) = P(A) + P(B) - P(A \cap B)$$ using the equation: $$E[\max(X,Y)] = E[X] + E[Y] - E[\min(X,Y)],\; A, B \in \Omega$$ (my sample space)

I believe to prove this $$E[\max(X,Y)] = E[X] + E[Y] - E[\min(X,Y)]$$ I will have to test for $$X>Y$$, $$X and $$X=Y$$ right?

And to use this equation to prove $$P(A \cup B) = P(A) + P(B) - P(A \cap B)$$ I will have to use the idea of $$A \subset B, \; B \subset A$$ and $$A = B,$$ right?

• you should porably explain your notations. – J.F Jan 18 at 20:33
• @G.F Iedited the question. Thanks. – Laura Jan 18 at 20:36
• I think you mean to write $$P(A\cup B) = P(A) + P(B) - P(A\cap B)$$ but you have it miswritten in your problem – WaveX Jan 18 at 20:37
• It helps to note that $A\cup B$ can be written as a disjoint union as $A\cup B = (A\setminus B)\cup (A\cap B)\cup (B\setminus A)$ and similarly that $A = (A\setminus B)\cup (A\cap B)$, etc... – JMoravitz Jan 18 at 20:37
• @JMoravitz but how can I use the idea from $E[max(X,Y)]=E[X]+E[Y]−E[min(X,Y)]$ proof? – Laura Jan 18 at 20:41

If $$X$$ is the indicator variable of $$A$$ and $$Y$$ is the indicator variable of $$B$$, then $$E(X)=P(A)$$ and $$E(Y)=P(B)$$. Furthermore, $$\max\{X,Y\}$$ is the indicator variable of $$A\cup B$$, and $$\min\{A,B\}$$ of $$A\cap B$$; thus, $$E(\max\{X,Y\})=P(A\cup B)$$ and $$E(\min\{X,Y\})=P(A\cap B)$$. Therefore, with this choice of $$X$$ and $$Y$$, the relation $$E(\max\{X,Y\})=E(X)+E(Y)-E(\min\{X,Y\})$$ can be rewritten as $$P(A\cup B)=P(A)+P(B)-P(A\cap B)$$.
• @Laura an Indicator Variable is a binary variable: it only takes the value $0$ or $1$. For example, $X$ can be thought to be an indicator for whether or not event $A$ had happened; if it did, then $X$ will take the value $1$, and if event $A$ does not happen, it is $0$ – WaveX Jan 19 at 3:41
If you need to prove that $$E[\max(X,Y)] = E[X] + E[Y] - E[\min(X,Y)],$$ simply note that the relation is valid even before you take expectations: $$\max(X,Y) = X + Y - \min(X,Y),$$ which is the same as $$\ X + Y = \min(X,Y) + \max(X,Y),$$ which is true since you can find the sum of two numbers by adding the smaller number (the min) to the larger number (the max).