02. Master Test Selection Matrix: "Which Test Do I Use?"
In the semester examination, marks depend first on selecting the correct statistical test. Use this decision reference based on sample sizes, known variances, and data types:
| Scenario / Data Type | Conditions & Constraints | Selected Test | Test Statistic Formula | Degrees of Freedom ($df$) |
|---|---|---|---|---|
| One Sample Mean ($\mu$) | Population $\sigma$ known OR $n \ge 30$ | One-Sample Z-Test | $Z = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}}$ | N/A (Standard Normal) |
| One Sample Mean ($\mu$) | Population $\sigma$ unknown AND $n < 30$ (Normal pop) | One-Sample t-Test | $t = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}$ | $df = n - 1$ |
| Two Independent Means ($\mu_1 - \mu_2$) | $\sigma_1, \sigma_2$ known OR $n_1, n_2 \ge 30$ | Two-Sample Z-Test | $Z = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}$ | N/A (Standard Normal) |
| Two Independent Means ($\mu_1 - \mu_2$) | $\sigma_1 = \sigma_2$ unknown, $n_1, n_2 < 30$ | Independent Pooled t-Test | $t = \frac{\bar{x}_1 - \bar{x}_2}{s_p \sqrt{\frac{1}{n_1} + \frac{1}{n_2}}}$ | $df = n_1 + n_2 - 2$ |
| Paired Samples (Before & After) | Same subjects measured twice; differences $d_i = x_{1i} - x_{2i}$ | Paired t-Test | $t = \frac{\bar{d}}{s_d / \sqrt{n}}$ | $df = n - 1$ |
| One Proportion ($P$) | Single categorical sample, testing against hypothesized $P_0$ | One-Proportion Z-Test | $Z = \frac{p - P_0}{\sqrt{\frac{P_0(1-P_0)}{n}}}$ | N/A (Standard Normal) |
| Two Independent Proportions ($P_1 - P_2$) | Two independent categorical groups | Two-Proportion Z-Test | $Z = \frac{p_1 - p_2}{\sqrt{\bar{p}\bar{q}\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}}$ | $\bar{p} = \frac{x_1 + x_2}{n_1 + n_2}$ (pooled) |
| Comparing $\ge 3$ Independent Group Means | One categorical factor with $k \ge 3$ levels on continuous metric | One-Way ANOVA (F-Test) | $F = \frac{\text{MSB}}{\text{MSW}} = \frac{\text{SSB} / (k-1)}{\text{SSW} / (N-k)}$ | Numerator: $k-1$ Denominator: $N-k$ |
| Categorical vs Categorical (Association) | Contingency table ($r \times c$) | $\chi^2$ Test of Independence | $\chi^2 = \sum \frac{(O - E)^2}{E}$ | $df = (r-1)(c-1)$ |
| Observed vs Theoretical Frequency | Goodness of fit to uniform, Poisson, or binomial | $\chi^2$ Goodness-of-Fit | $\chi^2 = \sum \frac{(O - E)^2}{E}$ | $df = k - 1 - m$ ($m$: estimated params) |
| Comparing Two Population Variances | Testing $H_0: \sigma_1^2 = \sigma_2^2$ | F-Test for Variances | $F = \frac{S_1^2}{S_2^2} \quad (S_1^2 > S_2^2)$ | $df_1 = n_1 - 1$, $df_2 = n_2 - 1$ |
03. Priority 1: Bayes' Theorem & Total Probability
Core Concept: Bayes' Theorem performs an inversion of conditional probability. It computes the posterior probability of a hidden cause $B_i$ given that an observable event / symptom $A$ has occurred.
- Prior Probability $P(B_i)$: Initial probability of machine/source $B_i$ before observing evidence.
- Likelihood $P(A \mid B_i)$: Probability that source $B_i$ generates defective item $A$.
- Total Probability $P(A)$: Marginal probability of observing $A$ across all sources: $P(A) = \sum P(B_j) P(A \mid B_j)$.
- Posterior Probability $P(B_i \mid A)$: Updated probability that source $B_i$ was the origin of defective item $A$.
Solved Sem Exam Question 1 (May 2025, Q2 - 20 Marks): Box Bulb Defect Problem
Problem Statement: Box 1 contains 1000 bulbs of which 10% are defective. Box 2 contains 2000 bulbs of which 5% are defective. Two bulbs are drawn (without replacement) from a randomly selected box.
(i) Find the probability that both bulbs are defective.
(ii) Assuming that both are defective, find the probability that they came from Box 1.
Step 1: Event Definitions & Priors: $P(B_1) = 0.5, P(B_2) = 0.5$.
Step 2: Likelihoods (Sampling Without Replacement):
- Box 1 ($N_1 = 1000$, Def = $100$): $$\begin{aligned} P(D \mid B_1) &= \frac{\binom{100}{2}}{\binom{1000}{2}} = \frac{100 \times 99}{1000 \times 999} = \frac{11}{1110} \approx \mathbf{0.009910} \end{aligned}$$
- Box 2 ($N_2 = 2000$, Def = $100$): $$\begin{aligned} P(D \mid B_2) &= \frac{\binom{100}{2}}{\binom{2000}{2}} = \frac{100 \times 99}{2000 \times 1999} = \frac{99}{39980} \approx \mathbf{0.002476} \end{aligned}$$
Step 3: Part (i) Total Probability $P(D)$:
$$\begin{aligned} P(D) &= 0.5(0.009910) + 0.5(0.002476) = 0.004955 + 0.001238 = \mathbf{0.006193 \ (0.6193\%)} \end{aligned}$$Step 4: Part (ii) Posterior Probability $P(B_1 \mid D)$:
$$\begin{aligned} P(B_1 \mid D) &= \frac{0.004955}{0.006193} = \frac{3,998}{4,997} \approx \mathbf{0.8001 \ (80.01\%)} \end{aligned}$$04. Priority 2: Normal Distribution & Central Limit Theorem
Key Properties of Gaussian Curve:
- PDF: $f(x) = \frac{1}{\sigma \sqrt{2\pi}} e^{-\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2}, \quad -\infty < x < \infty$.
- Symmetric bell curve centered at $\mu = \text{median} = \text{mode}$. Total area $= 1.0$.
- Inflection points occur at $x = \mu \pm \sigma$. Skewness $\beta_1 = 0$; Kurtosis $\beta_2 = 3$ (mesokurtic).
- Empirical Rule: $P(\mu \pm 1\sigma) \approx 68.27\%$, $P(\mu \pm 2\sigma) \approx 95.45\%$, $P(\mu \pm 3\sigma) \approx 99.73\%$.
Central Limit Theorem (CLT)
If independent random variables $X_1, X_2, \dots, X_n$ are drawn from any population with mean $\mu$ and finite variance $\sigma^2$, then as $n \ge 30$, sample mean $\bar{X}$ approaches normality:
05. Priority 3: One-Way ANOVA & F-Test
Purpose: Tests equality of $k \ge 3$ independent group means simultaneously without inflating the Family-Wise Type I error rate ($\alpha_{\text{FW}} = 1 - (1-\alpha)^C$).
Hypotheses: $H_0: \mu_1 = \mu_2 = \dots = \mu_k$ vs $H_1: \text{At least two means differ}$.
The 6 Computational Steps:
- Correction Factor (CF): $\text{CF} = \frac{G^2}{N}$, where $G = \sum \sum x_{ij}$ (Grand Total) and $N = \sum n_j$.
- Total Sum of Squares (TSS): $\text{TSS} = \sum \sum X_{ij}^2 - \text{CF}$ ($df = N - 1$).
- Between Treatments SS (SSB): $\text{SSB} = \sum_{j=1}^k \frac{T_j^2}{n_j} - \text{CF}$ ($df = k - 1$).
- Within Groups Error SS (SSW): $\text{SSW} = \text{TSS} - \text{SSB}$ ($df = N - k$).
- Mean Squares: $\text{MSB} = \frac{\text{SSB}}{k - 1}$ and $\text{MSW} = \frac{\text{SSW}}{N - k}$.
- F-Ratio: $F_{\text{calc}} = \frac{\text{MSB}}{\text{MSW}}$ with degrees of freedom $\nu_1 = k - 1$ and $\nu_2 = N - k$.
06. Priority 4: Chi-Square ($\chi^2$) Tests
1. Test of Independence (Contingency Table $r \times c$)
- Expected frequency: $E_{ij} = \frac{(\text{Row } i \text{ Total}) \times (\text{Column } j \text{ Total})}{\text{Grand Total } N}$
- Degrees of freedom: $df = (r - 1)(c - 1)$.
2. Goodness-of-Fit Test
Degrees of freedom: $df = k - 1 - m$, where $k$ is number of classes after pooling small cells ($E_i \ge 5$), and $m$ is estimated parameters.
07. Priority 5: Tests of Means & Proportions (t-test & Z-test)
Core Test Formulas:
- One-Sample Z-Test: $Z = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}}$ (when $\sigma$ known or $n \ge 30$).
- One-Sample t-Test: $t = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}$ with $df = n - 1$.
- Two-Sample Pooled t-Test: $t = \frac{\bar{x}_1 - \bar{x}_2}{s_p \sqrt{1/n_1 + 1/n_2}}$ where $s_p^2 = \frac{(n_1-1)s_1^2 + (n_2-1)s_2^2}{n_1+n_2-2}$ ($df = n_1 + n_2 - 2$).
- Paired t-Test: $t = \frac{\bar{d}}{s_d / \sqrt{n}}$ with $df = n - 1$ where $d_i = x_{1i} - x_{2i}$.
- One-Sample Proportion Z-Test: $Z = \frac{p - P_0}{\sqrt{\frac{P_0(1-P_0)}{n}}}$.
- Two-Sample Proportion Z-Test: $Z = \frac{p_1 - p_2}{\sqrt{\bar{p}\bar{q}(1/n_1 + 1/n_2)}}$ where $\bar{p} = \frac{x_1 + x_2}{n_1 + n_2}$.
08. Descriptive Statistics, Moments, Skewness & Correlation
| Measure | Standard Formula | Interpretation & Notes |
|---|---|---|
| Sample Variance ($s^2$) | $s^2 = \frac{\sum (x_i - \bar{x})^2}{n - 1} = \frac{\sum x_i^2 - \frac{(\sum x_i)^2}{n}}{n - 1}$ | Bessel's correction ($n-1$) ensures unbiased estimator. |
| Coefficient of Variation ($CV$) | $CV = \frac{s}{\bar{x}} \times 100\%$ | Relative dispersion; lower $CV$ indicates higher consistency. |
| Quartile Deviation ($QD$) | $QD = \frac{Q_3 - Q_1}{2}, \quad \text{Coeff of } QD = \frac{Q_3 - Q_1}{Q_3 + Q_1}$ | Semi-interquartile range; robust against extreme outliers. |
| Moment Conversions |
$\mu_2 = \mu_2' - (\mu_1')^2$ $\mu_3 = \mu_3' - 3\mu_2'\mu_1' + 2(\mu_1')^3$ $\mu_4 = \mu_4' - 4\mu_3'\mu_1' + 6\mu_2'(\mu_1')^2 - 3(\mu_1')^4$ |
Converts raw moments about origin ($\mu_r'$) to central moments ($\mu_r$). |
| Skewness ($\beta_1, \gamma_1$) | $\beta_1 = \frac{\mu_3^2}{\mu_2^3}, \quad \gamma_1 = \frac{\mu_3}{\sigma^3}$ | $\gamma_1 > 0$: Right/positive skew; $\gamma_1 < 0$: Left/negative skew. |
| Kurtosis ($\beta_2, \gamma_2$) | $\beta_2 = \frac{\mu_4}{\mu_2^2}, \quad \gamma_2 = \beta_2 - 3$ | $\beta_2 = 3$: Mesokurtic; $\beta_2 > 3$: Leptokurtic; $\beta_2 < 3$: Platykurtic. |
| Pearson Correlation ($r$) | $r = \frac{\sum (x - \bar{x})(y - \bar{y})}{\sqrt{\sum (x - \bar{x})^2 \sum (y - \bar{y})^2}} = \frac{\operatorname{Cov}(X, Y)}{\sigma_X \sigma_Y}$ | Bounded: $-1 \le r \le +1$. Measures linear association. |
| Spearman Rank Correlation ($r_s$) | $r_s = 1 - \frac{6 \sum d_i^2}{n(n^2 - 1)}$ | $d_i = R_{1i} - R_{2i}$. For tied ranks, add $\frac{m(m^2-1)}{12}$ to $\sum d^2$. |
09. Hypothesis Testing Theoretical Framework
Type I vs Type II Error Decision Matrix
| Statistical Decision | $H_0$ is Actually True | $H_0$ is Actually False ($H_1$ is True) |
|---|---|---|
| Reject $H_0$ |
Type I Error ($\alpha$) (False Positive) |
Correct Decision ($1 - \beta$) (Power of the Test) |
| Fail to Reject $H_0$ |
Correct Decision ($1 - \alpha$) (Confidence Level) |
Type II Error ($\beta$) (False Negative) |
10. Discrete Distributions (Binomial & Poisson)
| Property | Binomial Distribution: $B(n, p)$ | Poisson Distribution: $P(\lambda)$ |
|---|---|---|
| PMF $P(X = k)$ | $\binom{n}{k} p^k (1-p)^{n-k}, \quad k \in \{0, 1, \dots, n\}$ | $\frac{e^{-\lambda} \lambda^k}{k!}, \quad k \in \{0, 1, 2, \dots\}$ |
| Mean ($\mathbb{E}[X]$) | $\mu = np$ | $\mu = \lambda$ |
| Variance ($\operatorname{Var}(X)$) | $\sigma^2 = np(1-p) = npq$ (always $< \text{Mean}$) | $\sigma^2 = \lambda$ (Equidispersion: $\text{Mean} = \text{Variance}$) |
| Conditions for Applicability | Fixed $n$ independent trials, binary outcomes, constant success probability $p$. | Count of rare events occurring at a constant average rate $\lambda$ in continuous space/time. |
| Poisson as Limit of Binomial | When $n \to \infty$ and $p \to 0$ such that $np = \lambda$ remains finite and constant. | |
11. Critical Values Quick Reference Card
Memorise these standard critical cutoff values for rapid exam decision making:
| Significance Level ($\alpha$) | Z Critical (Two-Tailed) | Z Critical (Right-Tailed) | Z Critical (Left-Tailed) |
|---|---|---|---|
| 10% ($\alpha = 0.10$) | $\pm 1.645$ | $+1.282$ | $-1.282$ |
| 5% ($\alpha = 0.05$) | $\pm 1.960$ | $+1.645$ | $-1.645$ |
| 1% ($\alpha = 0.01$) | $\pm 2.576$ | $+2.326$ | $-2.326$ |
Key $\chi^2$ Critical Values at $\alpha = 0.05$:
df=1: 3.841 • df=2: 5.991 • df=3: 7.815 • df=4: 9.488 • df=5: 11.070 • df=6: 12.592
Interactive Bayes Theorem Practice Calculator
Test any 3-source production defect problem. Enter production shares (Priors) and defect percentages (Likelihoods):