User:Skotoseme/sandbox

Probability distribution
$$U$$: finite set (e.g. $$U= \left \{ 0,1 \right \} ^n$$)


 * $$\left \{0,1 \right \}^2 = \left \{ 00, 01, 10, 11 \right \}$$

Def: Probability distribution $$P$$ over $$U$$ is a function


 * $$P\colon U \rightarrow [0,1]$$

such that


 * $$\sum_{x \in U}P(x) = 1$$

Examples
1. Uniform distribution:


 * $$ \forall x \in U \colon P(x) = \frac{1}{|U|} $$

2. Point distribution at $$x_0$$:


 * $$ P(x_0) = 1, \forall x \neq x_o \colon P(x) = 0 $$

Events
For a set $$A \subseteq U\colon Pr[A] = \sum_{x \in A} P(x) \in [0,1]$$ (Note: $$Pr(U) = 1$$)

The set $$A$$ is called an event

Example
$$U = \left \{ 0,1 \right \}^8$$

$$A = \left \{ x \in U | lsb_2(x)=11 \right \} \subseteq U $$ for the uniform distribution on $$U = \left \{ 0,1 \right \}^8: Pr[A] = \frac{1}{4}$$

The union bound
For events $$A_1$$ and $$A_2 \subseteq U$$:


 * $$ Pr[A_1 \cup A_2] \leq Pr[A_1] + Pr[A_2] $$


 * $$ A_1 \cap A_2 = \varnothing \Rightarrow Pr[A_1 \cup A_2] = Pr[A_1] + Pr[A_2]$$

Example

 * $$ A_1 = \Big\{ x \in \{0, 1\}^n | lsb_2(x) = 11 \Big\} ; A_2 = \Big\{ x \in \{0, 1\}^n | msb_2(x) = 11 \Big\} $$


 * $$ Pr \Big[ lsb_2(x) = 11 \lor msb_2(x) = 11 \Big] = Pr \Big[ A_1 \cup A_2 \Big] \leq \frac{1}{4} + \frac{1}{4} = \frac{1}{2} $$