Boolean operations on events (source code)

= Boolean operations on events
{c}

<Events> turn <Boolean operations> into operations on <sets>. For a die with <sample space> $U=\{1,2,3,4,5,6\}$, let $A=\{2,4,6\}$ be the <event> “even outcome” and $B=\{4,5,6\}$ the <event> “outcome at least four”. At outcome $u$, use the <indicator functions> $P=\mathbf1_A(u)$ and $Q=\mathbf1_B(u)$. Then
$$
\begin{aligned}
\text{AND: }A\cap B&=\{4,6\},&\text{OR: }A\cup B&=\{2,4,5,6\},\\
\text{XOR: }A\mathbin\triangle B&=\{2,5\},&\text{NOT }A:\ U\setminus A&=\{1,3,5\}.
\end{aligned}
$$
Thus <logical conjunction> becomes <set intersection>, <logical disjunction> becomes <set union>, <exclusive or> becomes <symmetric difference>, and <logical negation> becomes the <complement of a set> within $U$. Outcome four satisfies both <events>, so inclusive <logical disjunction> includes it and <exclusive or> excludes it. If the die is fair, these four <events> have <probabilities> $1/3$, $2/3$, $1/3$, and $1/2$, respectively. No assumption of <independent events> is needed for the <set> identities; indeed $A$ and $B$ here are not <independent>, since $1/3\ne(1/2)(1/2)$.