Skip to content
LumenaryAcademy
Start 40 min

What is statistics?

Questions that data can answer, why no two measurements agree, and the people who changed the world by counting carefully.

Code tested · 2AI-draftedAwaiting review by a statistician

Your guides: Chloe · The Statistician, Margaret · The Simulator, Gideon · The Sceptic

MotivationH

Questions with answers hiding in data

Here are some questions people ask every day:

  • Is the new bus route really quicker than the old one?
  • Do tomato plants grow more fruit if you add compost to the soil?
  • How many people live in Brazil, or Nigeria, or Indonesia?
  • Is this new medicine better than the old one?
  • Is the river by our town getting warmer year after year?
  • Which day of the week does the school canteen run out of food?

None of these can be answered by thinking alone, and none can be answered by looking up a fact in a book. You have to go and collect information: time the buses, weigh the tomatoes, count the people, measure the river. That information is called data.

But collecting data is only half the job. Suppose you time the new bus route once and it takes 19 minutes, while the old route took 23 minutes yesterday. Is the new route quicker? Maybe. Or maybe today there was less traffic, or yesterday it rained. A single measurement cannot tell you, because things vary. Bus journeys, tomato plants, people and rivers are never exactly the same twice.

Statistics is the science of learning from data when things vary and we cannot be completely sure. It gives us careful ways to collect data, to describe it, to see patterns in it, and to say how confident we can be in what we conclude. This lesson is your first look at how statisticians think, and at some people who used data to save lives.

IntuitionH

Variation: why one measurement is never enough

Stand all the pupils of a class in a line, from shortest to tallest. No two are exactly the same height. The difference between the shortest and the tallest might be twenty or thirty centimetres, even though they are all about the same age.

Now measure one pupil's height twice: once in the morning and once in the evening. You will probably get two slightly different numbers! People are a little taller in the morning, because the soft discs in the spine squash down during the day. The tape measure might also slip, or the pupil might stand a little differently.

So there are two kinds of variation:

  1. Real differences between things. Pupils really are different heights; tomato plants really do grow different amounts of fruit.
  2. Differences from measuring. Even the same thing, measured twice, can give slightly different numbers.

Variation is not a mistake. It is the normal state of the world, and it is the reason statistics exists. If every bus journey took exactly the same time, one measurement would be enough and we would not need statistics at all.

Here is the most important idea in this lesson:

Definition— statistical question

A statistical question is a question whose answer depends on data that vary. "How old am I?" is not a statistical question: it has one answer. "How old are the people in my street?" is a statistical question: the answers are spread out, and a good reply describes that spread, not just one number.

Variation also explains why we need many measurements. One bus journey could be lucky or unlucky. Twenty journeys show you what is typical and how much the time jumps around. With enough data, the pattern begins to stand out from the randomness, a bit like a tune you can hear through the noise of a busy market.

DefinitionsH

Data, variables and the statistician's cycle

A few words will help us talk precisely.

Definition— data, observation, variable

Data are recorded facts collected to answer a question: numbers, words, measurements, answers to questions. Each thing we record data about (a pupil, a bus journey, a tomato plant) is an observation. Each property we record (height, journey time, number of tomatoes, favourite fruit) is a variable, because it varies from one observation to the next.

A table of data usually has one row for each observation and one column for each variable:

PupilHeight (cm)Shoe size (EU)Favourite fruit
Ama15137mango
Diego14636banana
Mei15838lychee
Yusuf14937mango

Statisticians do not just "do sums on data". They follow a cycle, which many teachers call PPDAC after its five stages: Problem, Plan, Data, Analysis, Conclusion.

Problemwhat do we want to know?Planhow will we collect data?Datacollect and tidy itAnalysispictures and numbersConclusionwhat have we learnt?
The statistician's cycle. A question leads to a plan for collecting data; the data are analysed; the conclusion usually raises a new question, and the cycle begins again.
  1. Problem. Decide what you really want to know, and make the question precise. "Are buses slow?" is vague. "On school-day mornings, is route 7 quicker than route 12 for getting to school by 8 o'clock?" is a question data can answer.
  2. Plan. Decide what to measure, how, and how much. Which days? How many journeys? Who will hold the stopwatch?
  3. Data. Collect the data and check it for mistakes, like a journey written down as 230 minutes instead of 23.
  4. Analysis. Draw pictures of the data and work out summaries, like the typical value and how spread out the values are. You will learn these in Describing data.
  5. Conclusion. Answer the question, and say honestly how sure you are. Usually the answer raises a new question, and round you go again.

Notice that the thinking stages, the problem and the plan, come before any calculation. A brilliant calculation on badly collected data gives a confident, wrong answer.

Worked examplesH

Thinking like a statistician

Example— Two bus routes

Wanjiru can take route 7 or route 12 to school in Nairobi. She times five journeys on each:

DayMonTueWedThuFri
Route 7 (minutes)2224232521
Route 12 (minutes)1731182920

Add up each row: route 7 takes 22 + 24 + 23 + 25 + 21 = 115 minutes over five days, and route 12 takes 17 + 31 + 18 + 29 + 20 = 115 minutes too. Shared out equally over five days, both routes take 115 ÷ 5 = 23 minutes on average. So are they the same?

Not at all! Route 7 always takes between 21 and 25 minutes: a difference of only 4 minutes between its quickest and slowest journeys. Route 12 takes anything from 17 to 31 minutes: a difference of 14 minutes. If Wanjiru must be at school on time for an exam, the dependable route 7 is the better choice, even though the averages are equal. How much the data vary matters as much as the typical value.

Example— A fair test for compost

Kofi wants to know if compost helps tomato plants. He puts compost on the three plants nearest the house and leaves the three plants at the bottom of the garden without. The compost plants grow more tomatoes. Has he shown that compost works?

A statistician would worry. The plants near the house might get more sunshine, or more water from the roof, or more attention. The compost and the position are mixed up, so we cannot tell which one made the difference. A fairer plan: line up all the plants, and for each one toss a coin to decide whether it gets compost. Then sunshine, water and attention are shared out between the two groups by chance, and a big difference between the groups is much more likely to be caused by the compost. Using chance to make a test fair is one of the great ideas of statistics. You will meet it again in experimental design.

Example— Is the die fair?

Lina rolls a die 60 times and gets six 13 times instead of the 10 times she "expected". Is the die loaded? Not necessarily: even a perfectly fair die varies. The next section lets you watch this happen. Deciding whether a difference is bigger than chance alone would make is called hypothesis testing, a big idea you will learn in its own lesson.

ComputationC

Watching variation happen

A computer can make up pretend data that varies in a realistic way. This is called simulation, and statisticians use it all the time as a laboratory: you can try an experiment thousands of times in a second.

The program below does two things. First it makes up the heights of a class of 30 twelve-year-olds and draws them as a sideways picture, one # for each pupil. Then it rolls a fair die 60 times, three times over, and counts how often each face comes up. Press Run.

python
import numpy as np

rng = np.random.default_rng(2026)   # a fixed seed: the same "random" numbers on every run

# A class of 30 pupils, about 12 years old. Heights vary around 152 cm.
heights = rng.normal(152, 7, size=30).round().astype(int)
print("Heights in cm, sorted:", sorted(heights.tolist()))
print("Shortest:", heights.min(), "cm   Tallest:", heights.max(), "cm")
print()

# A sideways picture: one # for each pupil, in groups 5 cm wide.
for low in range(135, 170, 5):
    count = int(((heights >= low) & (heights < low + 5)).sum())
    print(f"{low}-{low + 4} cm | " + "#" * count)
print()

# Roll a fair die 60 times. Each face "should" come up 10 times. Does it?
for trial in range(1, 4):
    rolls = rng.integers(1, 7, size=60)
    counts = [int((rolls == face).sum()) for face in range(1, 7)]
    print("Trial", trial, " ones to sixes:", counts)
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Here is what to look for in the output.

  • The heights run from 139 cm to 165 cm. Most pupils are in the middle, between 145 and 159 cm, and only a few are very short or very tall. That "hump in the middle" shape is extremely common in nature, and you will learn its name in Distributions.
  • The die is perfectly fair (the computer gives each face exactly the same chance), and yet in the first trial three came up 16 times and two only 7 times. The second and third trials are different again. Chance alone makes data vary.

A few words about the code. rng is a random number generator: a machine for making numbers that behave like dice rolls. The seed (2026) makes it produce the same numbers every time, so that you and we see the same output. Change the seed to any other whole number and run again: you will get a new class and new dice, with different details but the same overall patterns.

History & global context

People who changed the world with data

Statistics has a long history in many countries. Here are some of the people and moments that shaped it.

Counting people. Rulers have counted their people for thousands of years, for taxes and armies. A census of Han dynasty China in the year 2 CE recorded close to 60 million people, household by household. The word statistics itself comes from the 1700s, from the German Statistik, which meant facts about a state.

Counting letters. In ninth-century Baghdad, the scholar al-Kindi described how to break a secret code by counting how often each letter appears in the coded message and comparing with how often letters appear in ordinary Arabic. That is one of the oldest uses of frequencies, the counting of how often things happen.

Florence Nightingale (1820–1910). Nightingale is famous as the nurse who led a team to the British army hospital at Scutari (in today's Istanbul) during the Crimean War in 1854. Less well known is that she was a superb statistician. She collected careful records of how soldiers died and showed that far more died of diseases such as cholera and typhus, spread by dirty, crowded wards, than of wounds from battle. To persuade politicians who would not read tables of numbers, she drew bold diagrams, wedge-shaped "rose" charts in which the size of each coloured wedge showed how many soldiers died of each cause in each month. Her work helped bring in cleaner hospitals and better sanitation in the army and beyond. In 1858 she became the first woman elected to the Statistical Society of London (today's Royal Statistical Society).

John Snow (1813–1858). In 1854, cholera killed hundreds of people in a few days in Soho, London. Most doctors then believed cholera spread through "bad air". Snow, a doctor, suspected dirty water instead. He marked each death on a street map and found that they crowded around one public water pump on Broad Street. He also compared households in another part of London whose water came from two different companies: one drew its water from a part of the River Thames polluted by sewage, the other from cleaner water further upstream. Far more people died in the houses supplied by the first company. The local authorities removed the handle of the Broad Street pump. Snow's map and his comparison of the two water companies are now classics of epidemiology, the study of how diseases spread through populations.

pumppumppumpone death
A made-up sketch in the style of Snow's 1854 map (not his real data). Each small square is one death from cholera, drawn beside the street where the person lived. Most of the squares crowd around one pump, in the middle.

Prasanta Chandra Mahalanobis (1893–1972). Born in Kolkata, Mahalanobis studied physics in India and in Cambridge, then became fascinated by statistics. In 1931 he founded the Indian Statistical Institute in Kolkata, which became one of the world's great centres of statistics. He showed that a carefully chosen sample (a well-planned part of the whole) could estimate things like the harvest of jute across a whole province quickly, cheaply and accurately, without measuring every field. His ideas led to India's National Sample Survey, begun in 1950, one of the largest regular surveys in the world, and to statistics being used to plan the country's development. India celebrates its national Statistics Day on his birthday, 29 June. You will see why samples work in Samples and surveys.

And many more. In Belgium in the 1830s and 1840s, Adolphe Quetelet gathered measurements of thousands of people and studied the patterns in human heights, weights and chest sizes. In 1900, the American scholar W. E. B. Du Bois and his students drew beautiful hand-made charts about the lives of Black Americans for the World Exhibition in Paris. Gertrude Cox, in the United States, became an expert in planning fair experiments for farming and medicine. C. R. Rao, a student of the Indian Statistical Institute, discovered results that every statistician still uses, and in 2023, when he was 102, received the International Prize in Statistics. The Japanese engineer Genichi Taguchi used statistics to make factory products more reliable. And the Swedish doctor Hans Rosling filled lecture halls with moving bubble charts that showed how much healthier and richer most of the world has become, a story you can still explore on the Gapminder website.

Common misconceptionsH

Common misconceptions

Misconception

"Statistics is just a part of maths." Statistics uses a lot of mathematics, especially probability, which you can study in Lumenary Math. But it has its own questions and habits: How were these data collected? What is varying, and why? Could this pattern be chance? Is this a fair comparison? Those are questions about the real world, not only about numbers.

Misconception

"If two measurements differ, somebody made a mistake." Sometimes, yes. But usually the difference is simply variation: real differences between people or things, and the small wobbles of every measurement. Statistics expects variation and plans for it.

Misconception

"More data always means a better answer." More data helps only if it is collected well. A million answers from people who chose to reply to an online poll can be less trustworthy than a thousand answers from a carefully chosen random sample. You will see why in Samples and surveys.

Misconception

"You can prove anything with statistics." There is an old saying, made famous by the writer Mark Twain, about "lies, damned lies, and statistics". It is true that numbers can be used to mislead, and a later lesson shows you the tricks. But the cure for bad statistics is good statistics: knowing how to ask where the numbers came from, and what they really show.

Exercises

Exercises

Some exercises ask you to think like a statistician, and one asks you to finish a short Python program. For the Python one, change the code in the box, press Run, and the checker will tell you how you did.

1. What is statistics?

Warm-upHuman

Which of these is a statistical question, one whose answer depends on data that vary?

Choose one

2. What is statistics?

Warm-upHuman

Ravi measures his own height at 8 o'clock in the morning and gets 151.4 cm. He measures again at 8 o'clock in the evening and gets 150.6 cm. What is the best explanation?

Choose one

3. What is statistics?

CoreHuman

Bilal times five journeys on route 3: 18, 26, 21, 30 and 19 minutes. How many minutes is the difference between his slowest and his quickest journey?

4. What is statistics?

CoreHuman

Kofi has 10 tomato plants in a row. Some get more sunshine than others. Which plan gives the fairest test of whether compost helps?

Choose one

5. What is statistics?

Warm-upHuman

What did Florence Nightingale's records of the Crimean War show?

Choose one

6. What is statistics?

StretchHuman

John Snow had two kinds of evidence that cholera spread through water. Why was his comparison of the two water companies especially convincing?

Choose one

7. What is statistics?

CoreComputational

Bilal's five journey times on route 3 are in a Python list. Replace each ... with a calculation so that:

  • total is all the times added up (use sum(times));
  • average is the total shared equally between the 5 journeys (divide by len(times), which counts the items in the list);
  • spread is the slowest time minus the quickest time (use max(times) and min(times)).

Press Run to check.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Further reading and resources