MakarovSuites
English
EnglishDeutschРусскийУкраїнськаFrançaisEspañolItalianoPolski
Contact & licences

Math

Roots on the move

The roots of a polynomial on the complex plane, running as one coefficient sweeps: the cubic's two roots meet at the discriminant and leave the real axis as a pair, six roots turn on a circle, and Wilkinson's ten roots are thrown into the plane by two parts in a million on one coefficient - the closest pair, the real count and Cauchy's bound measured live, and a task on the collision.

Roots on the move — Actual application image
Actual application image

What happens

A polynomial of degree n has n roots in the complex plane, always - that is the fundamental theorem of algebra - and they move continuously when a coefficient does. Here one coefficient t sweeps on its own from the moment the module opens, and the roots run across the plane leaving trails. For x³ − 3x + t the three roots start at −√3, 0 and √3; as t grows, two of them slide toward each other along the real axis, meet at t = 2, where the discriminant 108 − 27t² is zero, and leave the axis together as a conjugate pair, mirror images above and below - because the coefficients are real, a complex root never travels alone. Drag across the plane to sweep t by hand. The quartic x⁴ − 5x² + t does it twice; z⁶ − t keeps six roots on a circle whose radius is the sixth root of t. And Wilkinson's polynomial, (x − 1)(x − 2)…(x − 10), is the reason numerical analysts lose sleep: its roots are 1 to 10, its x⁹ coefficient is −55, and nudging that coefficient by a ten-thousandth - two parts in a million - throws the roots off the real line by more than half a unit. The faint circle is Cauchy's bound: no root ever leaves it. The roots are found by Aberth's iteration and checked against an independent solver.

Equations used in the module
Equations
cubic:  x³ − 3x + t;  discriminant 108 − 27t²;  t = 0: −√3, 0, √3;  t = 2: −2 and a double root at 1;  t = 3: −2.1038 and 1.0519 ± 0.5652i;  for |t| < 2 three real roots, beyond a conjugate pair at 1 ± i√((t − 2)/3) near t = 2
quartic:  x⁴ − 5x² + t;  x² = (5 ± √(25 − 4t))/2;  t = 0: 0, 0, ±√5;  t = 4: ±1, ±2;  t = 6.25: ±1.5811 twice
circle:  z⁶ − t;  six roots at radius |t|^(1/6), turned by 30° when t < 0
Wilkinson:  (x − 1)(x − 2)…(x − 10) + εx⁹, ε = t·10^−5;  x⁹ carries −55, the constant is 10! = 3 628 800;  ε = 10^−6 moves a root by 0.013;  ε = 10^−4 (two parts in a million of −55) throws roots complex, |Im| up to 0.675, shifts up to 0.90
solver:  Aberth–Ehrlich from 0.9 of the Cauchy circle, warm-started from the last frame so every root keeps its trail;  checked against numpy.roots to 10^−6 in the twin
Cauchy:  every root has |z| ≤ 1 + max|a_i|/|a_n|
task:  bring two roots of the cubic within 0.2:  |t − 2| < 0.03 (the pair sits at 1 ± √(|t − 2|/3));  1.98 reads 0.163, 1.95 reads 0.259
workshop:  roots dragged on the plane become coefficients by Vieta - Π(x − r_k) expanded, conjugates kept, a root within 0.03 of the axis snapped onto it;  Σ r_k = −a_(n−1)/a_n,  Π r_k = (−1)^n·a₀/a_n
residual and floor:  |p(z)| against 2n·ε·Σ|a_i||z|^i, the roundoff of Horner at z;  at the real root of x³ − 3x + 3: 8.9·10^−16 under a floor of 2.5·10^−14;  at Wilkinson's root 10 the floor is 0.003
sensitivity:  |∂z/∂a_k| = |z|^k / |p′(z)|;  Wilkinson: root 10 moves 10⁹/9! = 2755.7 per unit of a₉, root 1 moves 2.8·10^−6;  condition Σ|a_i||z|^i / (|z||p′(z)|) = 184756 = C(20, 10) at 10, 110 at 1
multiple:  a cluster within 10^−3 is reported as such; at x³ − 3x + 2 the pair at 1 has |p′| = 1.1·10^−9 - a double root is infinitely sensitive

Related experiments

Back to catalogue
Birthdays and collisions — Actual application image

Math

Birthdays and collisions

People arrive on a ring of days until two share one: in a year of 365 that is the 23rd person, not the 183rd, on Mars the 32nd, in 65 536 hash buckets the 302nd - runs against the exact curve, the days swept by dragging from a year to 2³², the square-root rule read live, and a task on the Martian room.

A code that repairs itself — Actual application image

Math

A code that repairs itself

Sixteen bits in a square, eleven of them a message: click one and the four check lamps spell out its address, and the block puts itself right. Two errors are caught but not repairable; three, and the block lies with confidence. Every claim is exhaustive - all 32 768 single errors located, all 245 760 double errors caught, every triple mis-corrected.

Basins of Newton's method — Actual application image

Math

Basins of Newton's method

Colour every starting point by the root Newton's method reaches: with two roots the boundary is a straight line, as Cayley proved in 1879, and with three it is a fractal that all three basins share. Drag a root and watch the areas move - a root pulled outward takes LESS of the window, not more.