|
| 1 | +--- |
| 2 | +title: Discrete Random Variables |
| 3 | +date: 2025-09-16/18/23/25 |
| 4 | +--- |
| 5 | + |
| 6 | +## Expectation |
| 7 | +For a discrete random variable $X$ with p.m.f. $p_X(t)=P[X=t]$, |
| 8 | +$$ |
| 9 | +\E[X] = \sum_{t} t p_X(t), \quad \E[f(X)] = \sum_t f(t) p_X(t), |
| 10 | +$$ |
| 11 | + |
| 12 | +**Interpretations** |
| 13 | +- Weighted average over the values of $X$: $\sum_t t P[X=t]$. |
| 14 | +- Weighted average over outcomes $\omega$ in the sample space $S$: $\sum_{\omega\in S} X(\omega) P(\{\omega\})$. |
| 15 | + |
| 16 | +> Examples: |
| 17 | +> - Fair die $X\in\{1,\dots,6\}$: $\E[X]=3.5$. |
| 18 | +> - Heads in three fair flips $Y\in\{0,1,2,3\}$: $\E[Y]=1.5$. |
| 19 | +> - Indicator $\mathbf{1}_A$: $\E[\mathbf{1}_A]=P(A)$. |
| 20 | +
|
| 21 | +## Linearity of expectation |
| 22 | +For random variables $X,Y$ and scalar $a\in\mathbb{R}$, |
| 23 | +$$ |
| 24 | +\E[aX+Y] = a \E[X] + \E[Y]. |
| 25 | +$$ |
| 26 | +No independence required. |
| 27 | + |
| 28 | +**Counting-by-indicators trick** |
| 29 | +If $X=\sum_{i=1}^n \mathbf{1}_{A_i}$ counts how many events $A_i$ occur, then |
| 30 | +$$ |
| 31 | +\E[X] = \sum_{i=1}^n P(A_i). |
| 32 | +$$ |
| 33 | +> Example: number of fixed points in a random permutation - $\E[X]=1$. |
| 34 | +
|
| 35 | +## Variance |
| 36 | +Variance measures spread around the mean: |
| 37 | +$$ |
| 38 | +\operatorname{Var}(X) = \E[(X-\E X)^2] = \E[X^2] - (\E X)^2. |
| 39 | +$$ |
| 40 | +Useful identities: |
| 41 | +- For constants $a,b$: $\operatorname{Var}(aX+b)=a^2 \operatorname{Var}(X)$. |
| 42 | +- For an indicator: $\operatorname{Var}(\mathbf{1}_A)=P(A)\big(1-P(A)\big)$. |
| 43 | +- If $X=\sum_{i=1}^n \mathbf{1}_{A_i}$ with independent indicators, then |
| 44 | + $$ |
| 45 | + \operatorname{Var}(X)=\sum_{i=1}^n P(A_i)\big(1-P(A_i)\big). |
| 46 | + $$ |
| 47 | + |
| 48 | +## Inclusion–Exclusion via indicators |
| 49 | +Using $\mathbf{1}_{A^c} = 1 - \mathbf{1}_A$ and expanding |
| 50 | +$\mathbf{1}_{\cup_i E_i} = 1 - \prod_{i=1}^n (1-\mathbf{1}_{E_i})$, then taking expectations yields |
| 51 | +$$ |
| 52 | +P\Big( \bigcup_{i=1}^n\ E_i \Big) |
| 53 | += \sum_{k=1}^n (-1)^{k-1} |
| 54 | +\sum_{1 \leq i_1 < \cdots < i_k \leq n} |
| 55 | +P(\E_{i_1} \cap \cdots \cap \E_{i_k}). |
| 56 | +$$ |
| 57 | + |
| 58 | +### Bernoulli |
| 59 | + |
| 60 | +If $X\in\{0,1\}$ takes value $1$ with probability $p$, we write $X\sim\operatorname{Ber}(p)$. Its pmf is $p_X(1)=p$, $p_X(0)=1-p$; the expectation is $p$, and the variance is $p(1-p)$. |
| 61 | + |
| 62 | +### Binomial |
| 63 | + |
| 64 | +Let $X$ be the total number of successes in $n$ independent Bernoulli$(p)$ trials. Then $X\sim \operatorname{Bin}(n,p)$ and can be written $X=X_1+\cdots+X_n$ with $X_i\sim\operatorname{Ber}(p)$. The pmf is |
| 65 | +$$ |
| 66 | +P(X=k) = {n\choose k} p^k (1-p)^{ n-k}. |
| 67 | +$$ |
| 68 | + |
| 69 | +Using linearity of expectation, $\E[X]=\sum_{i=1}^n \E[X_i]=np$, and the variance is $\operatorname{Var}(X)=np(1-p)$. |
| 70 | +> Examples: the number of heads in 3 fair flips follows $\operatorname{Bin}(3,\tfrac12)$; when rolling 10 dice, the number of sixes follows $\operatorname{Bin}(10,\tfrac16)$. |
| 71 | +
|
| 72 | +### Poisson |
| 73 | + |
| 74 | +A **Poisson** random variable $X\sim \operatorname{Poi}(\lambda)$ has pmf |
| 75 | +$$ |
| 76 | +P(X=k) = \frac{\lambda^k e^{-\lambda}}{k!}, \quad k=0,1,2,\dots. |
| 77 | +$$ |
| 78 | + |
| 79 | +From the series expansion of $e^\lambda$, these probabilities sum to one. The expectation and variance are both $\lambda$. A Poisson variable arises as an approximation to $\operatorname{Bin}(n,p)$ when $n$ is large and $p$ is small with $np=\lambda$. |
| 80 | + |
| 81 | +> For example, the number of 5‑star characters obtained in 500 draws with a 0.6% rate is approximately $\operatorname{Poi}(3)$. |
| 82 | +
|
| 83 | +### Geometric |
| 84 | + |
| 85 | +If you repeatedly flip a $p$‑biased coin until the first head appears, the total number of flips $X$ (including the successful flip) follows a **geometric** distribution with parameter $p$, denoted $X\sim \operatorname{Geom}(p)$. The pmf is |
| 86 | +$$ |
| 87 | +P(X=k) = (1-p)^{k-1} p,\quad k=1,2,\dots, |
| 88 | +$$ |
| 89 | + |
| 90 | +since the first $k-1$ flips must be tails and the $k$‑th flip a head. Summation identities yield |
| 91 | +$$ |
| 92 | +\E[X] = \frac{1}{p},\qquad \operatorname{Var}(X) = \frac{1-p}{p^2}. |
| 93 | +$$ |
0 commit comments