| Metric | Value | Copy |
|---|---|---|
| {{ row.label }} | {{ row.display }} |
A coin toss is one of the simplest chance events: two outcomes, a quick result, and just enough uncertainty to settle a tie or illustrate probability in a familiar way. This package turns that idea into a tracked run, showing the latest face while also recording the full sequence of flips.
That matters when the result needs to be visible rather than fleeting. A one-off tiebreaker only needs the current face, but a classroom demo, game night dispute, or probability exercise benefits from running counts, percentages, a streak readout, and a distribution chart that updates as the session grows.
The default behavior stays close to an ordinary fair-coin example, but the advanced panel broadens the use case. You can bias the chance toward heads or tails, switch from system randomness to a seeded deterministic sequence, run a large batch without animation, and add optional reveal cues for heads.
Those extra controls make the tool more useful for repeatable demonstrations, yet they also create the main interpretation risk. A lopsided short run does not prove the coin model is skewed, and a repeated seeded run only restarts from the beginning when the generator itself is reset, not merely when the visible history is cleared.
It also helps to keep the scope straight. This is a browser-based simulator for simple decisions and probability demonstrations, not a fairness tester for physical coins and not a cryptographic randomness service.
For a plain tiebreaker, leave Bias toward Heads (%) at 0, keep RNG mode on System RNG, and use the newest face only. The counts and chart are still recorded, but they should not outweigh the immediate Heads or Tails result when the goal is simply to decide.
The most common overread is treating a streak as evidence of a trend. A streak is just the length of the current run of identical faces, so treat it as a description of what happened recently, not as a promise about what comes next.
At its core, the package models a coin toss as a two-outcome trial with a configurable probability of heads. In the neutral setting, heads and tails each start with a 0.5 chance in the long run, which is the familiar textbook fair-coin assumption. Moving the bias control changes that probability before every draw, so the tool can act like a weighted coin without changing any of the downstream counting logic.
Each resolved flip is stored as a boolean in flip_history. From that history, the package derives Total flips, the heads and tails counts, the one-decimal percentages, and Current streak, which is computed by walking backward from the most recent face until the run breaks.
Randomness comes from one of two sources. System RNG uses the browser's ordinary random number source. Seeded RNG hashes the seed string into a 32-bit state and then advances a deterministic pseudo-random sequence, which is why the same seed can reproduce the same run when the generator is restarted.
The package also distinguishes between visual behavior and statistical behavior. Animation duration, spin turns, tilt, and reduced-motion handling affect how the flip is revealed, but they do not alter the stored result. Optional vibration and beep cues only fire when Celebrate Heads is enabled and the resolved face is heads.
The bias slider is converted into a heads probability, then clamped into the valid probability range from 0 to 1. A generated draw less than that configured probability becomes heads; everything else becomes tails.
| Symbol | Meaning | Maps to |
|---|---|---|
| b | Bias offset in percentage points toward heads | Bias toward Heads (%) |
| pH | Configured probability of heads after clamping | pHeadsConfigured in JSON |
| u | Generated draw in the half-open interval [0, 1) | System or seeded random generator |
A bias of 0 leaves the model at 0.5. A bias of +30 moves the heads chance to 0.65, while +100 and -100 clamp the model to all-heads or all-tails behavior.
The percentages are simple run summaries rather than predictions. If a session has H heads across N recorded flips, the package reports Heads % = 100 x H / N and rounds the display to one decimal place. The donut chart uses the same counts, so chart and metrics should agree unless the run was reset or changed mid-session.
Startup and reset behavior matter when you compare runs. The page performs a flip on load so the result area is immediately populated. Reset clears the existing history, sets the current face back to neutral, and then performs one fresh flip right away, which means a reset session begins with a new first recorded result rather than an empty state.
Batch mode is deterministic about count handling. Auto-flip xN is floored to an integer, clamped into the range from 1 to 5000, and resolved without animation. That makes it practical for quick sampling, but the run is still just one realization of the configured probability model.
If you want to compare two sessions fairly, keep the bias, RNG mode, seed, and starting history conditions aligned. Changing any one of those changes the meaning of the comparison. In particular, seeded replay depends on the generator state, so clearing the visible history without also resetting the seed path does not reproduce the original first flips.
| Surface | What it shows | Best use |
|---|---|---|
| Flip Metrics | Counts, percentages, current streak, RNG mode, and bias | Checking a run summary at a glance |
| Flip Distribution | Heads-versus-tails share as a donut chart | Spotting whether the split matches the counts |
| History | Reverse chronological list of recorded flips | Auditing the order of outcomes |
| JSON | Inputs, derived statistics, and the full history array | Documenting or replaying a setup |
Use the quick branch when you only need a decision. Use the controlled branch when you want repeatability, bias, or a larger sample.
For a decision, the most important output is the latest face in the summary area. For an experiment, read Total flips, Heads %, Tails %, and Current streak together, because none of them means much in isolation.
The main false-confidence trap is reading a dramatic short run as proof that something deeper is happening. The corrective check is simple: confirm the settings first, then look at whether the chart, metrics, and history all describe the same session.
Set RNG mode to Seeded RNG, enter class-demo as the Seed, keep Bias toward Heads (%) at 0, and press Reset. The new first recorded result is Heads, Total flips becomes 1, and History contains one heads entry. That gives you a visible, repeatable tiebreaker state you can explain afterward.
Set Bias toward Heads (%) to +100, enter 8 in Auto-flip xN, and run the batch. The package records Heads = 8, Tails = 0, and Heads % = 100.0, while the donut chart collapses to a single heads slice. That outcome is useful for teaching what the bias clamp does, but it no longer represents an ordinary coin model.
Use Seeded RNG with the seed lab-1 and flip five times. History ends with Heads, Heads, Heads, Tails, Heads. If you then press Reset and run five more flips without changing the seed path, the next five results are Heads, Heads, Heads, Tails, Tails rather than a replay of the original first five. The correction is to change Seed or toggle RNG mode before the rerun so the deterministic generator starts from its initial state again.
The package performs one flip on load so the summary area, counts, and tabs are populated immediately. If you want to start a new session from your own settings, change them first and then use Reset.
No. Reset clears the old history and immediately performs a new flip. That is useful for starting a fresh run quickly, but it means the tool returns to a one-result state rather than a blank log.
Because fair does not mean alternating. With Bias toward Heads (%) = 0, streaks are still normal in short runs. Check Total flips before deciding that the session is skewed.
They are heads-only cues. The package only triggers vibration or sound when Celebrate Heads is enabled and the resolved face is heads, and device support still depends on the browser and hardware.
That is not the right fit. The package offers ordinary browser randomness and a deterministic seeded generator for repeatable demonstrations, not a security-oriented random service.