Probabilidade Sequência de Caras
P(pelo menos k caras seguidas em n lançamentos de moeda justa) — DP.
P
—
Longest run of tails in coin tosses
Toss a fair coin n times and ask how likely you are to hit at least one run of k tails in a row. There's no tidy closed form for this, but once n gets large the approximation P ≈ (n − k + 1) · (1/2)^k works well. The longest run you'd expect to see is roughly log₂(n). Take 100 tosses: a streak of 6 or 7 tails is perfectly ordinary and says nothing about a biased coin. Most people picture random sequences as neatly alternating (HTHTHT…), yet genuine randomness clumps together. That's the randomness paradox. Long runs argue for randomness, not against it.
Applications
Researchers use it in studies of perceived randomness. Runs tests like Wald–Wolfowitz flag non-randomness in binary sequences, and the same idea audits random number generators and validates the entropy of passwords and tokens. It also catches fraud in data that's supposed to be random, such as forged coin-toss logs that conveniently lack the long runs you'd expect.
FAQ
If I just got 5 tails, is heads "due"? No. Every toss stands alone, so what came before has zero pull on the next one. Believing otherwise is the gambler's fallacy.
Why log₂(n)? Because each extra tail halves the probability — doubling the number of tosses adds roughly one to the expected longest run.
How accurate is the approximation? For small k it overestimates slightly (overlapping windows are counted), but for k ≥ 4 and n ≥ 50 it is within a few percent of the exact value.
Related Tools
Rent Adjustment Calculator
Compute annual rent adjustment by IGP-M or IPCA accumulated in the last 12 months (manually configurable).
Pregnancy Calculator
Compute estimated due date (EDD), gestational age and trimester from the last menstrual period (LMP).
Fertile Period Calculator
Compute fertile window and ovulation day from the first day of the last cycle and the average cycle length.