DiceDecide

Binary Sequence Randomness Check

Be the first to rate this page.

Inspect bit balance and runs in a pasted 0/1 sequence without uploading it.

Balance and run result

Two summaries of one observed bit string

This checker reports a count and a transition count; it does not generate a score for the device that produced the bits. For a string of length N, the balance statistic is z = (ones − N/2) ÷ √(N/4). That formula assumes independent bits with probability 1/2 for each value. The run total counts each maximal block once, so 001110 contains three runs: 00, 111, and 0. Neither summary includes timestamps, sampling method, or a test of cryptographic security.

Worked sample: 100 bits with 62 ones

With N = 100, a fair-reference count is 50 and the reference standard deviation is √25 = 5. A count of 62 therefore gives z = (62 − 50) ÷ 5 = 2.40. On the page's two-sided 5% reference line, |z| above 1.96 is marked unusual. That label means this count would be relatively uncommon under the stated model; it does not identify a cause. In 100 independently fair samples, about five can cross such a line by chance.

Why the run number adds a different clue

Consider 50 zeros followed by 50 ones. It has exactly 50 ones, yet only two runs. The alternating sequence 0101… of the same length also has 50 ones, but it has 100 runs. Balance cannot distinguish those two patterns. For a fair independent sequence with a roughly even count, the expected run total is near N/2 + 1, or about 51 for 100 bits. This page displays the raw total rather than claiming a formal runs-test p-value, because that test also depends on the observed proportions and a stated procedure.

Read the minimum length correctly

The form accepts 20 to 100,000 digits and ignores spaces, so a classroom string such as 0100 1101 0110 can be pasted without changing it. Twenty observations are enough to illustrate counting, not enough to certify a source. A difference of four extra ones yields z ≈ 1.79 at N = 20 but only z ≈ 0.25 at N = 1,000. Raw differences cannot be compared without their sample sizes.

What a clean-looking result leaves unanswered

A deterministic sequence can be arranged to have 50 ones and a plausible run total. A fair sequence can contain a long streak. Repeatedly deleting bits or extending a sample until the display looks reassuring is selection bias: the result no longer describes the originally collected sample. Keep the exact string, its length, and how it was obtained. Security tokens, gambling equipment, and scientific instruments require broader predefined test suites and controlled collection; this compact screen has no basis for approving them.

Useful wording for an observation

Say “548 ones, 452 zeros, and 503 runs in this 1,000-bit sample” rather than “the generator is random.” The first claim can be reproduced from the text entered here. The second is a conclusion about a source that two descriptive measurements cannot establish. That distinction is the practical boundary of this checker.

Calculate the displayed default without a black box

The prefilled string has 63 digits. Counting its 33 ones leaves 30 zeros. Its balance score is therefore (33 − 31.5) ÷ sqrt(15.75), about 0.38, which is comfortably inside the page’s 1.96 reference line. Reading adjacent digits gives 39 runs. Those two results describe this one pasted sequence; they are not probabilities that the next digit will be one. A reader who changes one digit must recount both the total and the transitions, because a middle change can split one run into three or merge neighbouring runs.

A count threshold is not a discovery machine

The 1.96 cutoff is a conventional two-sided reference for a single balance check. If twenty independent fair samples are inspected, the chance that at least one crosses a five-percent line is much larger than five percent. Choosing the most extreme substring after looking at the data creates the same problem. NIST’s statistical-test guidance treats tests as evidence with an interpretation procedure, not as a certificate for a generator. This small screen deliberately reports the descriptive ingredients instead of pretending to run that procedure.

Runs depend on order, not merely on the margin

For a sequence with n1 ones and n0 zeros, a standard binary runs calculation uses expected runs 2n1n0/(n1+n0)+1 when its assumptions are suitable. With 33 ones and 30 zeros, that reference is about 32.43; the default’s 39 is a count to investigate, not a verdict. A transmission that alternates because of a clock, or a batch that contains long device states, can have a striking run pattern even when its overall balance is close to half. Conversely, a short fair sample can look lumpy without any defect.

Collect before testing when the source matters

Write down the start and stop rule before recording bits: for example, the first 1,000 outputs after a device starts. Do not discard a prefix, remove a streak, or stop only once the display becomes reassuring. For a classroom exercise, the entered text and the two summaries are enough to discuss sampling variation. For cryptographic keys, regulated draws, or hardware validation, retain collection conditions and use a documented test suite designed for that purpose. This page has neither access to the source nor a chain of custody.

Enter your values, review the result, then use it with confidence.

Rate this page

Be the first to rate this page.