Today I Learned

Some of the things I've learned every day since Oct 10, 2016

7: Simulating a Fair Coin Toss

Given an ‘unfair’ coin where P \textrm{(heads)} = p \neq .5, we can still use this coin to simulate a fair coin toss.

How?

In order to simulate a fair coin toss, we just need 2 events which are mutually exclusive and equally probable. Examining the probability of different outcomes when flipping our coin twice, we see that

P(\textrm{heads, heads}) = p^2

P(\textrm{heads, tails}) = p(1-p)

P(\textrm{tails, heads}) = (1-p)p

P(\textrm{tails, tails}) = (1-p)^2

and notice that P(\textrm{heads, tails}) = P(\textrm{tails, heads}). These 2 events are both equally likely and mutually exclusive, so they are exactly what we need to simulate a fair coin toss.

For example, our simulation could go as follows: We repeatedly flip the coin 2 times consecutively until we get a pair of results which are different, ignoring pairs which are the same. If the second result is a heads, we consider it to be as a heads from a fair coin toss, and likewise for tails.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: