liveBook · Manning

Coin toss

As explained in Statistics Slam Dunk

A coin flip is a binary random experiment with two possible outcomes, conventionally called heads and tails.

A coin toss is a binary random experiment with two possible outcomes: heads or tails. A fair coin gives each outcome probability 0.5, and each toss is independent of the previous one. In R, represent heads and tails as 0 and 1, then simulate repeated tosses with sampling replacement. section 16.3

sample(x = c(0, 1), size = 10, prob = c(0.5, 0.5), replace = TRUE)
##  [1] 0 1 1 1 1 1 1 0 1 0

Simulate ten fair coin tosses with base R's sample() function; each run can return a different sequence of zeros and ones. section 16.3

A useful coin-toss simulation follows four decisions:

  • Choose the possible outcomes with x = c(0, 1), representing heads and tails. section 16.3
  • Set size to the number of tosses, such as 10 for a short demonstration or 700 for a longer streak experiment. section 16.3 section 16.4.1
  • Set prob = c(0.5, 0.5) for a fair coin rather than a weighted coin. section 16.3
  • Set replace = TRUE so every toss remains an independent trial with the same probabilities. section 16.3

Long streaks do not prove a hot hand

A simulation of 700 fair coin tosses produced a maximum run of 11 tails. That result was comparable to Giannis Antetokounmpo's best free-throw streak, illustrating how random independent outcomes can create striking streaks without a persistent causal effect. The comparison supported treating his free-throw results as more coin-like than evidence of a hot hand. section 16.4.1 section 16.6

How Statistics Slam Dunk covers it

How deep it goes
Explains binary outcomes, fair probabilities, independent sampling, and streak simulation, but stops short of formal probability proofs.
Examples
Demonstrates ten simulated tosses, a 700-toss streak, and a comparison with Giannis Antetokounmpo's free-throw sequences.
What you can do after
Apply it via base R to simulate fair binary trials and evaluate whether observed streaks exceed what randomness can produce.
How it connects
Connects coin tosses to Bernoulli trials, binomial trials, streaks, regression to the mean, and the hot-hand fallacy.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Slam Dunk. The section links point to the parts of the book it draws on.