# Mathematical Details of the Law of Large Numbers
## Setup
Let $X_1, X_2, X_3, \ldots$ be a sequence of independent and identically distributed random variables.
Let $\mu = E[X]$ be the expected value of each $X$.
Let $\sigma^2 = \text{Var}(X)$ be the variance of each $X$.
Define the sample mean:
$$\bar{X}_n = \frac{1}{n} \sum_{i=1}^n X_i$$
## Weak Law of Large Numbers (WLLN)
For any $\varepsilon > 0$:
$$\lim_{n\to\infty} P(|\bar{X}_n - \mu| < \varepsilon) = 1$$
This means $\bar{X}_n$ converges in probability to $\mu$, written as:
$$\bar{X}_n \xrightarrow{p} \mu$$
## Strong Law of Large Numbers (SLLN)
$$P(\lim_{n\to\infty} \bar{X}_n = \mu) = 1$$
This means $\bar{X}_n$ converges almost surely to $\mu$, written as:
$$\bar{X}_n \xrightarrow{a.s.} \mu$$
## Implications
1. The sample mean is a consistent estimator of the population mean.
2. As sample size increases, the probability of large deviations from the true mean decreases.
3. In the limit, the sample mean will converge to the true population mean.
4. This applies to any distribution with a finite mean, not just normal distributions.
## Note on Convergence
- WLLN: Convergence in probability
- SLLN: Almost sure convergence (stronger than convergence in probability)
The LLN doesn't specify the rate of convergence. This is addressed by other theorems, such as the Central Limit Theorem.
___
# Central Limit Theorem (CLT)
## Setup
Let $X_1, X_2, X_3, \ldots, X_n$ be a sequence of independent and identically distributed random variables.
Let $\mu = E[X]$ be the expected value of each $X$.
Let $\sigma^2 = \text{Var}(X)$ be the variance of each $X$.
Define the sample mean:
$$\bar{X}_n = \frac{1}{n} \sum_{i=1}^n X_i$$
## Statement of the Central Limit Theorem
As $n$ approaches infinity, the distribution of the standardized sample mean:
$$\frac{\bar{X}_n - \mu}{\sigma/\sqrt{n}}$$
converges in distribution to a standard normal random variable $Z \sim N(0,1)$.
In other words:
$$\sqrt{n}(\bar{X}_n - \mu)/\sigma \xrightarrow{d} N(0,1) \text{ as } n \to \infty$$
## Implications
1. For large $n$, $\bar{X}_n$ is approximately normally distributed with:
$E[\bar{X}_n] = \mu$
$\text{Var}(\bar{X}_n) = \sigma^2/n$
2. The distribution of $\bar{X}_n$ can be approximated by:
$$\bar{X}_n \sim N(\mu, \sigma^2/n)$$
3. The standard error of the mean is given by:
$$SE(\bar{X}_n) = \sigma/\sqrt{n}$$
## Key Points
- Applies regardless of the shape of the original distribution (as long as $\mu$ and $\sigma^2$ are finite).
- "Sufficiently large" $n$ depends on the original distribution, but $n \geq 30$ is often used as a rule of thumb.
- Enables the use of z-scores and t-scores in hypothesis testing and confidence intervals.
## Comparison with Law of Large Numbers (LLN)
- LLN: $\bar{X}_n \xrightarrow{p} \mu$ (WLLN) or $\bar{X}_n \xrightarrow{a.s.} \mu$ (SLLN)
- CLT: $\sqrt{n}(\bar{X}_n - \mu)/\sigma \xrightarrow{d} N(0,1)$
CLT provides information about the distribution and spread of $\bar{X}_n$, while LLN only addresses its convergence to $\mu$.
## Applications
1. Hypothesis testing
2. Construction of confidence intervals
3. Approximation of binomial distribution by normal distribution
4. Quality control in manufacturing
5. Sampling theory in surveys and polls
The CLT is a cornerstone of statistical inference, allowing us to make probabilistic statements about sample means even when we don't know the underlying population distribution.