Article 76BEN Three examples suffice

Three examples suffice

by
John
from John D. Cook on (#76BEN)

You can't prove a theorem by just checking a few examples. Except sometimes you can.

A few weeks ago I wrote Pentagonal numbers are truncated triangular numbers. In a nutshell, if the pentagonal numbers are defined by

Pn= (3n^2 -n)/2

and the triangular numbers by

Tn= (n^2 +n)/2

then

Pn=T2n- 1-Tn- 1.

Here's a visualization of the equation.

pent_trunk.svg

Note that the equation asserts that two quadratic polynomials are equal. If the two polynomials are equal at three points, then they're equal everywhere. We might as well make life easy and choose n = 0, 1, and 2.

If you'd like, you could do this in code.

>>> P = lambda n: (3*n**2 - n)/2>>> T = lambda n: (n**2 + n)/2>>> for n in [0, 1, 2]: assert(P(n) == T(2*n-1) - T(n-1))

This provides a rigorous proof, not just a sanity check.

Sometimes checking a few points is not enough to prove an equation with certainty, but it is enough to establish an equation with high probability. More on that here.

Related postsThe post Three examples suffice first appeared on John D. Cook.
External Content
Source RSS or Atom Feed
Feed Location http://feeds.feedburner.com/TheEndeavour?format=xml
Feed Title John D. Cook
Feed Link https://www.johndcook.com/blog
Reply 0 comments