Two-Sample T-Test

April 12, 2026

Problem

Group A: mean=85, s=5, n=20. Group B: mean=80, s=6, n=25. Are they significantly different?

Explanation

When to use a two-sample t-test

Use when comparing means of two independent groups with unknown population standard deviations.

Step-by-step

Hypotheses: H0:μA=μBH_0: \mu_A = \mu_B, Ha:μAμBH_a: \mu_A \neq \mu_B (two-tailed).

Step 1 — Compute the test statistic:

t=xˉAxˉBsA2nA+sB2nB=85802520+3625=51.25+1.44=52.69=51.64=3.05t = \frac{\bar{x}_A - \bar{x}_B}{\sqrt{\frac{s_A^2}{n_A} + \frac{s_B^2}{n_B}}} = \frac{85 - 80}{\sqrt{\frac{25}{20} + \frac{36}{25}}} = \frac{5}{\sqrt{1.25 + 1.44}} = \frac{5}{\sqrt{2.69}} = \frac{5}{1.64} = 3.05

Step 2 — Degrees of freedom (Welch's approximation):

df(sA2/nA+sB2/nB)2(sA2/nA)2nA1+(sB2/nB)2nB1=2.6921.562519+2.073624=7.240.0822+0.0864=7.240.168642.9df \approx \frac{(s_A^2/n_A + s_B^2/n_B)^2}{\frac{(s_A^2/n_A)^2}{n_A-1} + \frac{(s_B^2/n_B)^2}{n_B-1}} = \frac{2.69^2}{\frac{1.5625}{19} + \frac{2.0736}{24}} = \frac{7.24}{0.0822 + 0.0864} = \frac{7.24}{0.1686} \approx 42.9

Step 3 — Critical value at α=0.05\alpha = 0.05, df43df \approx 43: tcrit2.017t_{\text{crit}} \approx 2.017.

Step 4 — Decision: t=3.05>2.017|t| = 3.05 > 2.017. Reject H0H_0.

The two groups have significantly different means.\boxed{\text{The two groups have significantly different means.}}

Try it in the visualization

Two bell curves for each group are drawn. The overlap (or lack thereof) shows how different the groups are. The t-statistic and rejection region are marked.

Interactive Visualization

Parameters

85.00
5.00
20.00
80.00
6.00
25.00
Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day