Introduction:
Coin flips are binary random events that model a simple yes or no outcome and they are a familiar way to make transparent choices and teach chance. Use an even chance or set a known bias to explore how proportions behave as the number of trials grows.
You choose whether the generator uses the system source or a seeded mode and you can keep the animated flip or resolve results instantly. Counts, percentages, and the current streak appear so you can see natural swings settle as more trials are added.
Provide an optional seed to make the sequence repeatable across runs and then try a burst of flips to watch the share of heads move toward the configured chance. When needed you can copy a quick summary or download the full run to share how a decision was made.
A simple first run sets the bias to zero and flips 100 times so heads will be close to half but not exact. Expect short streaks and a few surprises and avoid strong conclusions from very small samples.
If cues help, enable a short sound or device vibration on heads when supported. Some devices mute sound until the first user action so run one manual flip before using bulk runs.
A streak does not change the chance on the next flip and changing the bias affects only flips that happen after the change.
Technical Details:
The phenomenon is a Bernoulli trial with two outcomes, heads or tails, observed per flip over a number of independent trials. The key quantity is the probability of heads, denoted once as an abbreviation to keep formulas short.
The computation maps a user bias into a probability and then draws each flip independently from that probability. The mapping is linear so small positive bias favors heads and small negative bias favors tails by the same margin.
Results are read as counts, proportions, and streak length. Percentages are rounded to one decimal place so values near fifty may appear as 49.9 or 50.1 in normal runs.
Comparisons across runs are meaningful when the bias and generator mode stay fixed and the seed is unchanged in seeded mode. Sampling is with replacement so the chance of heads is constant from flip to flip unless the bias changes.
Symbols and units
| Symbol |
Meaning |
Unit/Datatype |
Source |
| pH |
Probability of heads after bias mapping |
0 to 1 |
Derived |
| x |
Bias toward heads |
percent |
Input |
| N |
Number of flips |
integer |
Input |
| H |
Heads count |
integer |
Derived |
| T |
Tails count |
integer |
Derived |
Worked example
Expected values guide intuition; single runs vary naturally.
Randomness, seeds, and reproducibility
- System mode draws from the platform generator. Seeded mode uses a small 32‑bit pseudo‑random generator seeded from a mixed 32‑bit hash of the seed string.
- Identical seed and settings produce the same sequence. Changing the bias changes future flips only.
- Sampling is with replacement and outcomes are independent under fixed settings.
Units, precision, and rounding
- Percentages display with one decimal place using a dot as the decimal separator.
- Head and tail counts are integers; the streak is the current run length by face.
Validation & bounds extracted from code
Inputs and constraints
| Field |
Type |
Min |
Max |
Step/Pattern |
Error Text |
| Bias toward Heads (%) | number | -100 | 100 | step 1 | — |
| RNG mode | enum | — | — | system | seeded | — |
| Seed | text | — | — | any string (trimmed) | — |
| Animation time (ms) | number | 0 (UI) / 80 applied | — | step 10 | — |
| Disable animation | boolean | — | — | toggle | — |
| Spin turns | number | 1 | 10 | step 1 | — |
| 3D tilt (°) | number | 0 | 30 | step 1 | — |
| Celebrate Heads | boolean | — | — | toggle | — |
| Vibrate on reveal | boolean | — | — | toggle | — |
| Beep volume (%) | range | 0 | 100 | step 1 | — |
| Beep frequency (Hz) | number | 100 | — | step 1 | — |
| Beep duration (ms) | number | 20 | — | step 10 | — |
| Auto‑flip ×N | number | 0 (UI) / 1 applied | 5000 applied | step 1 | — |
Audio and vibration triggers only when the celebration switch is on and the result is heads.
I/O formats
Inputs and outputs
| Input |
Accepted Families |
Output |
Encoding/Precision |
Rounding |
| Bias, RNG mode, seed, visual and cue options, run length | numbers; text; toggles | Counts, percentages, streak | percent to 0.1; integers | nearest tenth |
| — | — | Summary export | CSV | as displayed |
| — | — | Full run data | JSON | exact values |
Performance & complexity
- Flips run in linear time with N; charts redraw on updates.
- Bulk runs yield briefly every 100 flips to keep the interface responsive.
- Bulk flips are capped at 5000 per request for practical performance.
Networking & storage behavior
- Processing happens on the device; generated files and clipboard copies occur locally.
- A charting layer may be loaded once to render the donut visualization.
Diagnostics & determinism
- Seeded mode with the same seed and settings reproduces the same sequence.
- System mode does not guarantee repeatability across sessions.
Security considerations
- Inputs are numeric or plain text; outputs avoid executing untrusted content.
- Audio and vibration use standard device APIs and require user interaction on some systems.
Assumptions & limitations
- Percentages from small samples are noisy and may look uneven.
- Seeded mode repeats only when the same seed and parameters are used.
- Changing settings affects only future flips, not past results.
- Heads‑up Audio can be blocked until a user gesture occurs.
- Vibration support varies by device and may be ignored.
- Bias mapping is linear by design and does not model physical coins.
- Animation timing below 80 ms is clamped unless animation is disabled.
- Charts require the visual layer to be available; if unavailable, stats still compute.
Edge cases & error sources
- Extremes at −100% or 100% bias force all outcomes to one face.
- Very small N produces wide swings from the expected proportion.
- Percentages round to one decimal which can mask tiny differences.
- Animation time set below 80 ms still resolves at 80 ms.
- Beep frequency below 100 Hz or duration below 20 ms is clamped.
- Volume outside 0 to 100 is clamped to the nearest bound.
- Some devices ignore vibration requests or require permission.
- Switching RNG mode mid‑run changes the generator characteristics.
- Trimming removes leading and trailing spaces from the seed string.
- Bulk runs stop at 5000 flips per request by design.
Privacy & compliance
Processing occurs on the device and no data is transmitted or stored server‑side. Outcomes are purely random and have no monetary value.
Step‑by‑Step Guide:
Coin flips estimate proportions and produce an auditable record of results.
- Choose fairness: set Bias to 0 for an even chance or tilt it for experiments.
- Select generator: keep System or choose Seeded and enter a Seed for reproducibility.
- Decide pace: keep animation, shorten it, or use Disable animation for instant results.
- Flip once with the main button or set Auto‑flip ×N and run a batch.
- Review Stats, scan History, and export the JSON payload when you need a full trace.
Example: Bias 0, Seeded with seed “demo‑seed”, Auto‑flip 200. Expect heads near 100 with normal variation.
- Tip: enable the heads cue only after one manual flip to ensure audio is allowed.
You now have a clear proportion and a record you can share.
FAQ:
Is my data stored?
No. Flips, summaries, and downloads are produced on the device and are not sent to a server.
Clipboard and files are created locally.
How accurate is the generator?
With bias 0 the long‑run proportion approaches fifty percent. Short runs vary and seeded mode ensures the same sequence only when the seed and settings match.
Independence holds under fixed settings.
What does a “borderline” result mean?
Values near fifty percent are normal. A slight lean one way in small samples is expected and does not imply a lasting trend.
Add trials to reduce noise.
How do I reproduce a run?
Switch to seeded mode, set the same seed, keep all other settings identical, and run again. The sequence will match exactly.
Even a small change breaks reproducibility.
Why is there no sound?
Some systems block audio until a user action. Do one manual flip, then enable the heads cue with a nonzero volume.
Vibration also depends on device support.
What formats can I save?
Save a compact summary as CSV or the full inputs, stats, and history as JSON. Both reflect the current session state.
Numbers use a dot decimal.
Can I run thousands of flips?
Yes. Bulk runs are capped at 5000 per request and are executed without animation for speed.
Multiple batches can be run sequentially.
Does the tilt or spin affect fairness?
No. Visual settings change only the animation. Probability is controlled solely by the bias value.
Disable animation for instant results.
What does RNG mode do?
System mode uses the platform source and seeded mode uses a deterministic generator. Seeded runs repeat when the seed and settings match.
Pick seeded mode for teaching repeatability.
Troubleshooting:
- No chart visible — perform one flip to initialize the visualization.
- Percentages look off — increase the number of flips and watch the proportion stabilize.
- Audio silent — run one manual flip, raise volume above zero, and ensure the celebration switch is on.
- Vibration missing — verify device support and try a shorter duration first.
- Runs feel slow — disable animation or use bulk runs.
- Reproducibility failed — confirm RNG mode, bias, seed, and flip count match exactly.
If bulk runs stop early, reduce the requested count and run multiple batches.
Advanced Tips:
- Tip Use seeded mode to build teaching slides with identical runs each time.
- Tip Try small positive and negative biases of equal size to compare symmetry.
- Tip Keep animation on for engagement, then turn it off for large trials.
- Tip Track the streak value as a classroom prompt about randomness and clustering.
- Tip Use JSON exports to compare different seeds and biases later.
- Tip For demonstrations, set a short animation time rather than disabling it entirely.
Glossary:
- Bernoulli trial
- A single experiment with two outcomes, success or failure.
- Probability of heads
- Chance that a flip yields heads after applying the bias.
- Bias percent
- User control that shifts the chance toward heads or tails.
- Seed
- Text used to initialize a deterministic generator.
- Streak
- Number of consecutive flips showing the same face.
- Sampling with replacement
- Each trial is independent and does not change the chance.