Proof and Reasoning

Why Checking a Million Cases Is Not a Proof

Real patterns that hold for dozens, millions or more cases and then fail, plus the situations where checking cases really does prove a claim.

Key takeaways

  • A claim about infinitely many objects cannot be settled by testing finitely many of them, however large the number.
  • Several natural patterns fail only after dozens, millions or vastly more successful cases.
  • One counterexample is enough to disprove a universal claim.
  • Testing proves a claim only when reasoning shows that the tested cases are all the cases there are.
  • Large searches are valuable evidence: they guide conjectures, catch false ones and build justified confidence short of proof.

Checking a million cases is not a proof because a statement about all whole numbers covers infinitely many cases, and a million of them leave infinitely many untouched. Nothing in the checked cases forces the next one to behave the same way.

This is more than a technicality. Mathematics has real examples of patterns that hold for a long stretch and then break. Seeing a few of them changes how you read any claim that says "it has worked every time so far".

A formula that makes primes, until it does not

Take the expression n² + n + 41 and feed in n = 0, 1, 2, 3 and so on. You get 41, 43, 47, 53, 61, and every one is prime, meaning it has no positive divisors except 1 and itself.

The run continues for forty values, from n = 0 through n = 39. Then comes n = 40.

40² + 40 + 41 = 40(40 + 1) + 41
             = 40 × 41 + 41
             = 41 × 41
             = 1681          not prime

After the fact, the failure is easy to see. You might have predicted that n = 41 would break it, since every term is then divisible by 41. The break at 40 arrives one step earlier.

Someone who tested thirty values and declared the formula proved would have been wrong, and none of those thirty tests would have contained a warning.

Dots on a circle

Mark points on a circle and join every pair with a straight chord. Place the points so that no three chords cross at a single point inside. Now count the regions inside the circle.

Points 1 2 3 4 5 6
Regions 1 2 4 8 16 31

The first five values double each time, so 32 looks certain. The sixth is 31.

The correct count for n points is C(n, 4) + C(n, 2) + 1, where C(n, k) is the number of ways to choose k items from n. The reason is that you start with one region, each chord adds one, and each interior crossing adds one more. There is a chord for every pair of points and a crossing for every set of four.

n = 6:   C(6, 4) + C(6, 2) + 1 = 15 + 15 + 1 = 31

The doubling pattern had no mechanism behind it. The counting argument does, and that mechanism is what a proof supplies.

Failures far beyond hand calculation

Some patterns last much longer.

Euler suggested that a fifth power cannot be written as a sum of fewer than five fifth powers of positive integers, as part of a broader conjecture. In 1966, Lander and Parkin found by computer that

27⁵ + 84⁵ + 110⁵ + 133⁵ = 144⁵

A conjecture named after Pólya concerned whether each whole number has an even or odd count of prime factors, counted with repetition. It proposed that, for any cutoff of 2 or more, the numbers up to the cutoff with an odd count are never outnumbered by those with an even count. It was shown to be false in the middle of the twentieth century, and the first place it fails is a little above 906 million.

The Mertens conjecture, about a related running total, was disproved in 1985 by Odlyzko and te Riele. Their argument shows that a counterexample exists without exhibiting one, and none had been found by direct computation as of the mid-2020s.

Patterns that eventually broke
Small n Circle regions go 1, 2, 4, 8, 16, then 31 at six points n = 40 n² + n + 41 gives 41 × 41 after forty primes in a row 1966 Four fifth powers found that add to a fifth power Above 906 million First failure of Pólya's proposed inequality 1985 Mertens conjecture disproved with no counterexample shown Small n Circle regions go 1, 2, 4, 8, 16, then 31 at six points n = 40 n² + n + 41 gives 41 × 41 after forty primes in a row 1966 Four fifth powers found that add to a fifth power Above 906 million First failure of Pólya's proposed inequality 1985 Mertens conjecture disproved with no counterexample shown

Why small cases can mislead

A million sounds large because you compare it with everyday quantities. Compared with the whole numbers, it is a tiny initial segment. Almost every integer has more digits than any computer could store.

Small numbers are also unrepresentative. Some quantities grow so slowly that their influence barely shows in any range you can compute. The logarithm of a number with a hundred digits is only about 230 when taken to base e, and the logarithm of that logarithm is about 5.4. An effect governed by such a term can stay hidden for an enormous stretch.

A famous instance involves counting primes. A standard estimate called the logarithmic integral has exceeded the true count of primes everywhere that direct computation has compared them. Yet Littlewood proved in 1914 that the two trade places infinitely often. The first crossing lies somewhere far out, and the way primes thin out is full of this kind of delicacy.

What a large search does tell you

None of this makes computation worthless. A large search does several honest jobs.

  • It can destroy a false conjecture quickly by producing a counterexample.
  • It proves the statement for the range covered, assuming the program and machine behaved correctly.
  • It reveals patterns that suggest what to try proving.
  • It supplies a base that a theoretical argument may need.

The last job is important. Sometimes a proof shows that a claim holds for all numbers beyond some huge bound, and a computation checks everything below it. Together they cover every case. Neither half would be enough alone.

For the Goldbach conjecture, which says every even number greater than 2 is a sum of two primes, computers have checked past 10¹⁸. It remained unproved as of the mid-2020s, and the story of how close mathematicians have come shows how different checking and proving are. The computer checks of Riemann zeros raise the same point.

One exception is enough

The two possible outcomes of a test are very unequal. A success adds one confirmed case out of infinitely many. A failure settles the matter completely, because a claim about all numbers is false as soon as one number breaks it.

That asymmetry shapes how mathematicians work with data. They look for the inputs most likely to cause trouble: zero, one, negative values where allowed, primes, perfect squares, very lopsided pairs and anything that makes terms cancel. A hundred well-chosen tests can say more than a million consecutive ones that all share the same character.

It also matters that the counterexample be checkable. The fifth power identity above can be confirmed by anyone with patience and paper, even though finding it took a computer search. Disproof of a universal claim often has this pleasant property: hard to find, easy to verify.

When checking every case is a proof

Checking is a complete proof when the cases are finite and you check all of them. "Every integer from 90 to 96 is composite" can be proved by factoring seven numbers.

90 = 9 × 10     91 = 7 × 13     92 = 4 × 23     93 = 3 × 31
94 = 2 × 47     95 = 5 × 19     96 = 8 × 12

It also works when infinitely many objects fall into finitely many types and you prove each type at once. To show that n(n + 1) is even for every integer n, you only need two cases, n even and n odd. Each case is handled with algebra, not with a sample. This method is proof by cases.

The question to ask is always the same: what argument shows that nothing was left out?

Some large computer proofs follow this route. Reasoning reduces an infinite question to a long but finite list, and software works through the list. The four color theorem is the best-known early example.

How to turn a pattern into a proof

When data suggests a rule, you have a conjecture. The next step is to look for a reason that links one case to all the others.

  1. Test small cases, including odd ones such as 0, 1 and negative numbers where they make sense.
  2. Try hard to break the claim. Choose inputs that put pressure on it.
  3. Ask why it works in one typical case, without using special features of that number.
  4. Rewrite that reason with a letter in place of the number.
  5. If each case seems to depend on the one before, consider mathematical induction.

For n² + n + 41, step 2 would have saved the day: choosing n = 41 is a natural stress test, since it makes every term share a factor. The habit of searching for failures is covered in hunting for counterexamples.

The same trap in everyday reasoning

You do not need number theory to meet this problem. A spreadsheet formula can give right answers on every row you have and fail on the first blank cell or negative balance. A program can pass all its tests and break on an input nobody thought to try.

The useful habit carries over. Ask what the tests have in common, which situations they never touch and whether there is a reason, independent of the tests, to expect the behavior to continue. When there is such a reason, write it down, because that written reason is the beginning of a proof.

Common questions

Is mathematics stricter than science here?

The aims differ. Science tests claims about the world, where observation is the final judge and conclusions stay open to revision. Mathematics asks what follows from assumptions, and there a logical argument can settle every case.

If a pattern holds for a trillion cases, should you believe it?

You may reasonably suspect it is true, and many mathematicians act on such suspicions when choosing what to study. You should still label it as unproved, and any result that relies on it should say so.

Can one counterexample really sink a theory?

For a statement of the form "every object has this property", yes. A single verified object without it makes the statement false, although a narrower version with extra conditions may survive and be proved.

Written for 4Mathematics with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 41 articles in Proof and Reasoning →

Latest news on this topic