Why patterns overlap

Separate a pattern’s chance in one window from the time you wait for it.

One window is not a waiting time

Heads (H) · Tails (T)

For a fair coin, HH and HT each have probability 1/4 in two tosses. But a search keeps going until a pattern first appears. Its windows overlap, so counting them as independent opportunities gives the wrong answer.

HHHT1/41/4P(H) = P(T) = 1/2
Both patterns have chance 1/4 in a fixed two-toss window.

Read the rest as a member

You are reading the opening. Members read every lesson and guide in full. A free account reads the first lesson in each subject in full.

You are reading the opening. Your free account reads the first lesson in each subject in full. Members read every lesson and guide in full.

First lesson in this subject: Count equally likely outcomes

Have an account? Sign in here.

The code lasts ten minutes and works once.