← Back to Blog

Chi-Squared Tests: How to Actually Check if Something Is Random

April 24, 2026  ·  11 min read  ·  Education

ANALYZE THIS GAME YOURSELF

Hot & cold numbers, patterns, and frequency-ranked combinations

Free analytics dashboard with frequency charts, long-gap numbers, and pattern tools — updated after every draw.

If you want to know whether a lottery is random, you don't squint at frequency charts and form an opinion. You run a chi-squared test. The test produces a number that tells you, with formal probability bounds, whether the data is consistent with a random process. State lotteries pass these tests routinely. Most "lottery systems" that claim to detect non-randomness fail elementary tests like this one.

What you'll learn

The intuition

Suppose you flip a coin 1,000 times and get 480 heads, 520 tails. Is the coin fair? You expected 500 of each. The deviation is 20 in either direction. Is 20 a lot or a little?

The chi-squared test answers exactly this question. It compares observed counts to expected counts and produces a single statistic that summarizes how far off the observation is from expectation. Then it tells you the probability that a fair process would produce a deviation that large by chance.

For our coin: the chi-squared statistic for 480/520 is 1.6, well within the range a fair coin produces in 1,000 flips. The "p-value" — the probability of seeing a deviation at least this big from a truly fair coin — is about 0.20. We have no reason to suspect bias.

For a different coin: 600 heads, 400 tails. Chi-squared is 40. The p-value is about 2.5 × 10⁻¹⁰ — essentially zero. We have strong evidence the coin is biased.

The test gives you a principled way to decide which deviations matter and which are sample variance.

The formula

For a frequency table with k categories and N total observations:

χ² = Σ (Oᵢ - Eᵢ)² / Eᵢ

where Oᵢ is the observed count for category i and Eᵢ is the expected count under the null hypothesis (in our case, "the process is uniformly random"). Sum across all k categories.

The result follows a chi-squared distribution with (k-1) degrees of freedom. Look up the p-value in a table or compute it directly. If the p-value is small (typically < 0.05), reject the null. If it's large, the data is consistent with the null.

A worked example with real Pick 3 data

Let's run the test on California Daily 3 midday position-1 frequencies for a hypothetical 365-day window. Suppose we observe these counts for digits 0-9:

DigitObservedExpected(O-E)²/E
03236.50.555
14036.50.336
23836.50.062
33436.50.171
44136.50.555
53536.50.062
63336.50.336
73936.50.171
83736.50.007
93636.50.007

Sum the last column: χ² ≈ 2.26. Degrees of freedom: 10 - 1 = 9.

Looking up the p-value for χ² = 2.26 with 9 df: p ≈ 0.99. There's a 99% chance a fair uniform process would produce a deviation at least this big. The data is overwhelmingly consistent with the null hypothesis of uniform randomness. We cannot reject randomness.

Now suppose we got dramatically different data: digit 7 appears 80 times, others compensate by appearing less. The chi-squared statistic would be much larger, the p-value much smaller, and we'd flag the result as inconsistent with randomness — and an investigation would follow.

What state lottery data actually shows

Run this test on the actual data from any state lottery on this site, over a long enough window, and you'll see results similar to the above: p-values mostly between 0.05 and 0.95, scattered uniformly. That's exactly what randomness produces — uniform p-values across many tests. There is no systematic deviation, no consistent bias, and no exploitable pattern.

Our Is This Normal? tool runs chi-squared and other tests on live state lottery data and shows the results. Spend ten minutes on it and you'll have done more rigorous statistical analysis of state lottery randomness than every "lottery system" seller combined.

Why systems pitches don't survive this

Any "system" that claims an edge implicitly claims the data is not uniformly random — that some digits or combinations have higher true probability than others. That claim is testable. Run a chi-squared on the data the system was trained on, after the fact. Run it on out-of-sample data. Run it on multiple states. The system would predict significant deviations from uniform; the test would flag them or not.

The tests don't flag deviations, because the deviations don't exist. The system's claimed edge is incompatible with the data the system claims to read. Every honest system seller, run through this exercise, would have to either retract the claim or fail to publish the math. Most don't publish the math, which is the meta-signal we already discussed in How to Spot a Lottery "System" Scam.

Limitations of the test

Chi-squared isn't a magic bullet:

The deeper lesson

Hypothesis testing is the right way to evaluate any claim about randomness. The shape of the argument is always: state a null hypothesis ("the process is random / uniform / fair"), measure how far the data deviates from what the null predicts, and compute the probability that the null could have produced a deviation that large.

If the probability is small, you have evidence against the null. If it's not small, you don't. Either way, you've done principled work — not eyeballing, not opinion, not pattern apophenia.

Bring this discipline to any claim about lottery randomness, and most of the noise in this domain falls away. State lotteries pass the tests. "Systems" don't run the tests, because they wouldn't pass either.

Try it yourself

Use our Frequency Analysis page to pull a year of digit frequencies for any Pick 3 game. Compute the chi-squared statistic by hand using the formula above (it's just basic arithmetic — sum (O-E)²/E across all 10 digits). Look up the p-value. You'll get a result like the example above: high p-value, consistent with randomness. You've just done a real randomness audit on real data.

Now imagine doing the same on data from a "system" that claims to spot non-random patterns. The chi-squared would tell you whether the system's claim survives the most basic statistical scrutiny. Spoiler: it doesn't.

Common pitfalls

Further reading

DrawAnalytics is an informational service. We do not sell predictions or guarantee outcomes. Lottery drawings are random — past results do not predict future drawings. Play responsibly. 1-800-GAMBLER.

ANALYZE THIS GAME YOURSELF

Hot & cold numbers, patterns, and frequency-ranked combinations

Free analytics dashboard with frequency charts, long-gap numbers, and pattern tools — updated after every draw.

Explore more with our free analytics tools:

Open Draw Analytics Dashboard →

DrawAnalytics is an informational and entertainment service. We provide historical lottery data analysis and pattern exploration tools. We do not sell predictions, we do not guarantee any outcome, and we make no representation that any tool on this site improves a user's probability of winning any lottery game. Lottery drawings are random. Past results do not predict future drawings. You must be 18 or older (21+ in some states) to play state lottery games. If you or someone you know has a gambling problem, call 1-800-GAMBLER or visit ncpgambling.org.