R together: is this coin fair?

Everyone in your group edits the same R code. Anyone can press Run; the text output appears for the whole group. R runs in your browser.

Your task
  1. Run the code. How many heads did you get in 100 flips?
  2. Change n to 10, then 10000. What happens to the proportion of heads?
  3. The file flips.csv holds the class's results: each of 20 students flipped coins A, B and C 100 times. Read it with read.csv("flips.csv") and compare the coins with aggregate().
  4. Is one coin unfair? Try binom.test() on its total heads, and draw a boxplot(heads ~ coin, data = flips).
Loading R…
Data file: flips.csv (60 rows)

  

Reflect

In your own words: what does the p-value from binom.test() tell you about coin C, and what doesn't it tell you? Would 20 flips per student have been enough to notice? Why or why not?