CalcWorldHub
Free online calculator · no signup

Wald Wolfowitz binary runs test calculator

Check an ordered binary sequence for unusually few or many runs compared with random ordering at its observed state counts.

4,000 tools
Wald Wolfowitz binary runs test calculator — Ordered zero-one sequence and calculation method
Wald Wolfowitz binary runs test calculator: inputs and calculation method.

How to use this calculator

Check an ordered binary sequence for unusually few or many runs compared with random ordering at its observed state counts.

  1. Enter Ordered zero-one sequence. Match the units shown beside each field and review the result together with the assumptions below.
  2. Read the worked example below to check the expected input format and result.
  3. Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Calculation guide

Wald Wolfowitz binary runs test explained

This guide follows wald wolfowitz binary runs test calculator from its stated formula through a worked example, then identifies the assumptions that bound the result.

Observed runs9
Observed runs: 9 in the worked scenario.

How the calculation works

E(R)=1+2n0n1/N; Var(R)=2n0n1(2n0n1−N)/[N²(N−1)]; z=(R−E(R))/√Var(R).

A run is a maximal block of equal states. The calculation conditions on the counts of zeros and ones and compares their observed ordering with a random arrangement. No continuity correction is applied to the reported normal z statistic.

Set up the calculation

x — Ordered zero-one sequence
Original time or acquisition order encoded as zeros and ones. Do not sort it before entry. Use comma-separated values in the stated order.

Limits of this model

Both states must occur; 3–2,000 observations. The p-value is a normal approximation and may be poor when either state count is small. This is not a general proof of randomness.

Check this example

Ordered zero-one sequence = 0,0,0,1,1,0,1,1,1,0,0,1,0,1,1,0.

  • Observed runs: 9
  • Expected runs: 9
  • Uncorrected normal z: 0
  • Approximate two-sided p-value: 1

The example starts with a block of three zeros and then two ones, which already make two runs. Each later change of state adds one more run.

Reading the outputs

Few runs suggest clustering and many suggest alternation. The two-sided reference p-value treats either departure as evidence against random ordering.

Frequently asked questions

Should I sort the sequence first?

No. Sorting destroys the order this test is designed to assess.

Can a balanced 50/50 sequence fail?

Yes. State proportions and ordering are different properties.

Does a nonsignificant result certify a random generator?

No. Many nonrandom patterns are not detected by a binary runs statistic.

How do I use the Wald Wolfowitz binary runs test calculator?

Enter Ordered zero-one sequence. Match the units shown beside each field and review the result together with the assumptions below.

What is a worked example of Wald Wolfowitz binary runs test?

Ordered zero-one sequence = 0,0,0,1,1,0,1,1,1,0,0,1,0,1,1,0. Observed runs: 9 Expected runs: 9 Uncorrected normal z: 0 Approximate two-sided p-value: 1 The example starts with a block of three zeros and then two ones, which already make two runs. Each later change of state adds one more run.