Ask
23
@runs_test_rana ·

Given two sequences of 200 coin flips, one real and one made up by a person, how do you tell which is which?

A colleague set this as a puzzle: two strings of H and T, 200 each. One came from actual flips, one a student invented while trying to look random. Work out which is which and be able to justify it.

I know the counts of heads should be roughly binomial, so both sequences having near 100 heads tells me nothing — anyone faking it gets that part right. My instinct is that run lengths are where people give themselves away, but I do not know what the honest comparison is or how confident I am allowed to be.

What is the actual test here, and how strong is the evidence in practice?

4 answers Share
Report

Answering anonymously — a moderator will review it first.

  • @bootstrap_bo · 5d ago

    Your instinct is right and the effect is enormous. Look at the longest run.

    In 200 genuine flips the longest run of one face is typically 7 or 8, and a run of 6 is almost certain to appear somewhere. People inventing sequences essentially never write a run that long — they get uncomfortable at 4 and it feels wrong by 5, because a long run does not look random to a human even though it is exactly what randomness produces.

    So the single most discriminating statistic is: what is the longest run in each sequence? If one has a maximum run of 4 and the other has a run of 8, you are done, and you can say so with high confidence.

    The closely related giveaway is the alternation rate — the fraction of adjacent pairs that differ. It should be about 0.5. Fabricated sequences typically land around 0.6, because switching feels like what randomness does.

    27
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @residual_ruth · 5d ago

    If you want something you can put a number on rather than an eyeballed comparison, count the runs and use the fact that the total number of runs has a known distribution.

    With n flips split roughly evenly, the expected number of runs is about n/2 + 1, so around 101 for 200 flips, with a standard deviation of about 7. A fabricated sequence with too much alternation will show up as too many runs — 120 or more is roughly three standard deviations out and effectively settles it.

    That gives you the justification your colleague asked for: not "this one looks faked" but "this sequence has 124 runs where 101 ± 7 is expected, and the other has 98".

    22
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @prior_priya · 7d ago

    One caution on how confident to be, since you asked.

    Each of these statistics is a single number and any one of them can land in an unlucky place. A real sequence occasionally has a short maximum run; a thoughtful faker who has read about this will deliberately insert a run of 7.

    The robust approach is to check several independent-ish features and see whether they agree:

    • longest run
    • number of runs / alternation rate
    • distribution of run lengths, which should be roughly geometric — about half the runs of length 1, a quarter of length 2, and so on
    • counts of the four adjacent pairs HH, HT, TH, TT, which should be about equal

    A genuine sequence passes all of them by construction. A fabricated one usually fails two or three, because the underlying bias — an aversion to repetition — shows up in every one of these views at once. If the two sequences disagree on only a single statistic, be honest that the evidence is weaker.

    18
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @dice_deniz · 6d ago

    Easiest way to build the intuition before you test anything: write out 200 flips yourself, by hand, trying to look random. Then flip an actual coin 200 times.

    Compare the two and the aversion is unmistakable in your own handwriting. You will find you almost never wrote five in a row, and the real coin did it twice.

    This is also the version of the exercise that convinces a room, which I assume is why your colleague set it.

    13
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report