Euclidean Algorithm Table
Runs the (extended) Euclidean algorithm as a table in Z, Q[x], F_p[x] or Z[i]: the learner adds one division at a time (or predicts each quotient and remainder), clicks a row to see its division, row operation and the invariant a s + b t = r, and reads off the gcd with Bezout coefficients. Optional panels: back substitution step by step, an inverse modulo a, the continued fraction and convergents, step counts with the Fibonacci, Lamé and halving bounds, and a standard versus least-remainder comparison.
Used in: Ring Theory, Elementary Number Theory
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | by setup, e.g. "Extended Euclidean algorithm in ℤ" | Title bar text. |
| a | number | string | 240 (Q[x]: "x^4 - 1", F_p[x]: "x^3 + x + 1", Z[i]: "11 + 7i") | First input r_{-1} (the modulus for showInverse). An integer, or a string: big integers ("2^64 + 1"), polynomials in one letter ("x^3 - 2x + 1/2"), Gaussian integers ("3 + 4i"). |
| b | number | string | 46 (Q[x]: "x^3 + 2x^2 + 2x + 1", F_p[x]: "x^2 + 1", Z[i]: "3 + 7i") | Second input r_0, divided into a first (the element inverted by showInverse). |
| ring | "Z" | "Q[x]" | "F_p[x]" | "Z[i]" | "Z" | Euclidean domain: integers, polynomials over Q or over F_p (set prime), or Gaussian integers. The size column shows |r|, deg r or the norm N(r). |
| prime | number | 2 | The prime p for ring "F_p[x]" (at most 1000003). |
| division | "standard" | "least-remainder" | "standard" | Z only. standard: 0 <= r < |b|. least-remainder: the nearest-integer quotient, |r| <= |b|/2; a negative remainder negates its row so r stays positive. |
| columns | "basic" | "extended" | "extended" | basic: row, q, r (the plain Euclidean algorithm). extended: also the coefficient columns s and t with a s + b t = r, and the Bezout identity at the end. |
| step | number | 0 | Division rows shown on load (0 = only the seed rows a, b); any number at least the step count (e.g. 99) shows the whole run and its results. |
| mode | "step" | "predict" | "step" | step: the learner adds or removes rows with the arrows. predict: the learner types the next quotient (and optionally the remainder) and checks it before the row appears; a wrong quotient is explained by the remainder it would give. |
| showSize | boolean | false for Z with standard division, true otherwise | Show the size column (|r|, deg r or N(r)) that strictly decreases down the table. |
| showIsolated | boolean | false | Show the isolated remainder r_k = r_{k-2} - q r_{k-1} of every row, the form back substitution uses. |
| showChecks | boolean | false | Show a column evaluating a s_k + b t_k for every row (it equals r_k). |
| showInvariant | boolean | false | Show a column gcd(r_{k-1}, r_k) for every consecutive pair: the same value all the way down. |
| showBackSubstitution | boolean | false | After the run, a back-substitution panel: start from the gcd row's division and substitute one row's isolated remainder at a time (highlighting that row) until only a and b remain. |
| showInverse | boolean | false | After the run, the inverse of b modulo a (|a| over Z) read off the t column, with a check, or why none exists. |
| showContinuedFraction | boolean | false | After the run (Z, standard division, b > 0), the quotients as the continued fraction a/b = [q_1; q_2, ...]. |
| showConvergents | boolean | false | Also list the convergents p_k/q_k of the continued fraction (implies the continued fraction readout). |
| showStepCount | boolean | false | After the run, the number of divisions with the matching bound: Fibonacci and Lamé (Z standard, a > b > 0; equality for consecutive Fibonacci numbers), halving (least remainder), norm (Z[i]) or degree (K[x]). |
| compareDivision | boolean | false | Z only: after the run, the division counts of the standard and least-remainder rules on the same input, with the other rule's quotients. |
| editable | boolean | true | Show the Inputs button, where the learner types their own a and b, changes the ring or the division rule. |
| controls | string[] | all controls shown | Ids of the hideable columns, readouts and Inputs options to show (see the controls registry, e.g. column.coefficients, readout.gcd, readout.algorithm-name, column.invariant, panel.back-substitution, readout.inverse). Core controls always show. Page building fills this from the subject's topic scope. |
PreviousNext