16.3 Two-Way Frequency Tables, Law of Large Numbers & Expected Value of Random Variables
Key Takeaways
- Two-way contingency tables partition bivariate categorical data into joint cell frequencies and marginal total frequencies, enabling calculation of conditional row and column relative frequencies.
- Categorical variables are statistically independent in a two-way table if and only if each joint cell relative frequency equals the product of its corresponding marginal relative frequencies (or equivalently, observed cell count $n_{ij} = \frac{\text{Row Total}_i \times \text{Col Total}_j}{N}$).
- The Law of Large Numbers establishes that sample relative frequencies converge to theoretical probabilities as the number of independent trials approaches infinity, resolving the Gambler's Fallacy by demonstrating dilution of past discrepancies rather than active compensation.
- The expected value (mean) of a discrete random variable $X$ is the probability-weighted center of mass $E(X) = \mu = \sum x \cdot P(X = x)$, representing the long-run average outcome per trial.
- A game is mathematically fair if its net expected payout is zero ($E(\text{Net Payout}) = 0$), a foundational principle utilized by insurance actuaries to calculate risk premiums, profit margins, and variance $\sigma^2 = \sum (x - \mu)^2 P(X = x)$.
16.3 Two-Way Frequency Tables, Law of Large Numbers & Expected Value of Random Variables
Two-Way Contingency Tables: Joint, Marginal, and Conditional Distributions
A two-way frequency table (contingency table) organizes bivariate categorical data to examine associations between two qualitative variables measured across a common sample of $N$ observations. One variable defines the $r$ rows, while the other variable defines the $c$ columns.
Structural Anatomy of Contingency Tables
- Joint Frequencies: The internal cells of the table, denoted $n_{ij}$, represent the count of individuals possessing both the $i$-th row characteristic and the $j$-th column characteristic simultaneously ($A_i \cap B_j$). The joint relative frequency is the proportion of the entire sample in that specific cell:
- Marginal Frequencies: Located in the rightmost column and bottom row margins, these represent the univariate totals obtained by summing across entire rows or columns:
- Row Marginal Total: $R_i = \sum_{j=1}^c n_{ij}$
- Column Marginal Total: $C_j = \sum_{i=1}^r n_{ij}$
- The marginal relative frequency expresses each margin relative to the grand sample size: $\frac{R_i}{N}$ or $\frac{C_j}{N}$.
- Conditional Distributions: A conditional distribution evaluates the relative frequencies of one variable while holding the other variable constant at a specific category. Restricting the analysis to a single row or column replaces the grand total $N$ with the corresponding marginal total:
- Row Relative Frequency (conditioning on Row $i$):
- Column Relative Frequency (conditioning on Column $j$):
Identifying the correct denominator in examination word problems is critical: phrases such as 'given that', 'among those who', or 'of the individuals in group $X$' designate the conditioning subset that forms the denominator.
Testing Categorical Variables for Statistical Independence
In a two-way contingency table, two categorical variables $A$ and $B$ are statistically independent if the conditional distribution of one variable is identical across all categories of the other variable. That is, knowing an individual's row category provides zero predictive power regarding their column category:
Substituting the sample counts into this equality yields the algebraic criterion for independence: This establishes the benchmark expected cell frequency under independence: If the observed cell frequencies $n_{ij}$ match their theoretical expected values $E_{ij}$ across every cell in the table (within reasonable random sampling fluctuations), the two categorical variables are independent. If conditional percentages differ systematically across rows or columns, an association (dependence) exists between the variables.
Empirical vs. Theoretical Probability & The Law of Large Numbers
Probability theory operates across two distinct epistemological domains:
- Theoretical (Classical) Probability: Deductively derived from mathematical principles and assumptions of physical symmetry within an idealized sample space where all basic outcomes are equally likely:
- Empirical (Experimental) Probability: Inductively calculated as the relative frequency of an event observed over $n$ actual experimental trials:
The Law of Large Numbers (LLN)
The bridge connecting empirical observations to theoretical truth is the Law of Large Numbers. Formulated mathematically, if an experiment is repeated $n$ times under identical, independent conditions, the empirical relative frequency $\hat{P}_n(E)$ converges to the true theoretical probability $P(E)$ as $n$ approaches infinity:
Debunking the Gambler's Fallacy
A major pedagogical competency on the FTCE examination is understanding what the Law of Large Numbers does not imply. The Gambler's Fallacy is the false belief that chance processes possess a self-correcting memory—that after a long streak of independent losses or tails on a fair coin, a win or head is 'due' to restore balance.
Independent trials have no memory. If a fair coin lands on Heads 10 consecutive times, the probability of Tails on the 11th toss remains strictly $0.50$. The Law of Large Numbers does not work by compensation (forcing future streaks of Tails to balance past Heads); rather, it works through dilution:
- Suppose after $10$ flips, there are $10$ Heads and $0$ Tails (a discrepancy of $+5$ Heads above the expected $5$).
- If the coin is flipped an additional $1,000,000$ times, the expected number of Heads on the new flips is $500,000$.
- The total Heads count becomes $500,010$ out of $1,000,010$ total flips.
- The relative frequency is $\frac{500,010}{1,000,010} \approx 0.50000499$, which is practically indistinguishable from $0.50$. The initial surplus of 5 Heads was never erased or counterbalanced; its mathematical impact was simply diluted into insignificance by the massive denominator.
Discrete Random Variables & Expected Value
A random variable $X$ is a function that assigns a numerical value to each outcome in a sample space. A random variable is discrete if its set of possible values is finite or countably infinite (such as integers: $0, 1, 2, \dots$).
The probability distribution (probability mass function) of a discrete random variable lists each possible numerical value $x_i$ alongside its corresponding probability $P(X = x_i)$, satisfying two foundational conditions:
- $0 \le P(X = x_i) \le 1$ for all values $x_i$
- $\sum_{\text{all } i} P(X = x_i) = 1$
Expected Value (Mean of a Random Variable)
The expected value, denoted $E(X)$ or $\mu_X$, represents the theoretical long-run average value of $X$ across infinitely many repetitions of the experiment. It is the probability-weighted arithmetic mean of all possible outcomes: Physically, the expected value corresponds to the center of mass (balance point) of the probability distribution.
Variance and Standard Deviation of a Discrete Random Variable
While expected value locates the center, variance measures the dispersion or spread of the random variable around its mean: Expanding the squared deviation term yields the computationally efficient shortcut formula for variance: The standard deviation is the positive square root of variance, restoring the original units of measurement:
Linear Transformations of Random Variables
For constants $a$ and $b$, the linear transformation $Y = aX + b$ alters the distribution parameters according to rigorous algebraic rules: Adding a constant $b$ shifts the center but leaves spread unchanged, while multiplying by $a$ scales both center and standard deviation by $|a|$ and scales variance by $a^2$.
Applications: Fair Games, Lotteries & Actuarial Risk Analysis
Expected value provides the primary quantitative tool for economic, gaming, and actuarial decision-making under uncertainty.
Concept of a Fair Game
In financial mathematics, a game or contract is defined as mathematically fair if the net expected profit is exactly zero: If $E(\text{Net Gain}) < 0$, the game is disadvantageous to the player (the structural condition of all commercial casinos and lotteries, where the 'house edge' guarantees long-run profitability for the house). If $E(\text{Net Gain}) > 0$, the game has positive expected value for the player.
Actuarial Risk Analysis and Insurance Pricing
Insurance companies operate by pricing insurance policies such that the expected value of premium revenue exceeds expected claim payouts plus administrative operating costs: While an individual policy represents substantial volatility (a policyholder either suffers no loss or incurs a catastrophic claim), pooling millions of independent policies enables the Law of Large Numbers to drive the company's average claim cost per policy toward its theoretical expected value, minimizing portfolio risk.
Two-Way Contingency Table & Relative Frequency Guide
To illustrate the construction of joint, marginal, and conditional relative frequencies, consider an empirical survey of 400 high school students evaluating participation in athletics and academic honor societies:
| Participation Status | Member of Honor Society ($H$) | Not in Honor Society ($H'$) | Marginal Total |
|---|---|---|---|
| Student Athlete ($A$) | 60 ($n_{11}$) | 140 ($n_{12}$) | 200 ($R_1$) |
| Non-Athlete ($A'$) | 40 ($n_{21}$) | 160 ($n_{22}$) | 200 ($R_2$) |
| Marginal Total | 100 ($C_1$) | 300 ($C_2$) | 400 ($N$) |
Distributional Metrics Derived from Table
- Joint Relative Frequency: $P(A \cap H) = \frac{60}{400} = 0.15$ ($15%$ of all surveyed students are athletes in the honor society).
- Marginal Relative Frequency: $P(H) = \frac{100}{400} = 0.25$ ($25%$ of all surveyed students belong to the honor society).
- Conditional Distribution (Row Relative Frequency): $P(H|A) = \frac{60}{200} = 0.30$ ($30%$ of athletes belong to the honor society).
- Conditional Distribution (Comparison Group): $P(H|A') = \frac{40}{200} = 0.20$ ($20%$ of non-athletes belong to the honor society).
- Independence Evaluation: Because $P(H|A) = 0.30 \ne P(H|A') = 0.20$ (and $P(A \cap H) = 0.15 \ne P(A)P(H) = 0.50 \times 0.25 = 0.125$), athletic participation and honor society membership are dependent; athletes exhibit a higher propensity for honor society membership.
Worked Exemplar: Expected Value and Risk Analysis for an Insurance Policy
Problem: An insurance company offers a 1-year term life insurance policy with a death benefit payout of $$200,000$ to a specific demographic cohort. Actuarial mortality tables indicate that the probability of a policyholder in this cohort dying within the next year is $p = 0.003$ ($0.3%$, meaning survival probability is $0.997$). The company charges an annual premium of $$850$.
-
Define the Discrete Random Variable: Let $X$ represent the insurer's net financial gain per policy in dollars.
- Scenario 1 (Policyholder survives): The insurer collects the $$850$ premium and pays $$0$ in claims. Net gain: $x_1 = +$850$, with probability $P(X = 850) = 0.997$.
- Scenario 2 (Policyholder dies): The insurer collects the $$850$ premium but must pay the $$200,000$ claim. Net gain: $x_2 = 850 - 200,000 = -$199,150$, with probability $P(X = -199,150) = 0.003$.
-
Calculate the Expected Net Gain $E(X)$: Alternative Conceptual Method: The expected claim payout is $200,000 \times 0.003 = $600.00$. The expected profit is the premium minus the expected claim: $$850 - $600 = +$250.00$.
-
Compute the Variance $\sigma^2$ and Standard Deviation $\sigma$: Using the definition $\sigma^2 = \sum (x_i - \mu)^2 P(X = x_i)$ where $\mu = 250$:
- Deviation for survival: $850 - 250 = 600 \implies (600)^2 = 360,000$
- Deviation for death: $-199,150 - 250 = -199,400 \implies (-199,400)^2 = 39,760,360,000$
Actuarial Interpretation
While the company earns a handsome expected profit of $$250$ per contract, the massive standard deviation ($,\approx$10,938$) demonstrates severe risk for any single contract. By selling $100,000$ independent policies, the Law of Large Numbers and the Central Limit Theorem compress the standard error of the mean profit to $\frac{10,938}{\sqrt{100,000}} \approx $34.59$, guaranteeing virtually certain profitability across the aggregate portfolio.
A high school administrator surveys 200 enrolled students regarding their participation in varsity athletics and student interest clubs. The survey data yields the following contingency table:
A fair standard six-sided die is rolled 100 times in an experimental demonstration. The face showing 6 appears only 8 times, which is substantially below the theoretical expectation of approximately 16.67 times. A student reasons: 'Because of the Law of Large Numbers, the number 6 is more likely to appear than any other number over the next 100 rolls to compensate for the deficit and bring the relative frequency back up to 1/6.' How should a mathematics educator evaluate this claim?
A high school mathematics department hosts a carnival game. A player rolls a fair twenty-sided die (numbered 1 through 20). If the die lands on 20, the player wins $50. If it lands on 18 or 19, the player wins $10. If it lands on an odd number from 1 through 17 (9 possible outcomes), the player wins $2. For all other rolls (even numbers 2 through 16; 8 possible outcomes), the player wins nothing ($0). What ticket price should the department charge to make this game mathematically fair?
A discrete random variable X has the following probability distribution: