HEG GenΓ¨ve APPLIED STATISTICS Β· WEEK 1 ← Course
This week
0%
Course
0%
Week 1 · Applied Statistics · HEG Genève

The whole chain, in one session

Statistics feels impossible because it is taught as a pile of unrelated recipes. It is not a pile. It is one idea, followed six steps β€” and today you walk all six, end to end, with no formula you cannot see the reason for. Everything after this week is the same six steps done more carefully.

We do it by opening a pizzeria in Geneva and asking one ordinary question: what do we charge for a Margherita? By the end of the session that question has walked you through samples, distributions, the standard deviation, probability, confidence intervals, hypothesis tests, regression and chi-square.

1A sampleask some, not all β€” and the shape settles as you ask more
2Area = chancethe space under the shape is the probability
3How wide?the standard deviation, built out of squares
4Mean + SDtwo numbers β†’ any probability you want
5Turn it roundconfidence intervals Β· hypothesis tests
6Two columnsregression Β· chi-square

The session is three hours in two parts. Part 1 (~1 h) is the lesson: your instructor presents the deck and you follow the same numbered sections here β€” every slide names its section. Part 2 (~2 h) is six exercises worked together, given on the slides and as forms below; solutions open as your instructor reveals them.

🏫 In class: 3 h Β· lesson ~1 h, then exercises ~70 min Β· bring this page open πŸ“– Textbook: Saylor, ch. 1 β€” Introduction β–Ά The Lecture button (top-right) shows the deck we use in class

By the end of Week 1 you will be able to

  • Explain why you sample instead of measuring everyone β€” and what a bigger sample actually buys you.
  • Read a distribution three ways at once: as a count, as a percentage, and as a probability. Same number, three words.
  • Say what a standard deviation is β€” the side of the average square built on the distances from the mean β€” and why the squares are unavoidable.
  • Turn a mean and a standard deviation into a probability, and read any value as "so many standard deviations from the middle".
  • State the logic of a confidence interval and a hypothesis test in plain words, without a formula.
  • Decide, from the type of two columns of data, whether the question is a regression or a chi-square.

Resources β€” tick them off as you go

βœ“Lecture deck β€” the β–Ά Lecture button above; presented in class in Week 1.
βœ“Saylor Β§1.1 β€” Basic definitions and concepts β†— β€” population, sample, parameter, statistic. Ten minutes; read it after section 1.1.
βœ“Saylor Β§1.2 β€” Overview β†— and Β§1.3 β€” Presentation of data β†— β€” short; the second is the seed of Week 2.
βœ“Part 2 Β· the exercise set β€” six exercises, ~70 min, done with your instructor in the second half of the session. Section 1.7 below.
βœ“Week 1 homework β€” ~2 h of calculation on a ten-pizzeria dataset, with hints and worked solutions. Not graded; it is how you find out whether the lesson stuck.
Sections 3–6 are a preview done honestly, not a shortcut: you meet the logic now so that Weeks 5–12 are a return to something you already understand, not a first encounter. Nothing here is examinable until we do it properly.
← Course page
A reset link lives at the bottom of section 1.9.
Section 1.1 Β· The sampleslide 3

One pizzeria is not the market

Before any data

Lease signed. Oven in. Doors open Monday. What do you charge?

Commit to a number now, before you know anything. It goes on the record and you will be shown it again at the end of the session.

Lock in your opening price
No right answer exists yet. That is the point.
Why you cannot just look it up

There are about three hundred pizzerias in Geneva. You are not going to visit them all.

So you do what everybody does: you visit some of them. That is the first move in all of statistics, and it has a name. The three hundred you care about are the population. The handful you actually measure are your sample. Any number you work out from your handful β€” the average, say β€” is a statistic. The true average across all three hundred, which you will never see, is a parameter.

sample β†’ statistic (you can compute it)  Β·  population β†’ parameter (you cannot)

Everything in this course is one move: use the statistic you have to say something honest about the parameter you don't. That is the entire job. Sixteen weeks of technique serve that one sentence.

Try it Β· the whole point of this section

Walk Geneva. Ask more pizzerias. Watch what happens.

Below is the real market β€” all three hundred prices, which in real life you never get to see. Draw a sample from it. Then press Draw again a few times at each size and watch how much the picture jumps.

Sample the market
20
pizzerias asked
β€”
your sample average
β€”
how far that jumped
Each bar counts the pizzerias charging in that band.
What just happened

At n = 5 the picture is a different picture every time you press the button. At n = 300 it is the same picture every time β€” because it is the market.

Two separate things improve as the sample grows, and they are worth separating in your head:

  • The shape steadies. With five prices there is no shape β€” just five dots. With eighty, a hump appears in the middle and thins out at both ends. That hump was always there; you simply could not see it through five observations.
  • Your answer stops jumping. The sample average bounces wildly at n = 5 and barely moves at n = 80. Not because the market changed, but because one unusual pizzeria is a fifth of a small sample and a rounding error in a big one.

A small sample tells you about your sample. A large sample starts telling you about the market.

Notice what this does not promise. A bigger sample fixes noise β€” the random luck of who you happened to ask. It does nothing at all about bias β€” asking only the pizzerias next to the station, say. Ask ten thousand of the wrong pizzerias and you get a beautifully precise wrong answer. Size cures luck; only design cures bias.

Try it

Which is it?

Population Β· Sample Β· Parameter Β· Statistic
Section 1.2 Β· Reading the shapeslide 7

The picture is already a probability

A bar chart is not decoration

Every bar answers the question "how many?" β€” and that is the same as "what share?", which is the same as "how likely?"

You have the three hundred prices. Group them into bands of two francs and count how many fall in each: that is a frequency table, and drawing it is a histogram. So far, book-keeping.

Now the move that the rest of the course is built on. Take any band β€” say CHF 20 to 22. Fifty-six pizzerias sit there. Three things are true at once, and they are the same fact said three ways:

  • A count. 56 pizzerias.
  • A share. 56 out of 300 = 18.7% of the market.
  • A probability. Walk into a Geneva pizzeria at random and there is an 18.7% chance it charges between 20 and 22.

Nothing was added between the second line and the third. A proportion of a population is a probability, as soon as you pick at random. That sentence is free, and it is the bridge from describing data to predicting things.

Try it Β· drag the band

Select any stretch of prices. Read it three ways.

Count β†’ share β†’ chance
β€”
pizzerias in the band
β€”
share of the market
β€”
chance the next one lands here
Drag either handle. The three numbers below are one number in three languages.
The rule you will use for fifteen weeks

Area is probability. The share of the picture you have shaded is the chance of landing in it.

Two consequences follow immediately, and they are not decoration either:

  • The whole picture is 100%. Shade everything and you have shaded certainty β€” the price is somewhere. In the language you will meet in Week 3: total area = 1.
  • You can never get a probability from a single point. "What is the chance a pizzeria charges exactly CHF 19.0000…?" has no useful answer, because a single line has no width and therefore no area. Probability lives in ranges. Students lose marks on this every year.
From steps to a curve

Narrow the bars far enough and the staircase becomes a line.

Two-franc bands are a choice. Use one-franc bands, then fifty-centime bands, and with three hundred thousand pizzerias instead of three hundred the steps shrink until the outline is a smooth curve. Nothing changed except the resolution β€” and the area still means exactly what it meant before.

Same data, finer and finer bands
Slide left. The bars narrow, the outline settles, the area under it never changes.

That particular curve β€” one hump, symmetric, thinning away on both sides β€” is the normal distribution, and it turns up so often that half of statistics is built on it. It is not true that everything is normal. Incomes are not. Waiting times are not. But an astonishing number of things are close enough, and in Week 7 you will learn the reason why β€” it is the single most surprising result in the subject.

Section 1.3 Β· The widthslide 10

How wide is the cloud?

The mean is only half an answer

Two markets. Identical average. Completely different businesses.

Both cities below average exactly CHF 18. If the average were the whole story, opening a pizzeria in one would be the same as in the other. It is not remotely the same.

Same centre, different spread
Left: everyone charges about the same. Right: the market is split wide open.

In the tight market, CHF 22 makes you the most expensive place in town. In the wide one, CHF 22 is unremarkable. The same price means different things depending on how spread out the market is β€” so "how spread out is it?" needs a number of its own.

The obvious idea, and why it dies

Average the distances from the mean. It gives zero. Always.

You want "the typical distance from the middle", so you take each pizzeria's distance from the mean and average them. Sensible. It also fails completely: the places below the mean give negative distances, the places above give positive ones, and they cancel exactly. Not approximately β€” exactly, for every dataset that has ever existed, because that is what "mean" means. The mean is the balance point, so the pull from each side is equal by construction.

So the average distance from the mean is 0, for the tight market and the wide market alike. Useless. This is the dead end your intuition walks into, and every statistics course walks you into it on purpose.

The fix Β· build it step by step

Put a square on each distance.

The problem is the minus signs. Kill them with geometry: on each distance, draw a literal square with that distance as its side. A square's area cannot be negative β€” a distance of βˆ’3 and a distance of +3 both give a square of area 9. Now average the areas, which is an honest arithmetic mean of nine, sixteen, four… and then ask: what is the side of that average square?

That side is the standard deviation.

Build the standard deviation β€” step by step
β€”
mean
β€”
avg of raw distances
β€”
standard deviation
Five pizzerias on the line. The red line is the mean β€” the balance point.
So what is it, in one sentence

The standard deviation is the average distance from the mean β€” measured with squares, so the signs cannot cancel.

It really is almost the ordinary average you already trust. Same three moves: take the distances, average them, done. The only difference is a detour through squares and back:

distances  β†’  square each one  β†’  average the squares  β†’  square root  =  s

The middle two steps have names you will need. The average of the squares is the variance. Its square root β€” back in francs, which is why we bother β€” is the standard deviation. Written out, and it is now a sentence rather than a hieroglyph:

s = √( Ξ£(x βˆ’ xΜ„)Β² ⁄ (n βˆ’ 1) )

Read it right to left and it is the recipe above: a distance (x βˆ’ xΜ„), squared, added up (Ξ£), averaged, square-rooted. The n βˆ’ 1 instead of n is a small honesty correction for the fact that you are using a sample rather than the whole population; Week 2 explains it properly.

False friend, worth twenty seconds now. This is a mean built on squares β€” its formal name is the root mean square or quadratic mean. It is not the geometric mean, which is a genuinely different tool you will meet for average growth rates (multiply the values, take the n-th root). Same family, different animal. If you remember "average of the squares, then unsquare it", you will never mix them up.

One last thing to notice as you drag the slider: the standard deviation always comes out a bit larger than a plain average of the absolute distances. Squaring gives extra weight to whoever is far out β€” so the standard deviation listens hardest to the extremes, which is usually exactly what a business needs it to do.

Section 1.4 Β· The pay-offslide 13

Mean + standard deviation = a probability

This is the step everybody misses

The bell curve has exactly two dials. Set them and you have drawn the whole thing.

Section 1.2 said area is probability. Section 1.3 built a number for the width. Put them together and something remarkable falls out.

A normal curve is fixed by two numbers and nothing else: where it sits (the mean) and how wide it is (the standard deviation). There is no third dial. So if you know those two numbers, you know the entire curve β€” and therefore, by section 1.2, every area under it β€” and therefore every probability you could want.

Move the two dials. Watch the percentages.
68%
within 1 SD
95%
within 2 SD
99.7%
within 3 SD
Move either slider as much as you like. The three percentages never change.
Why that is the whole trick

You just moved the curve anywhere you wanted and made it any width you wanted, and 68%, 95% and 99.7% never budged. That is not a coincidence and it is not an approximation of convenience. It is the reason the standard deviation was worth the trouble of squares.

The standard deviation is the ruler the curve is drawn in. One SD is always 68% of the area β€” whether the data is francs, grams, minutes or millimetres.

This is called the empirical rule, or the 68–95–99.7 rule, and it is the most useful thing in the first half of this course:

mean Β± 1 SD β‰ˆ 68%  Β·  mean Β± 2 SD β‰ˆ 95%  Β·  mean Β± 3 SD β‰ˆ 99.7%

Our Geneva market has a true mean of CHF 18.00 and a true standard deviation of CHF 4.00. So without computing anything at all: about 68% of Geneva pizzerias charge between 14 and 22; about 95% charge between 10 and 26; and a place charging over 30 is roughly a one-in-a-thousand animal.

Try it Β· is that price unusual?

A rival opens down the street at CHF 24. Should you panic?

"Expensive" is a feeling. Turn it into a number by asking the only question that matters: how many standard deviations from the middle is it?

z = (value βˆ’ mean) ⁄ standard deviation  =  (24 βˆ’ 18) ⁄ 4  =  1.5
Any price, in standard deviations
CHF
β€”
standard deviations out
β€”
of the market is dearer
β€”
verdict
Type a price and read the shaded tail.
The number you just invented

That "how many standard deviations out" figure is called a z-score, and it is the most reused number in the subject. It strips the units off: a z of 1.5 means the same thing for a price in francs, a delivery time in minutes and a dough ball in grams β€” further out than about 93% of the population.

A rival at CHF 24 is 1.5 standard deviations above the middle, which puts roughly 7% of Geneva above them. One pizzeria in fifteen. Unusual, certainly. Alarming, no β€” and now you can say which, with a number, in front of your bank.

A mean and a standard deviation turn any value into a probability. That single sentence is the engine of the next fifteen weeks.

Section 1.5 Β· Turning it roundslide 16

How wrong could we be?

The flip

Everything so far assumed you knew the market. You don't.

In section 1.4 we cheerfully used Β΅ = 18.00 and Οƒ = 4.00 β€” the true values across all three hundred pizzerias. In real life nobody hands you those. You have your sixteen, and from them:

xΜ„ = CHF 18.25  Β·  s = CHF 4.00  Β·  n = 16

So you say "about CHF 18.25" β€” and immediately the honest question arrives: how far off could that be? Someone else's sixteen would have given a different number. Yours is not special.

Here is the idea that unlocks it. Your sample average is itself a thing that varies from sample to sample β€” and it varies less than the data does, by a factor of the square root of your sample size. That is why n appears everywhere:

how much xΜ„ itself wobbles  =  s ⁄ √n  =  4.00 ⁄ √16  =  4.00 ⁄ 4  =  CHF 1.00

Now reuse section 1.4 on the averages instead of on the pizzerias. Two of those wobbles either side covers about 95% of the possibilities β€” so:

18.25 Β± 2 Γ— 1.00  β†’  CHF 16.25 to 20.25

That is a 95% confidence interval. Not a new technique β€” the empirical rule, applied to the sample mean.

Try it Β· what the 95% actually means

Twenty different afternoons. Twenty different intervals.

Each line below is one researcher going out, sampling n pizzerias, and drawing their interval. The vertical line is the truth β€” CHF 18.00 β€” which in real life nobody can see. Press the button and watch how many intervals miss.

Twenty researchers, twenty intervals
β€”
intervals that caught 18.00
β€”
that missed
β€”
typical width
Red lines missed the truth entirely. Roughly one in twenty does, by design.
Say it correctly β€” this is examinable and it is got wrong constantly

The 95% is a property of the procedure, not of your one interval. Run the whole business a hundred times and about ninety-five of your intervals will contain the truth. Yours either does or it doesn't; you will never know which.

Wrong: "there is a 95% chance the true price is between 16.25 and 20.25." Right: "this interval came from a method that captures the truth 95% of the time."

And notice what the slider did: more pizzerias, narrower interval β€” but slowly. To halve the width you need four times the sample, because of that √n. Precision is expensive, and it gets more expensive the more you want.

The same machinery, asked as a yes/no question

A hypothesis test in four beats.

A trade magazine prints: "the average Margherita in Geneva costs CHF 21." Your sixteen say 18.25. Is the magazine wrong, or did you just have an unlucky afternoon? Four steps, and no new mathematics:

  1. Assume the claim is true. Pretend, for the sake of argument, that the real average is exactly 21. This assumption has a name: the null hypothesis. You are trying to knock it down.
  2. Ask how surprising your data would be, if it were. If the truth were 21, samples of sixteen would land around 21, wobbling by about 1.00 either side. Landing on 18.25 is 2.75 francs off β€” nearly three wobbles. From section 1.4 you already know how rare three-wobble events are: very.
  3. That rarity is the p-value. It answers exactly one question: if the claim were true, how often would chance alone produce data at least this far off? Here, well under 1%. By convention, under 5% is "rare enough" β€” and that 5% is a convention, not a law of nature.
  4. Decide, and say it carefully. Rare enough, so the claim does not survive: we reject it. Had our sixteen come out at 20.00, the magazine's 21 would have been well within reach and we would fail to reject β€” which is not the same as proving the magazine right. Absence of evidence is not evidence of absence, and in statistics that is a rule, not a slogan.

There is a shortcut hiding here. Your interval was 16.25 to 20.25. The claim 21 sits outside it β€” rejected. A claim of 20 would sit inside β€” survives. The confidence interval and the hypothesis test are the same calculation, read in two directions.

A confidence interval asks "how much could we be off by?". A test asks "could chance alone have done this?". One curve, one area, two questions.

Section 1.6 Β· Two columnsslide 19

Does this move with that?

One column is description. Two columns is business.

"Is it worth paying more rent to be near the lake?" is a two-column question.

Everything up to here used a single column of numbers. Real decisions almost always compare two: price against location, revenue against seats, oven type against neighbourhood. And there is exactly one fork in the road, decided before you compute anything:

Which tool? Look at what kind of thing each column holds.
Both columns are numbers
quantitative β€” you could average them

price (CHF) Β· distance (km) Β· seats Β· revenue

β†’ REGRESSION
"When this goes up, what happens to that β€” and by how much?"
Both columns are labels
qualitative β€” categories, not quantities

neighbourhood Β· wood oven? Β· delivers? Β· price band

β†’ CHI-SQUARE
"Are these two categories related, or independent?"
This is why Week 1 made you classify variables. The data type is the decision.

Careful with the edge: a number you have banded β€” "cheap / mid / posh" instead of the franc value β€” has become a label, and the question becomes a chi-square. You threw away information to do it, which is sometimes a fair trade and sometimes a waste.

Numbers against numbers Β· regression

Fourteen pizzerias: how far from Rive, and what they charge.

Each dot is one pizzeria. Is there a relationship? Your eye says yes. Regression's job is to say how much, with a number you can put in a business plan.

Fit the line
β€”
CHF per km further out
β€”
correlation r
β€”
total squared miss
Press "Fit the best line" β€” then "Show the misses" to see what "best" means.

The line comes out at price β‰ˆ 23.9 βˆ’ 2.29 Γ— km. That slope is the answer to the actual business question: every kilometre further from Rive costs you about CHF 2.29 of menu price. Now you can compare it against the rent difference and decide something.

And look at what "best line" means β€” press Show the misses. The chosen line is the one that makes the total squared miss as small as possible. Squares again, for exactly the reason from section 1.3: misses above and below would otherwise cancel. Regression is the standard deviation's idea, applied to a line instead of a point.

Labels against labels Β· chi-square

Does the neighbourhood tell you anything about the oven?

No numbers here at all β€” just 120 pizzerias sorted into boxes. If neighbourhood and oven type had nothing to do with each other, each neighbourhood would show the same 50/50 split. Press the button to see what "nothing to do with each other" would have looked like.

Observed, against what chance alone would give
β€”
χ² β€” the total gap
5.99
the 5% threshold
β€”
verdict
Each cell shows what you observed. Then what independence predicts. Then the gap.

Carouge has 30 wood ovens where independence predicts 20; PΓ’quis has 12 where it predicts 20. Add up the gaps β€” squared and scaled by how big each box was β€” and you get χ² = 16.8, far past the 5.99 that counts as surprising. So no: neighbourhood and oven are not independent. Carouge is wood-oven country, and that is worth knowing before you sign a lease there.

Both tools do one job: compare what you saw against what chance alone would have produced, and measure the gap with squares. Regression for numbers, chi-square for labels.

The whole chain, and where the rest of the course goes

You have just walked the entire subject. Everything left is doing these six steps with more care.

Nothing in Weeks 2 to 16 is a new idea. Week 2 makes the picture precise. Weeks 3–4 make "area is probability" exact instead of approximate. Weeks 5–8 do the intervals and the tests properly, with the right curve for small samples. Weeks 9–12 do regression and chi-square with all their conditions attached.

When Week 9 feels hard, come back to this page. The question will not have changed β€” only the care taken answering it.

Section 1.7 Β· Part 2 Β· Exercisesslides 25–30

Six exercises, worked together

How this half of the session runs

The second half of the session is the six exercises below, about seventy minutes, done as a class. They follow the six steps in order: one per step.

  • The question goes up on the screen; you work it here.
  • Attempt first, then the hint, then the solution. The hint costs you nothing and teaches you more than the answer does.
  • The πŸ”’ Solution button unlocks when your instructor releases that exercise in class. Once released it stays open, so the whole set is here for revision afterwards.
  • Your answers are saved and reach your instructor's dashboard as classwork. They are not graded.
Section 1.8 Β· Checkpoint

Prove it to yourself

Warm-up Β· false friends

Statistics hijacks ordinary words and gives them sharp, different meanings.

Each card shows a word and its everyday meaning β€” the trap. Tap to flip it to what it actually means in statistics. This is doubly hard if English isn't your first language: you're decoding the language and the jargon at once. Not scored β€” it is here to loosen you up before the quiz.

Tap each word to flip it
0 of 6 flipped
Self-check Β· not graded

Ten questions on this week

One attempt per question, every answer explained. Your score syncs to your instructor's dashboard as a self-check but does not count toward your grade β€” the final exam tests exactly this style of thinking, on paper, with numbers.

β€”

Where this goes next

In Week 2 you go back to step one and do it properly: picture the cloud, find its centre, measure its spread by hand, and locate any single price inside it. Do the Week 1 homework first: it makes you compute by hand what the widgets computed for you.

Section 1.9 Β· Workshop

Open the pizzeria file

The course exercise

One pizzeria, the whole semester

Every week ends here: a few questions that make you apply the week's ideas to your pizzeria, in your own words. Everything saves automatically and reaches your instructor's dashboard β€” no "submit" button, just type. By Week 16 these pages are the file you would take to a bank.

πŸ“Ž This is the seed of the individual project (20%). Nothing here is graded on its own; it is the material the project grows out of.

Week 1 Β· four questions
1.The price you locked in on instinct in section 1.1 β€” copied here so it is on the record. Change it only if you have changed your mind.
2.Define the population you are actually reasoning about when you set a price. Be precise: which pizzerias count, and which don't?
3.How would you sample it in one afternoon β€” and what bias do you fear most in the sample you can actually reach? Remember: a bigger sample cures luck, never bias.
4.Name one two-column question you would genuinely want answered about your pizzeria this term β€” and say which tool it needs, regression or chi-square, and why.
The map of the semester

Every week is a real decision for your Geneva pizzeria.

We keep one running business and let its decisions pull in exactly the statistics each one needs. A handful of questions carry all the classical topics.

Unlike some subjects, the topics are tightly stacked. A shaky grasp of distributions silently breaks confidence intervals three weeks later, with no obvious symptom. This is the real reason students feel lost in Week 8 β€” the crack was in Week 3. It's hard for structural reasons β€” not because you're "not a maths person."

Warm up your intuition now

These standalone playgrounds already live in your toolkit β€” each one drills a step you just walked:

Fill in all four fields to complete this section.