
describe the chi-square distribution and carry out a chi-square goodness-of-fit test to decide whether observed counts are consistent with a hypothesized distribution.
Instruction
The tests so far compared one or two parameters. Sometimes the question is about a whole distribution of categories: are the counts in all categories consistent with a model? That calls for the chi-square (χ2) test (PS.19).
The statistic. For each category, compare the observed count O with the count E expected under the model:
χ2 = Σ (O − E)2 / E
Squaring makes every discrepancy count positively, and dividing by E scales it: a miss of 10 matters more when 20 were expected than when 2,000 were.
The chi-square distributions. When the model is true and expected counts are large enough, the statistic follows a χ2 distribution with degrees of freedom df = (number of categories − 1), minus one more for each parameter estimated from the data. Chi-square curves take only non-negative values, are skewed right, and have mean equal to df. Large values of χ2 are evidence against the model, so the P-value is always the upper-tail area. At df = 6 the 5% critical value is 12.59; at df = 3 it is 7.81.
Conditions. Random sample or independent observations; all expected counts at least 5 (combine categories if not).
Example 1: does rain favor a day of the week? NOAA daily records for St. Louis Lambert International Airport, 2000-2024, include 2,846 rainy days. H0: rainy days are spread evenly across the days of the week. Ha: they are not. The calendar has almost equal numbers of each weekday, so under H0 each expects 2,846/7 ≈ 406.57.
| Mon | Tue | Wed | Thu | Fri | Sat | Sun | |
| Observed | 408 | 383 | 426 | 431 | 401 | 397 | 400 |
| (O−E)2/E | 0.01 | 1.37 | 0.93 | 1.47 | 0.08 | 0.23 | 0.11 |
χ2 ≈ 4.18, df = 6, P ≈ 0.65 (=CHISQ.DIST.RT(4.18, 6)). The statistic is close to its expected value of 6. Fail to reject H0: there is no convincing evidence that rain favors any weekday. That fits the physics: storms do not follow the work week. Thursday’s 431 looks high, but differences this size arise by chance more than half the time. (Caveat: rainy days cluster, so the counts are not fully independent. That makes true chance variation somewhat larger, which only strengthens the “no evidence” conclusion.)
Example 2: is a binomial model consistent with the data (A2.DS.A.2)? Take the 100 January weeks at St. Louis (the first 28 days of each January from 2000 to 2024, as four weeks each) and the model Binomial(7, 0.284), where 0.284 = 199/700 is the share of rainy days. Now test it formally. Combine 4 or more rainy days into one category so that every expected count is at least 5:
| rainy days | 0 | 1 | 2 | 3 | 4+ |
|---|---|---|---|---|---|
| Observed | 17 | 22 | 28 | 17 | 16 |
| Expected | 9.62 | 26.75 | 31.87 | 21.10 | 10.66 |
| (O−E)2/E | 5.66 | 0.84 | 0.47 | 0.80 | 2.68 |
χ2 ≈ 10.4. Degrees of freedom: 5 categories − 1 − 1 (p was estimated from the data) = 3. P ≈ 0.015. Reject the binomial model at α = 0.05. The biggest contribution, 5.7, comes from completely dry weeks: 17 observed against 9.6 expected, and the 4+ category adds 2.7 (16 against 10.7). The test formally confirms what a bar chart suggests: rainy days are not independent, so they cluster into wet spells and dry spells.
Reading contributions. Always look at which categories drive a large χ2. That tells you how the model fails, which is usually more useful than the P-value.
📖 Read for this lesson
The reading opens over the lesson; close it to come back to exactly where you were. The checks below draw on it.
Formative check
Work through these before moving on. They are not graded — they tell you whether the standard below has landed yet.
Of 2,846 rainy days at St. Louis, Thursday had 431 and Tuesday 383 (expected about 407 each). Will a goodness-of-fit test find convincing evidence that rain favors some weekdays?
For the binomial fit with 5 categories and p estimated from the data, df = 5 − 1 − = .
In the binomial goodness-of-fit test, which category contributes most to χ², and what does that show?
Choose a Missouri station’s NOAA daily file and test whether its days of 0.25 inch of rain or more are spread evenly across the months October to April (expected counts proportional to the number of days in each month). State hypotheses, check conditions, compute χ² with its contributions, find the P-value with CHISQ.DIST.RT, and interpret the largest contribution. (The Lesson 4.1 reading works the same test for St. Louis, to check yours against.)
How confident are you that you can carry out a chi-square goodness-of-fit test and explain which categories drive the result?
Practice
Work these on paper or in your notebook, then open Check your answer. Aim for all of Fluency and Application; try at least one Challenge.
Printable version: this unit’s practice workbook (PDF)
Fluency
Build speed and accuracy with the core skill.
- A 4-category variable is claimed to be uniform. Observed counts: 30, 22, 28, 10. Carry out a chi-square goodness-of-fit test.
Check your answer
Answer: expected 22.5 each; χ2 ≈ 10.80, df = 3, P-value ≈ 0.0129. At α = 0.05, reject H0: there is convincing evidence the categories are not equally likely.χ2 = Σ(observed − expected)2/expected; all expected counts are at least 5. - A 3-category variable is claimed to be uniform. Observed counts: 39, 26, 25. Carry out a chi-square goodness-of-fit test.
Check your answer
Answer: expected 30.0 each; χ2 ≈ 4.07, df = 2, P-value ≈ 0.1309. At α = 0.05, fail to reject H0: there is not convincing evidence against equal proportions.χ2 = Σ(observed − expected)2/expected; all expected counts are at least 5. - A 3-category variable is claimed to be uniform. Observed counts: 38, 35, 17. Carry out a chi-square goodness-of-fit test.
Check your answer
Answer: expected 30.0 each; χ2 ≈ 8.60, df = 2, P-value ≈ 0.0136. At α = 0.05, reject H0: there is convincing evidence the categories are not equally likely.χ2 = Σ(observed − expected)2/expected; all expected counts are at least 5. - A 3-category variable is claimed to be uniform. Observed counts: 29, 35, 26. Carry out a chi-square goodness-of-fit test.
Check your answer
Answer: expected 30.0 each; χ2 ≈ 1.40, df = 2, P-value ≈ 0.4966. At α = 0.05, fail to reject H0: there is not convincing evidence against equal proportions.χ2 = Σ(observed − expected)2/expected; all expected counts are at least 5. - A 3-category variable is claimed to be uniform. Observed counts: 77, 74, 49. Carry out a chi-square goodness-of-fit test.
Check your answer
Answer: expected 66.7 each; χ2 ≈ 7.09, df = 2, P-value ≈ 0.0289. At α = 0.05, reject H0: there is convincing evidence the categories are not equally likely.χ2 = Σ(observed − expected)2/expected; all expected counts are at least 5. - A goodness-of-fit test has 6 categories and no parameters estimated from the data. What are the degrees of freedom?
Check your answer
Answer: 5. - The same test, but one parameter was estimated from the data. What are the df?
Check your answer
Answer: 4.Subtract one more per estimated parameter. - Find the P-value for χ² = 11.07 with df = 5.
Check your answer
Answer: ≈ 0.050. - What is the mean of a chi-square distribution with df = 8?
Check your answer
Answer: 8. - An expected count is 3.2. What should you do before running the test?
Check your answer
Answer: Combine that category with a neighbor so every expected count is at least 5.
Application
Use the skill in context. Show your reasoning.
- Springfield, 2000-2024 (NOAA daily): rainy days by weekday, Monday to Sunday: 363, 368, 392, 404, 396, 401, 365 (total 2,689). Test whether rain is spread evenly across weekdays.
Check your answer
Answer: Expected 384.14 each; χ² ≈ 5.09, df = 6, P ≈ 0.532. Not convincing evidence that rain favors particular weekdays at Springfield.The calendar has nearly equal numbers of each weekday, so equal expected counts are reasonable. - Springfield, 2000-2024: days with at least 0.25 inch of rain, by month from October to April: Oct 105, Nov 85, Dec 69, Jan 69, Feb 77, Mar 114, Apr 128. Test whether heavy-rain days are spread across these months in proportion to their number of days, and name the months that contribute most.
Check your answer
Answer: χ² ≈ 35.0, df = 6, P far below 0.001. Largest contributions: Apr (14.6), Dec (6.9), Jan (6.9).Expected counts: 94.5, 91.4, 94.5, 94.5, 86.2, 94.5, 91.4. - Kansas City July weeks (2000-2024, 100 weeks of the first 28 days of July): a Binomial(7, 0.443) model for the number of days at 90°F or above. Pooling 0-1 and 5-7 days, observed 25, 18, 17, 12, 28 against expected 10.9, 22.1, 29.3, 23.3, 14.4. Carry out the goodness-of-fit test (p was estimated from the data).
Check your answer
Answer: χ² ≈ 42.4, df = 3, P far below 0.001. Reject the binomial model: hot days cluster in hot spells, so there are more all-hot and all-cool weeks than independent days would produce.df = 5 categories − 1 − 1 estimated parameter.
Challenge
Stretch problems. Expect to think before you write.
- Why is the P-value of a chi-square test always an upper-tail area, even though the alternative is ‘the distribution differs in any way’?
Check your answer
Answer: Every kind of departure from the model makes (O − E)² larger, so any discrepancy increases χ². Small χ² values mean the data fit well, so only large values count as evidence against the model.
Review
Keep earlier skills sharp.
- Test H0: p = 0.2 against Ha: p > 0.2, given 109 successes in a random sample of 500. Find the test statistic and the P-value.
Check your answer
Answer: p̂ = 0.218; z ≈ 1.01; P-value ≈ 0.1572. At α = 0.05, fail to reject H0: there is not convincing evidence that the population proportion is greater than 0.2.Use p0, not p̂, in the standard error of a test. State the conclusion in context: reject or fail to reject H0, never “accept”. - (Unit 3) State the conclusion for P = 0.65 at α = 0.05 in the weekday test.
Check your answer
Answer: Fail to reject H₀: not convincing evidence that rain favors any weekday.
Where the Rain Falls in the Calendar, and Mendel’s Peas: Two Goodness-of-Fit Tests
NOAA NCEI GHCN-Daily, station USW00013994 (St. Louis Lambert International Airport), PRCP, October-April days 2000-2024 and January weeks 2000-2024; Mendel, Versuche ueber Pflanzen-Hybriden (1866), dihybrid seed counts 315, 101, 108, 32, via the MendelWeb translation; retrieved 2026-11-10 · Public domain (works of the United States government; Mendel 1866), with SLS original worked computation
Why this reading. The lesson’s two examples are complete, with their tables printed, and can be checked from the critical-values reading. Its open question is not: it asks you to download a station’s daily file and test whether heavy-rain days are spread evenly across the months. Here is that table for St. Louis, built from the file the course uses, with the expected counts worked as the question specifies. After it, the most famous goodness-of-fit result in the history of statistics, and an argument about it; and the binomial expected counts behind the lesson’s second example, spelled out.
Table 1. Days of 0.25 inch or more, by month, St. Louis, October to April, 2000–2024
NOAA GHCN-Daily, station USW00013994, PRCP, every October-through-April day from January 2000 to December 2024 (so 25 of each month; February has 707 days because of leap years). Retrieved 2026-11-10. H0: a heavy-rain day is equally likely on any day of the season, so each month’s expected share is its share of the season’s days.
| Oct | Nov | Dec | Jan | Feb | Mar | Apr | Total | |
|---|---|---|---|---|---|---|---|---|
| Days in the record | 775 | 750 | 775 | 775 | 707 | 775 | 750 | 5,307 |
| Share of days | 0.1460 | 0.1413 | 0.1460 | 0.1460 | 0.1332 | 0.1460 | 0.1413 | 1 |
| Days with ≥ 0.25 in, observed O | 90 | 87 | 92 | 71 | 65 | 111 | 133 | 649 |
| Expected E = total × share | 94.8 | 91.7 | 94.8 | 94.8 | 86.5 | 94.8 | 91.7 | 649 |
| (O − E)2/E | 0.24 | 0.24 | 0.08 | 5.96 | 5.33 | 2.78 | 18.58 | 33.21 |
The test. Conditions: every expected count is far above 5; the observations are days, and consecutive days are not independent, which the conclusion must mention. χ2 = 33.2 with df = 7 − 1 = 6. The critical value at 0.001 is 22.46 (Table 3 of the critical-values reading); the statistic is about 1.5 times that, so P < 0.001 (CHISQ.DIST.RT gives about 9.5e-06). Reject H0: heavy rain is not spread evenly across the season. The contributions say how: Apr contributes 18.6, by far the most (133 heavy-rain days against 92 expected: spring storm season), and Jan and Feb contribute 6.0 and 5.3 (fewer than expected). In St. Louis the heavy-rain days are not concentrated in the autumn and winter months the way a coastal winter-rain climate would put them; they peak in spring.
Two things a report should add. First, the day-clustering caveat inflates χ2 somewhat (a three-day storm is one event counted three times), and the effect here is smaller than a coastal station’s, so the caveat matters more: a correction could push the P-value toward 0.01. Second, this is a test of one station’s 25 seasons; a different station moves the numbers, and the source line gives the query to change.
Table 2. Mendel’s dihybrid cross (1866)
Gregor Mendel crossed pea plants differing in two seed traits and classified 556 seeds of the second generation. His theory predicted the four types in the ratio 9:3:3:1. The counts, from his 1866 paper Versuche über Pflanzen-Hybriden (public domain; an English translation is hosted at MendelWeb), are:
| Seed type | Round yellow | Wrinkled yellow | Round green | Wrinkled green | Total |
|---|---|---|---|---|---|
| Observed | 315 | 108 | 101 | 32 | 556 |
| Expected (9:3:3:1) | 312.75 | 104.25 | 104.25 | 34.75 | 556 |
| (O − E)2/E | 0.0162 | 0.1349 | 0.1013 | 0.2176 | 0.470 |
χ2 = 0.470, df = 3 (no parameter was estimated; the ratios come from the theory). Table 3 gives 6.25 at the 0.10 tail, so P is far above 0.10; CHISQ.DIST.RT(0.470, 3) = 0.925. The data are consistent with 9:3:3:1, and this test, published by Pearson in 1900, is precisely what “consistent with” means.
The claim to argue about. A chi-square of 0.47 on 3 df means the counts are closer to their expected values than they would be about 93% of the time if the theory were exactly true and the seeds independent. In 1936 R. A. Fisher pooled all of Mendel’s published experiments and found the same thing everywhere: fits that were too good, with a combined P of about 0.99993 for being that close by chance. He suggested that something had been tidied, perhaps by an assistant who knew what the master expected, perhaps by Mendel’s own sense of when a count was “right”. Others have argued that the experiments were stopped when they looked right, or that Fisher’s reading was too harsh. A very small chi-square is as informative as a very large one, but nobody rejects a model for fitting too well without asking how the counts were produced. Discuss: what would you want to know?
Table 3. The binomial expected counts in the lesson’s second example, spelled out
The lesson’s Binomial(7, 0.2843) model uses p̂ = 199 rainy days / 700 week-days = 0.2843 from the 100 January weeks (the first 28 days of each January, 2000–2024, as four weeks). Expected counts are 100 times the probabilities; the lesson’s 9.62, 26.75, 31.87, 21.10 and 10.66 come from the unrounded p̂.
| Rainy days in a week | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 4 or more |
|---|---|---|---|---|---|---|---|---|---|
| Binomial(7, 0.2843) | 0.0962 | 0.2675 | 0.3187 | 0.2110 | 0.0838 | 0.0200 | 0.0026 | 0.0002 | 0.1066 |
| × 100 weeks | 9.62 | 26.75 | 31.87 | 21.10 | 8.38 | 2.00 | 0.26 | 0.02 | 10.66 |
With these, the lesson’s χ2 ≈ 10.4 on 3 df can be recomputed cell by cell from its observed counts 17, 22, 28, 17 and 16. The dry-week cell contributes (17 − 9.62)2/9.62 = 5.7 by itself. P = 0.015 (CHISQ.DIST.RT(10.45, 3)).
Sources: NOAA NCEI, Daily Summaries (GHCN-Daily) data search (ncei.noaa.gov); NOAA NCEI Access Data Service (the query used here) (ncei.noaa.gov); MendelWeb, Mendel’s Experiments in Plant Hybridization (1866), English translation (mendelweb.org)
The Tables: t Critical Values, t Tail Areas, Chi-Square and z
Critical values and tail areas of the t, chi-square and standard normal distributions, computed for this course and rounded; any published table will agree · SLS original
Why this reading. Several lessons tell you to compute a t-interval or a P-value “by hand” and then confirm with T.INV.2T or CHISQ.DIST.RT. The lessons print five t* values and two chi-square critical values between them. This page is the rest: enough of each table to do every hand computation in Units 2 to 4, and to bracket a P-value without a device. All values were computed for this course and rounded to three decimals; a printed table in any textbook will agree.
Table 1. Critical values t* of Student’s t
The column heading gives the confidence level for a two-sided interval and, in parentheses, the area in one tail. For a one-sided test at α = 0.05, use the 0.05-tail column (90%); for a two-sided test at α = 0.05, the 0.025-tail column (95%). If your df is not listed, use the next smaller df, which is conservative.
| df | 80% (tail 0.10) | 90% (tail 0.05) | 95% (tail 0.025) | 98% (tail 0.01) | 99% (tail 0.005) | 99.9% (tail 0.0005) |
|---|---|---|---|---|---|---|
| 1 | 3.078 | 6.314 | 12.706 | 31.821 | 63.657 | 636.619 |
| 2 | 1.886 | 2.920 | 4.303 | 6.965 | 9.925 | 31.599 |
| 3 | 1.638 | 2.353 | 3.182 | 4.541 | 5.841 | 12.924 |
| 4 | 1.533 | 2.132 | 2.776 | 3.747 | 4.604 | 8.610 |
| 5 | 1.476 | 2.015 | 2.571 | 3.365 | 4.032 | 6.869 |
| 6 | 1.440 | 1.943 | 2.447 | 3.143 | 3.707 | 5.959 |
| 7 | 1.415 | 1.895 | 2.365 | 2.998 | 3.499 | 5.408 |
| 8 | 1.397 | 1.860 | 2.306 | 2.896 | 3.355 | 5.041 |
| 9 | 1.383 | 1.833 | 2.262 | 2.821 | 3.250 | 4.781 |
| 10 | 1.372 | 1.812 | 2.228 | 2.764 | 3.169 | 4.587 |
| 12 | 1.356 | 1.782 | 2.179 | 2.681 | 3.055 | 4.318 |
| 14 | 1.345 | 1.761 | 2.145 | 2.624 | 2.977 | 4.140 |
| 16 | 1.337 | 1.746 | 2.120 | 2.583 | 2.921 | 4.015 |
| 18 | 1.330 | 1.734 | 2.101 | 2.552 | 2.878 | 3.922 |
| 19 | 1.328 | 1.729 | 2.093 | 2.539 | 2.861 | 3.883 |
| 20 | 1.325 | 1.725 | 2.086 | 2.528 | 2.845 | 3.850 |
| 24 | 1.318 | 1.711 | 2.064 | 2.492 | 2.797 | 3.745 |
| 25 | 1.316 | 1.708 | 2.060 | 2.485 | 2.787 | 3.725 |
| 29 | 1.311 | 1.699 | 2.045 | 2.462 | 2.756 | 3.659 |
| 30 | 1.310 | 1.697 | 2.042 | 2.457 | 2.750 | 3.646 |
| 40 | 1.303 | 1.684 | 2.021 | 2.423 | 2.704 | 3.551 |
| 50 | 1.299 | 1.676 | 2.009 | 2.403 | 2.678 | 3.496 |
| 53 | 1.298 | 1.674 | 2.006 | 2.399 | 2.672 | 3.484 |
| 56 | 1.297 | 1.673 | 2.003 | 2.395 | 2.667 | 3.473 |
| 60 | 1.296 | 1.671 | 2.000 | 2.390 | 2.660 | 3.460 |
| 73 | 1.293 | 1.666 | 1.993 | 2.379 | 2.645 | 3.429 |
| 80 | 1.292 | 1.664 | 1.990 | 2.374 | 2.639 | 3.416 |
| 100 | 1.290 | 1.660 | 1.984 | 2.364 | 2.626 | 3.390 |
| 199 | 1.286 | 1.653 | 1.972 | 2.345 | 2.601 | 3.340 |
| 1,000 (≈ z) | 1.282 | 1.646 | 1.962 | 2.330 | 2.581 | 3.300 |
Table 2. Upper-tail areas P(Tdf > t), for bracketing a P-value
For a two-sided P-value, double the area. Example: t = 2.53 with df = 29 sits between 2.5 (area 0.0092) and 3.0 (area 0.0027), so the two-sided P is between 0.005 and 0.018; the spreadsheet gives 0.017. The df rows are the ones the course’s examples use: 6 (CDC slope, 8 years), 9 and 18 (music experiment), 17 (CDC paired changes), 29 (samples of 30), 53 and 56 (Welch df for the era comparisons), 73 (75-year regressions).
| df t | 1.0 | 1.5 | 2.0 | 2.5 | 3.0 | 3.5 | 4.0 | 5.0 |
|---|---|---|---|---|---|---|---|---|
| 6 | 0.1780 | 0.0921 | 0.0462 | 0.0233 | 0.0120 | 0.0064 | 0.0036 | 0.0012 |
| 9 | 0.1717 | 0.0839 | 0.0383 | 0.0169 | 0.0075 | 0.0034 | 0.0016 | 0.0004 |
| 17 | 0.1657 | 0.0760 | 0.0309 | 0.0115 | 0.0040 | 0.0014 | 0.0005 | 0.0001 |
| 18 | 0.1653 | 0.0755 | 0.0304 | 0.0112 | 0.0038 | 0.0013 | 0.0004 | 0.0000 |
| 29 | 0.1628 | 0.0722 | 0.0275 | 0.0092 | 0.0027 | 0.0008 | 0.0002 | 0.0000 |
| 53 | 0.1609 | 0.0698 | 0.0253 | 0.0078 | 0.0021 | 0.0005 | 0.0001 | 0.0000 |
| 56 | 0.1608 | 0.0696 | 0.0252 | 0.0077 | 0.0020 | 0.0005 | 0.0001 | 0.0000 |
| 73 | 0.1603 | 0.0690 | 0.0246 | 0.0073 | 0.0018 | 0.0004 | 0.0001 | 0.0000 |
| 1000 | 0.1588 | 0.0670 | 0.0229 | 0.0063 | 0.0014 | 0.0002 | 0.0000 | 0.0000 |
Table 3. Chi-square critical values (upper tail) and the mean of each distribution
The P-value of a chi-square test is always the upper-tail area. A statistic near the df is unremarkable; a statistic above the 0.05 column is significant at α = 0.05.
| df | Tail 0.10 | Tail 0.05 | Tail 0.01 | Tail 0.001 | Mean |
|---|---|---|---|---|---|
| 1 | 2.71 | 3.84 | 6.63 | 10.83 | 1 |
| 2 | 4.61 | 5.99 | 9.21 | 13.82 | 2 |
| 3 | 6.25 | 7.81 | 11.34 | 16.27 | 3 |
| 4 | 7.78 | 9.49 | 13.28 | 18.47 | 4 |
| 5 | 9.24 | 11.07 | 15.09 | 20.52 | 5 |
| 6 | 10.64 | 12.59 | 16.81 | 22.46 | 6 |
| 7 | 12.02 | 14.07 | 18.48 | 24.32 | 7 |
| 8 | 13.36 | 15.51 | 20.09 | 26.12 | 8 |
| 9 | 14.68 | 16.92 | 21.67 | 27.88 | 9 |
| 10 | 15.99 | 18.31 | 23.21 | 29.59 | 10 |
| 11 | 17.28 | 19.68 | 24.72 | 31.26 | 11 |
| 12 | 18.55 | 21.03 | 26.22 | 32.91 | 12 |
Table 4. Standard normal upper tails for tests
| z | 1.00 | 1.28 | 1.50 | 1.65 | 1.96 | 2.00 | 2.24 | 2.50 | 2.58 | 3.00 | 3.50 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Upper tail | 0.1587 | 0.1003 | 0.0668 | 0.0500 | 0.0250 | 0.0228 | 0.0125 | 0.0062 | 0.0050 | 0.0013 | 0.0002 |
Two-sided P = 2 × upper tail. For z = 2.00, 2 × 0.0228 = 0.0455. The full table of Φ(z) is in the Lesson 1.2 reading.
How to bracket, and how to report
Find your df row. Move right until the table value exceeds your statistic; your tail area is between that column’s tail and the previous one’s. Report the bracket (“0.01 < P < 0.02”), then the exact value from technology. If your statistic is beyond the last column, report “P < 0.001” and stop; the exact size of a very small P-value carries no extra meaning, as Lesson 3.2 says.
Sources: Python documentation, the statistics module (NormalDist) (docs.python.org)