Choosing who goes first in a game
- Input
- cara = jogador A, coroa = jogador B
- Expected output
- coroa
Each player has a 50% chance of going first, with no bias toward whoever calls it; which face they pick does not affect the outcome.
coin flip for decisions
A coin flip settles ties because each outcome carries exactly a 50% chance and neither side remembers the previous flip, so it works both for choosing who goes first in a game and for unsticking a decision where both options look equally good.
Each player has a 50% chance of going first, with no bias toward whoever calls it; which face they pick does not affect the outcome.
The whole sequence has a 1 in 32 chance before it starts, but the sixth flip is still a coin flip at 50/50, because the coin keeps no memory of the previous five.
The standard deviation of the square root of n×p×(1−p) shows that 45 or 55 heads out of 100 flips is entirely normal; only a count outside 3 standard deviations (below 35 or above 65) is worth suspecting the coin over.
Yes. The result is generated by `crypto.getRandomValues()`, which uses a cryptographically secure pseudorandom number generator (CSPRNG) from the operating system. The probability of heads or tails is exactly 50%.
Yes, when the implementation uses `crypto.getRandomValues`, as this tool does, because that browser API draws entropy from the operating system instead of a predictable pseudorandom algorithm.
No. That idea is the gambler fallacy: the coin has no memory, so the fifth flip is still 50% heads and 50% tails, exactly like the first.
0.5 cubed, which is 1 in 8 (12.5%). Each additional flip in the streak multiplies the chance by 0.5.
It works well when both options are already equivalent and the goal is just to unstick the choice; for decisions where the options carry unequal consequences, the coin does not weigh factors, it only picks between them.
Press Space or click to flip