1 hour ago · Science · 0 comments

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² − n)/2 and the triangular numbers by Tn = (n² + n)/2 then Pn = T2n − 1 − Tn − 1. Here’s a visualization of the equation. 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 posts Testing pentagonal numbers…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.