Generator

Completing the square, as a square

A generator in the algebra library, called 43 times across 8 essays. Below: what it draws with nothing chosen and at each mode an essay asks for, what it checks while drawing, and everywhere it is used.

algebra-tiles is one function. Everything below came out of it during this build, at parameters taken from the essays rather than invented for this page — so a figure here is the same figure a reader meets in an essay, and if the generator changes, this page changes with it.

With nothing chosen

Completing the square, as a square. An x by x square with the strip split in half and laid along two sides, leaving a square hole of side 1.5. Filling the hole costs 2.25 and buys a perfect square.

The correlations that reverse a coefficient

The correlations that reverse a coefficient. rho = 0.6: wedge shares 0.2051 and 0.2051 of the ellipse; arcsin(0.6)/pi = 0.2048.

Rising overall, falling in every band

Rising overall, falling in every band. n = 600, r12 = 0.8, r1y = 0.3, r2y = 0.6: overall slope 0.309; band slopes -0.151, -0.263, -0.074; population beta1 = -0.5.

What is left of x₁, against what is left of y

What is left of x₁, against what is left of y. residual slope -0.502066; least-squares coefficient of x1 -0.502066.

How often a sign reverses

How often a sign reverses. 123332 uniform 3x3 correlation matrices: share reversed 0.1469 (exact 0.1487); either 0.2955; both 0.

Reversals as predictors are added

Reversals as predictors are added. p=2: 0.149 / any 0.298 (30000 matrices); p=3: 0.216 / any 0.555 (20000 matrices); p=4: 0.252 / any 0.723 (15000 matrices); p=6: 0.296 / any 0.906 (10000 matrices); p=8: 0.322 / any 0.972 (7500 matrices); p=12: 0.357 / any 0.997 (5000 matrices); p=16: 0.373 / any 0.999 (3750 matrices); p=24: 0.395 / any 1.000 (2500 matrices)

What it checks while it draws

Collected by running the family and recording what it asserted, not written here. The count is how many separate times the claim was put to the test while these drawings were made.

Where it is called

Every figure on this list is drawn by the same rule, so a change to the rule changes all of them at once. That is why the list is published.

Algebra

Holding one still turns the other over

A quantity can rise with an outcome and still predict it downwards once a second quantity is held fixed. Completing the square in two predictors says exactly when: the pair of correlations has to fall in a wedge whose angle is arcsin of the predictors' own correlation. Averaged over every possible correlation matrix the chance is exactly 1/4 − 1/π², about one coefficient in seven; two coefficients never reverse together, and with two dozen predictors almost two in five do.

Algebra

Completing the square, by completing a square

The step everybody is taught as an algebraic trick is a literal instruction about a literal square. There is a corner missing, its size is forced, and paying for it is the whole method.

Algebra

Never negative and no sum of squares

Any quadratic that never goes below nought can be completed into squares, and the squares are the proof. In 1888 Hilbert showed the same habit must fail at higher degree without exhibiting a single failure; the first one was written down 79 years later. Motzkin's x⁴y² + x²y⁴ − 3x²y² + 1 touches nought four times and never crosses it, and one cell of a four-by-four table shows that no squares can make it. Multiply it by 1 + x² + y² and five squares appear.

Algebra

One number under every bell

The area under e^(−x²) has no formula in terms of the usual functions, and yet the area under e raised to any downward quadratic is known exactly. Completing the square in the exponent moves and squeezes every such curve into the same one, so a single number — √π — pays for all of them.

Algebra

Regression is a square completed halfway

A bell in two variables, sliced at a fixed x, is a bell in y — and completing the square in y alone says where it is centred: at ρx, on a line flatter than the ellipse's own axis. That gap is regression to the mean, and the same completion says it runs backwards in time just as well as forwards.

Algebra

The signs no completion can change

A quadratic in several variables can be completed square by square in many orders, and each order hands back different coefficients. What no order changes is how many come out positive and how many negative — and that count, read off a completion of A − tI, says how many eigenvalues lie below t without finding a single one.

Algebra

What the coefficients already know

Finding the roots of a polynomial is hard and often impossible in closed form. Reading off their sum, their product and how many of them are real is none of those things — those numbers are sitting in the coefficients, and no root-finding is required to get at them.

Algebra

Where two roots run into each other

Put every quadratic equation at a point of a plane, one coordinate per coefficient. Each possible root becomes a straight line there, every one of those lines touches the same parabola, and that parabola is the discriminant — the crease where the plane of roots is folded onto the plane of equations.

The whole library · What the figures prove