Lesson 1 — Adding up coin flips until a bell appears

Say what you expect before you flip. Three quick rounds of coins, then the same idea on real heights.

A — Flip a coin ten times. Three rounds.

Say how many heads you expect. Flip ten coins. See how close you were. Three times.

Locked — confirm your name above to unlock this section.

What to do

On the right, say how many heads you expect. Then flip until you've flipped ten. Three rounds — the tally tracks how close you were each time.

Number of heads

flips so far: 0 / 10  |  heads: 0

Expecting 5 counts as ✓ only when exactly 5 heads come up — about 1 round in 4. Even when a round comes up ✗, watch what happens to your three numbers.

Round 1 of 3

Prediction

How many heads do you expect to see in ten coin flips?

Controls

R code

set.seed(42)flips <- rbinom(10, size = 1, prob = 0.5)sum(flips)   # count of heads

Pause — what your "error" looked like

How far off each round's prediction was from the actual heads count.

Complete Stage A to unlock this section.

Your three rounds

RoundYou expectedHeads that came upOff by

Across all 30 flips: you expected heads in total, and actually came up.

That last column — how far off each round was — is your error.

Add the three up. Your total error across the rounds: heads (an average of per round).

Now suppose you had expected 5 every single round — the middle of 0 to 10 — and never changed your mind. Your total error would have been heads.

One number, used every round, against your three separate calls. Which came out closer — and why might the middle beat trying to read each round?

B — Expect a person's height

Real adult heights. Pick one number, then draw people until it fits.

Complete Stage A to unlock this section.

What to do

Pick one height (in centimeters) you expect for a random adult. Click Draw to pull one, and repeat. If your average error across 30 draws lands close to zero, you move on. If not, you pick a new number and try again.

Heights you have drawn so far

you expect:  |  draws so far: 0 / 30  |  overestimated: 0  |  underestimated: 0  |  average error:

Controls

cm

R code

# 30 random adult heights from real data.nh <- read.csv("data/clean/nhanes_adults.csv")set.seed(7)truths <- sample(nh$Height, 30)guess <- ___    # type a value; aim for an average error near zeromean(guess - truths)

C — The same move, now on two groups

One number rarely fits everyone. Aim one at each group and watch what happens.

Complete Stage B to unlock this section.

What to do

Same as Stage B, but the adults now come from two groups — women and men. Pick one height you expect for each. Then draw people from both and watch your two average errors, and how far apart the two crowds sit.

People you have drawn — two groups

women: 0 drawn, avg error  |  men: 0 drawn, avg error

Prediction

You are about to aim one number at each group. Before you start — which do you think will be larger?

Draw from both groups to wrap up. 0/24 draws

Controls

cm
cm

Gap vs. spread

distance between the two groups: cm
typical spread inside one group: cm

Draw enough from both groups, then read the two numbers above. Which is bigger — the distance between the crowds, or the scatter inside one of them? What would that tell you about whether "women" and "men" are really one crowd or two?

R code

# One number won't fit two groups.nh <- read.csv("data/clean/nhanes_adults.csv")women <- nh$Height[nh$Gender == "female"]men   <- nh$Height[nh$Gender == "male"]expect_women <- ___expect_men   <- ___abs(mean(men) - mean(women))   # gap between groupsmean(c(sd(men), sd(women)))    # spread within a group