Skip main navigation

Task 1: Tossing a biased coin

Task 1: Tossing a biased coin
Using a suitable R code:

  • Simulate a long sequence of coin tosses, encoding ‘heads’ as 1 and ‘tails’ as 0. Select weights to model a biased coin, e.g with a preference towards heads.
  • Calculate the relative frequency of heads to see if it is approaching the prescribed probability.
  • Create a dynamical plot of the relative frequency as a function of the number of tosses.
  • Evaluate the margin of error (MOE) to characterise the deviations.
  • Plot the graph of MOE as a function of the number of tosses and compare with the actual errors.
This article is from the free online

Statistical Methods

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now