Statistics
Distributions, estimation, hypothesis testing
In this chapter, you will learn to
- Summarise a distribution (mean, spread, quantiles)
- Estimate a quantity and its uncertainty from a sample
- Decide whether a difference is real or just chance
Tools: NumPy
10 exercises
Each exercise is graded automatically, in your browser. The full statements are available once you have an account.
What this is for in real life
Every measurement is noisy: statistics tells you what you can conclude from it, and how confident you can be. - A brewery. In the early 1900s, William Gosset, a chemist at Guinness in Dublin, had to judge the…
Las Vegas
On a stopover in Monaco, you push open the doors of the Casino de Monte-Carlo. The dealer offers the simplest game in the room: you roll
ndice at once. Each die hasmfaces numbered 1 tomand earns you as many…The Monte-Carlo jackpot
Flush with excitement from the first game, you move to the next table. Same
ndice withmfaces, same base rules (you win the sum of the dice, playing costscost). But the dealer adds a rule: if the same value…The rigged die
The casino hires you as a detective. Your mission: examine dice and say whether they are rigged or fair. Implement the function
detect(lancers)which takes an array of rolls (values 1 to 6) and returns"truque"or…The bettor
You discover the casino's secret room: machines whose every draw follows a stable but unknown distribution. Each round, you are shown a history of past draws, then you bet on an interval where the…
Dispersion
Two cities have the same average temperature (15°C). But one is placid (14, 15, 16) and the other extreme (−5, 15, 35). The mean, on its own, says nothing about this difference. Invent a single number that…
The more you measure, the surer you are
A thermometer is noisy: each measurement deviates from the true temperature by random noise with standard deviation
sigma. To estimate the temperature, you take the mean ofnmeasurements. Intuitively, the more…The suspicious dice
Your exploits at the tables are the talk of Monaco. A manufacturer that supplies the dice for the Casino de Monte-Carlo hires you as a quality controller. With each delivery, the workshop sends you a batch of dice…
The thermometer's precision
Still in the workshop, your foundryman friend shows you the step before: the dice are cast in a furnace whose consistency depends on the temperature. But the thermometer is imprecise: each measurement differs a little.…
The relationship detector
You are given two series of measurements
xandy. Are these two variables related, or completely independent? Implementdetect_link(x, y)which returns a score between -1 and 1: - +1: when x increases…