Gradient

Courses

∇\nabla∇The maths behind AI0/72
π\piπMaths0/84
⋆\star⋆AI for everyone0/10
Γ\GammaΓGame theory0/49
py\texttt{py}pyPython for AI0/15
y^\hat{y}y^​Build your own AI0/15
All courses

Tuition

My tuitionOlympiad trackCompetitions

Practice

ProjectsAsk a questionTrain on a GPUExplorationsMaths StoriesUnsolved problemsPlaygroundScience labsMock testsOlympiad

Reference

GlossaryBlogDiscoveries
Explorations › Data you can hold › lesson 3 of 6

Samples and why size matters

You rarely get to ask everyone, so you ask a sample. Take samples from a crowd of 1,000 and see how size controls the error.

To find out what share of a city prefers tea, you cannot ask everyone. You ask a sample and hope it looks like the whole population. How big does it need to be?

Every sample misses a little

In the crowd, exactly 30% of cubes are yellow. Set the sample size to 10 and press Take 100 samples. The chart behind fills with guesses: some samples found 10%, some 50%. Each is a fair sample, just small.

Now set the size to 200 and take 100 more. The bars bunch tightly around 30%.

The square-root rule

The typical miss shrinks with the square root of the sample size:

sample sizetypical miss
25about ±9%
100about ±4.6%
400about ±2.3%

To halve the error you need four times as many people. That is why national polls often stop at around 1,000 to 2,000 people: going much bigger costs a lot for a small gain.

Bad samples cannot be fixed by size

All of this assumes the sample is random: every person equally likely to be picked. Ask only people at a tea stall about tea, and a sample of a million will still be wrong. A small random sample beats a huge biased one.

Worked example

An online poll on a cricket website asks, "Is cricket India's favourite sport?" Even with 50,000 votes, it tells you about cricket website visitors, not about India.

What to remember

  • A sample is a small group used to learn about a whole population.
  • Random samples miss by a typical amount that shrinks as the sample grows.
  • Four times the sample size halves the typical error.
  • A biased sample stays wrong however big it is.
How spread out?Next