### How to Play Fair with an Unfair Coin

Recently, I picked up John Barrow's One Hundred Essential Things You Didn't Know You Didn't Know: Math Explains Your World at the library. It's a nice little book of (usually) elementary but very interesting mathematics and statistics. Each little tidbit is about a page or two long, so it's an easy book to just pick a random page in and read.

One of his examples details how to even the odds with a coin, no matter unfair it may be. The only requirement is that it is consistently unfair.

On first glance, this may seem impossible, but it is actually trivial to prove.

Let p be the probability of heads for the coin, so that 1-p is the probability of tails. We have no idea what p is.

What you do is change the "flipping", so that you will flip the coin twice. If H represents getting a "head" on a single flip, and T represents getting tails, we now call the sequence H T "heads", and the sequence T H "tails". If the two flips result in either H H or T T, you ignore it and flip again.

The probability of getting the sequence H T is p (1-p), and the probability of getting the sequence T H is (1-p) p, so that the probability of either sequence is the same. Ergo, it is fair with this definition of "heads" and "tails".

Of course, if the coin is significantly unfair, with p very close to 0 or 1, then it might take a while to see either the sequence H T or T H. For example, it seems to take about 4 seconds to flip the coin, look at it and show it to your opponent. So that's 8 seconds to flip it twice. The chance of seeing neither H T or T H is 1 - 2p(1-p). If p is tiny, say at about 10-6, then the chance of seeing neither is 0.999998, and the probability of seeing neither in N trials is 0.999998N. In this case, there's more than an 85% chance you would see neither in a week of flipping (if my calculations here are right - it's late). It would take 32 days of flipping to have a 50% probability of seeing H T or T H. The point is, just because the game is now fair doesn't mean you should play it, as you might need to have a lot of free time on your hands.
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8525561690330505, "perplexity": 446.72171336514975}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-21/segments/1652662522741.25/warc/CC-MAIN-20220519010618-20220519040618-00650.warc.gz"}