Distributions and hypothesis tests: binomial, normal, chi-squared and t

IB Math AI · Statistics and Probability

Binomial

$X\sim B(n,p)$ requires four conditions: a fixed number of trials, two outcomes, constant $p$, and independence. Then $E(X)=np$ and $\text{Var}(X)=np(1-p)$. On the GDC, binompdf gives $P(X=k)$ and binomcdf gives $P(X\le k)$; the distinction between $P(X\ge 5)=1-P(X\le 4)$ and $1-P(X\le 5)$ is a one-character error that changes the answer.

Normal

$X\sim N(\mu,\sigma^{2})$. Note the notation: the second entry is the variance, so $N(340,25^{2})$ has $\sigma=25$. Inverse normal answers "what value has this proportion below it".

The five steps of a test

Every hypothesis test in AI is marked on the same five steps: state $H_{0}$ and $H_{1}$; state the significance level; compute the statistic and the $p$-value on the GDC; compare $p$ with the level; write a conclusion in context.

Chi-squared

For a test of independence on an $r\times c$ table, $\text{df}=(r-1)(c-1)$, and expected values are $\dfrac{\text{row total}\times\text{column total}}{\text{grand total}}$. For goodness of fit, $\text{df}=(\text{number of categories})-1$ minus one further for each parameter estimated from the data. The test is invalid if any expected frequency is below $5$.

The $t$-test

Used to compare means. A two-tailed $p$-value is exactly twice the one-tailed value for the same data, so a result significant at $5\%$ two-tailed is significant at $2.5\%$ one-tailed.

Rejecting $H_{0}$ never proves $H_{1}$; and failing to reject never proves $H_{0}$.

7/12 5/12 Đỏ Xanh 6/11 5/11 7/11 4/11 ĐĐ: 42/132 = 0,318 ĐX: 35/132 = 0,265 XĐ: 35/132 = 0,265 XX: 20/132 = 0,152 lần 1 lần 2 Hộp: 7 đỏ, 5 xanh — rút 2 không hoàn lại
What makes this diagram different from a “with replacement” diagram lies in the second branch: the denominator changes from $12$ to $11$, and the numerator changes according to the color drawn the first time. The top branch is $\dfrac{7}{12}\times\dfrac{6}{11}$, with $6$ red balls left among $11$; the branch $\text{R}\to\text{G}$ is $\dfrac{7}{12}\times\dfrac{5}{11}$ because the number of green balls has not changed. The four outcomes add up to exactly $1$: $0.318+0.265+0.265+0.152=1$, and this addition is the quickest way to check that every denominator was written correctly. The two middle branches give the same value $\dfrac{35}{132}$ even though the order of drawing is different; that is no coincidence but a rule, and it explains why $P(\text{exactly one red})=2\times\dfrac{35}{132}=0.530$. Finally, a tree diagram is the only way to see that conditional probabilities sit on the branches while joint probabilities sit at the end points: $\dfrac{6}{11}$ is $P(\text{red on draw 2}\mid\text{red on draw 1})$, while $0.318$ is $P(\text{red and red})$.

Worked example: a chi-squared test for independence, all five steps

A school surveys $200$ learners about their choice of Mathematics course and gender, obtaining the following table.

MaleFemale
Chose AA$38$$22$
Chose AI$45$$35$
Did not choose Math HL$17$$43$

Test at the $5\%$ significance level whether the choice of course is independent of gender.

Solution

Step 1: hypotheses.

$H_{0}$: the choice of course is independent of gender. $H_{1}$: the choice of course is not independent of gender.

Step 2: significance level and degrees of freedom. The level is $5\%$; the table is $3\times 2$ so

$$\text{df}=(3-1)(2-1)=2$$

Step 3: expected frequencies. The row totals are $60,\ 80,\ 60$; the column totals are both $100$; the grand total is $200$.

ExpectedMaleFemale
AA$30$$30$
AI$40$$40$
Not HL$30$$30$

Every expected count is greater than $5$, so the test can be used.

$$\chi^{2}=\frac{(38-30)^{2}}{30}+\frac{(22-30)^{2}}{30}+\frac{(45-40)^{2}}{40}+\frac{(35-40)^{2}}{40}+\frac{(17-30)^{2}}{30}+\frac{(43-30)^{2}}{30}$$$$\chi^{2}=2.133+2.133+0.625+0.625+5.633+5.633=16.78$$

Step 4: compare. The critical value at the $5\%$ level with $\text{df}=2$ is $5.991$, and $p=0.000227$.

$$16.78>5.991\quad\text{and}\quad 0.000227<0.05$$

Step 5: conclusion tied to the context. Reject $H_{0}$. There is very strong evidence at the $5\%$ level that the choice of Mathematics course is not independent of gender at this school.

More to read from the table, and this is the part problems often ask next: the cells contributing most to $\chi^{2}$ are the row “did not choose Math HL”, with $5.633$ in each column. The number of males in this group is $17$ against an expected $30$, while females are $43$ against an expected $30$. So the difference is concentrated in dropping Math HL altogether, not in choosing AA or AI; the first two rows contribute very little.

A final note: this conclusion is about this school, and it says only that there is an association, not that gender causes the choice.

Worked example: binomial and normal in a quality-control problem

A packaging line produces packs whose mass follows a normal distribution $N(340,\,25^{2})$ grams. A pack is rejected if it weighs more than $375$ g.

(a) Calculate the probability that a pack is rejected. (b) In a carton of $15$ packs, calculate the probability that exactly $5$ packs are rejected, given that the line's actual rejection rate is $0.28$. (c) Find the mass that $5\%$ of the packs exceed.

Solution

(a) Standardize and look up, or use the normal distribution function directly on the calculator:

$$z=\frac{375-340}{25}=1.4\;\Longrightarrow\;P(X>375)=1-0.9192=0.0808$$

Note the notation: $N(340,\,25^{2})$ means $\sigma=25$. Anyone who reads $25$ as the variance will take $\sigma=5$, get $z=7$ and a probability almost equal to $0$, an error of thousands of times while the number is still “valid”.

(b) The number of rejected packs in a carton of $15$ is $Y\sim B(15,\,0.28)$:

$$P(Y=5)=\binom{15}{5}(0.28)^{5}(0.72)^{10}=0.193$$

The four binomial conditions are met: $15$ packs is a fixed number, each pack is either rejected or not, the rate $0.28$ is constant, and the packs are independent. If the problem said the carton was drawn without replacement from a small batch, the independence condition would fail and the binomial model could no longer be used.

Reasonableness check: the expected value is $np=15(0.28)=4.2$, so $5$ lies right next to the most likely value, and a probability of about $0.19$ is exactly the magnitude to expect.

(c) We need the value $k$ such that $P(X>k)=0.05$, that is, $P(X\lt k)=0.95$. Use the inverse normal function:

$$k=340+25(1.6449)=381.1\ \text{g}$$

The trap in this part is entering $0.05$ instead of $0.95$ into the inverse normal function, giving $298.9$ g. Recognize it immediately by common sense: the question says “heavier than”, so the answer must be greater than the mean of $340$ g.

Common mistake

First trap: reading $N(\mu,\sigma^{2})$ as $N(\mu,\sigma)$. The second position is the variance; $N(340,625)$ and $N(340,25^{2})$ are the same distribution with $\sigma=25$. Second trap: off by one in the binomial. “At least $5$” is $1-P(X\le 4)$; “more than $5$” is $1-P(X\le 5)$. Third trap: using the wrong degrees of freedom for chi-squared. A $3\times 3$ table has $\text{df}=4$, not $9$ (the number of cells) and not $8$ (the number of cells minus one). Taking $\text{df}=9$ pushes the critical value from $9.49$ up to $16.92$, enough to flip the conclusion from “reject” to “do not reject”, and nothing in the calculation sounds an alarm. Fourth trap: concluding that $H_{0}$ is true. Failing to reject only means there is not enough evidence, just as a court's verdict of not guilty does not mean innocence has been proved. Fifth trap: forgetting to check the condition that expected frequencies are $\ge 5$ before running chi-squared; if any cell is below $5$ the categories must be merged, and a solution that does not merge loses marks even if every calculation is correct. Sixth trap: writing a bare conclusion such as “reject $H_0$” without restating the context, which always loses one mark.

Key takeaway

Every AI test is marked on a fixed framework, so learn the framework first and the formulas second: two hypotheses, significance level, statistic and $p$, comparison, conclusion in context. The calculator takes care of the middle; the marks lie at the beginning and at the end: setting $H_{0}$ correctly, and being able to say what the result means to the person who asked the question.

← Bivariate data: scatter diagrams, regression and correlation · All IB Math AI lessons · Practice IB Math AI questions (free, instant scoring) · Differentiation in context: rates of change, tangents and optimisation →