Random Bernoulli Streak Experiment Generator
Simulate ordered Bernoulli trials and success-streak endpoints using explicit independent success probability; finite observed proportions and streaks do not establish fairness or population probability.
Description
A Bernoulli success streak is a consecutive run of successful binary trials.
A Bernoulli success streak is a consecutive run of successful binary trials.1
This experiment simulates supplied-probability trials and reports the longest run and the positions where success streaks end.
When to use Random Bernoulli Streak Experiment Generator
Use this tool when you need to produce the reproducible draw or model experiment described below. Prepare a reproducible seed and the inventory, corpus, or experiment parameters stated below.
How to use Random Bernoulli Streak Experiment Generator and understand its results
- Prepare a reproducible seed and the inventory, corpus, or experiment parameters stated below.
- Enter seed, count, successProbability, following the field table and calculation rules below, then run the tool.
- Read result. For result objects, inspect the nested output fields below, including any missing evidence or selected indices.
- Correct any input issues and run again. Before using a successful result, review its units, signs, evidence coverage, and stated model or reference assumptions.
| Input field | Meaning | Value type | Requirement |
|---|---|---|---|
| seed | Required nonblank deterministic seed; the SDK can replace the source with context.random. | string | Required |
| count | Number of draws, cards, trials, or output entries under the tool-specific rule; safe integer 1–64 with any narrower inventory bound. | number | Required |
| successProbability | Success probability | number | Required |
Require count from one through sixty-four and successProbability in [0,1]. Each outcome is one when U is strictly less than the probability and zero otherwise. Sum and average outcomes, reset the current run on failure, retain the longest run, and record the zero-based index of every success followed by failure or the end. Probability zero yields all failures; probability one yields all successes.2, 3
Use a nonblank seed of at most 256 UTF-16 units and a safe-integer count from 1 to 64, subject to the tool’s narrower inventory bound. By default the seed is hashed into a deterministic pseudorandom state; each run restarts that state, so identical full inputs and implementation reproduce the result. The SDK may provide context.random, which replaces the seeded source and advances across the request; the seed remains required. Every source value must be finite in [0,1), with a request limit of 100000 source calls. Draw an index as floor(U×remainingSize). For indexed inventory draws, with replacement draw from the full inventory each time; without replacement remove each chosen position from an ordered pool and reject counts exceeding the inventory size. Uniform-source draws are over positions, not necessarily distinct values. This is not secure randomness.
outcome=[U<p]; observedSuccessFraction=successes/count Read these symbols with the field meanings and branch or reference rules above.
| Output field | Meaning | Value type |
|---|---|---|
| result | Composite output; read its nested fields and the worked example. | object |
| result.outcomes | outcomes | list |
| result.successes | successes | number |
| result.observedSuccessFraction | observed Success Fraction | number |
| result.longestSuccessStreak | longest Success Streak | number |
| result.successStreakEndIndices | success Streak End Indices | list |
| result.samplingConvention | sampling Convention | string |
{
"input": {
"seed": "tool.io/batch42",
"count": 1,
"successProbability": 0.5
},
"output": {
"result": {
"outcomes": [
0
],
"successes": 0,
"observedSuccessFraction": 0,
"longestSuccessStreak": 0,
"successStreakEndIndices": [],
"samplingConvention": "independent-Bernoulli-with-replacement"
}
}
} Limitations and assumptions
Observed proportions and streaks describe this finite pseudorandom simulation. They do not estimate fairness of a physical coin or establish an independently measured population probability.
Missing required fields, unknown fields, wrong types, and violated calculation rules return input issues. Numeric values must be finite; nonfinite numeric outputs are rejected. Extremely large composite outputs are rejected.
Alternative or Complementary methods
For a related task, use Random Coin-Toss Experiment Generator: A biased coin model is a sequence of Bernoulli trials with an explicit success probability. This experiment returns the observed sequence and success-run statistics, which need not match the model probability in a finite sample. For a complementary step, use Random Circular Direction Experiment Generator: Circular directions wrap at a full turn, so their mean is based on sine and cosine rather than ordinary arithmetic averaging. This experiment samples planar angles and reports their resultant length and whether a mean direction is numerically resolved.
References
Similar or alternative tools
- Random Coin-Toss Experiment Generator
A biased coin model is a sequence of Bernoulli trials with an explicit success probability. This experiment returns the observed sequence and success-run statistics, which need not match the model probability in a finite sample.
- Random Circular Direction Experiment Generator
Circular directions wrap at a full turn, so their mean is based on sine and cosine rather than ordinary arithmetic averaging. This experiment samples planar angles and reports their resultant length and whether a mean direction is numerically resolved.