35 of 40 focal problems use RatMath for a calculation or a substantive step.
Direct calculation
34 · 85%
Assisted
1 · 2.5%
Worked by hand
5 · 12.5%
Using the packages
Finite groups, subgroup lists and permutation calculations give concrete models. A theorem about every group or a map specified abstractly still needs an argument with the hypotheses visible.
Calculator interface
Make the operation and ambient group explicit. Link a permutation, its cycle notation, a Cayley table and the subgroup lattice. Let a learner enter a homomorphism and inspect its kernel and image.
Each of the 40 focal problems has equal weight. Direct means the displayed package calculation answers the computational question after the inputs are set up. Assisted means it contributes a step and the worked solution supplies essential reasoning, interpretation or selection. Worked by hand means the guide relies on a construction, argument or judgment for that task. The helpful share combines direct and assisted days. Courses and instructors assign different mixes of problems. The percentages describe this syllabus.
Classroom inputs and practical limits
35 of 40 days include a checked executable example. On 7 days the measured size sweep exercises a named API used in the lesson. Each day identifies its tested inputs and the mathematical property checked. Hand-worked days give the input scale and the argument to verify.
Ranges across the five units
Days 1–8 · Group axioms and elements. Cyclic groups of order 2–24 and permutations typically of degree 3–5; represent elements differently from a full group listing.
Unit benchmark · structures.symmetric.orderStatistics, permuted points. Largest passing sample 7 (73.20 ms, 89.4 MiB peak process RSS). Library refusal at 8. The first sampled passing call above 100 ms used 6 (157 ms).
Days 9–16 · Subgroups and actions. Orbits, cosets and subgroups of groups of order a few to a few dozen; a list of all subsets is far larger.
Unit benchmark · structures.symmetric.orderStatistics, permuted points. Largest passing sample 7 (73.20 ms, 89.4 MiB peak process RSS). Library refusal at 8. The first sampled passing call above 100 ms used 6 (157 ms).
Days 17–24 · Normality and quotients. Quotients, centers and commutators in explicitly given small groups; normality must hold for group quotients.
Unit benchmark · structures.symmetric.orderStatistics, permuted points. Largest passing sample 7 (73.20 ms, 89.4 MiB peak process RSS). Library refusal at 8. The first sampled passing call above 100 ms used 6 (157 ms).
Days 25–32 · Finite group structure. Permutation groups such as S₃, S₄ or A₅, and small p-groups; distinguish permutation degree from group order.
Unit benchmark · structures.symmetric.orderStatistics, permuted points. Largest passing sample 7 (73.20 ms, 89.4 MiB peak process RSS). Library refusal at 8. The first sampled passing call above 100 ms used 6 (157 ms).
Days 33–40 · Rings and fields. Residue rings with moduli roughly 2–30, and small polynomial or Gaussian-integer examples.
Unit benchmark · structures.Zn.units, modulus. Largest passing sample 10,000 (22.59 ms, 87 MiB peak process RSS). The runs did not locate a ceiling for this family.
Order 1: the identity. Order 2: 6 transpositions and 3 double transpositions, 9 in all. Order 3: three-cycles. Order 4: four-cycles. Total .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
console.log([...structures.symmetric(4).orderStatistics()]);
Checked output
[[1, 1], [2, 9], [3, 8], [4, 6]]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Cyclic groups of order 2–24 and permutations typically of degree 3–5; represent elements differently from a full group listing.
For this problem type. Common examples include cyclic orders under 30, polygons with 3–12 sides, and permutations on 3–5 letters. Group order and permutation degree measure different things.
Focal example. The code above passed its displayed check in 1.02 ms on Node.
Same API, measured input family.structures.symmetric.orderStatistics · permuted points. Baseline test points across courses 2, 3, 4, 5. Count every permutation by order; the histogram totals n! and contains one identity.
Practical limit. Largest passing sample 7 (73.20 ms, 89.4 MiB peak process RSS). Library refusal at 8. The first sampled passing call above 100 ms used 6 (157 ms). An explicit order histogram visits group elements. Sₙ has n! elements. A formula for the order of Sₙ avoids this enumeration.
Measured times, memory and outcomes
permuted points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
1.16
75.6
3
Baseline
Passed
1.36
75.1
4
Baseline
Passed
2.07
75.2
5
Baseline
Passed
10.28
80.6
6
Stretch
Passed
157
90.6
7
Stretch
Passed
73.20
89.4
8
Stretch
Library refusal · RangeError: the group has more than 20000 elements
26.99
90.1
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.symmetric · 40 passing test cases, 7 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
const G = structures.symmetric(5);
console.log(G.elementOrder(G.element("(1 2 3)(4 5)")));
Checked output
6
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Cyclic groups of order 2–24 and permutations typically of degree 3–5; represent elements differently from a full group listing.
For this problem type. Common examples include cyclic orders under 30, polygons with 3–12 sides, and permutations on 3–5 letters. Group order and permutation degree measure different things.
Focal example. The code above passed its displayed check in 3.88 ms on Node.
Related workload in this unit.structures.symmetric.orderStatistics · permuted points. Baseline test points across courses 2, 3, 4, 5. Count every permutation by order; the histogram totals n! and contains one identity.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 7 (73.20 ms, 89.4 MiB peak process RSS). Library refusal at 8. The first sampled passing call above 100 ms used 6 (157 ms). An explicit order histogram visits group elements. Sₙ has n! elements. A formula for the order of Sₙ avoids this enumeration.
Measured times, memory and outcomes
permuted points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
1.16
75.6
3
Baseline
Passed
1.36
75.1
4
Baseline
Passed
2.07
75.2
5
Baseline
Passed
10.28
80.6
6
Stretch
Passed
157
90.6
7
Stretch
Passed
73.20
89.4
8
Stretch
Library refusal · RangeError: the group has more than 20000 elements
26.99
90.1
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.symmetric · 40 passing test cases, 7 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
console.log(structures.sign("(1 2 3 4)", 4));
Checked output
-1
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Cyclic groups of order 2–24 and permutations typically of degree 3–5; represent elements differently from a full group listing.
Focal example. The code above passed its displayed check in 0.152 ms on Node.
Related workload in this unit.structures.symmetric.orderStatistics · permuted points. Baseline test points across courses 2, 3, 4, 5. Count every permutation by order; the histogram totals n! and contains one identity.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 7 (73.20 ms, 89.4 MiB peak process RSS). Library refusal at 8. The first sampled passing call above 100 ms used 6 (157 ms). An explicit order histogram visits group elements. Sₙ has n! elements. A formula for the order of Sₙ avoids this enumeration.
Measured times, memory and outcomes
permuted points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
1.16
75.6
3
Baseline
Passed
1.36
75.1
4
Baseline
Passed
2.07
75.2
5
Baseline
Passed
10.28
80.6
6
Stretch
Passed
157
90.6
7
Stretch
Passed
73.20
89.4
8
Stretch
Library refusal · RangeError: the group has more than 20000 elements
26.99
90.1
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.sign · 3 passing test cases, 18 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
const G = structures.cyclic(20);
console.log(G.elementOrder(G.element(8)));
Checked output
5
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Cyclic groups of order 2–24 and permutations typically of degree 3–5; represent elements differently from a full group listing.
For this problem type. Common examples include cyclic orders under 30, polygons with 3–12 sides, and permutations on 3–5 letters. Group order and permutation degree measure different things.
Focal example. The code above passed its displayed check in 1.20 ms on Node.
Same API, measured input family.structures.cyclic.elementOrder · group order. Baseline test points across courses 2, 4, 6, 12, 24. The element 2 of Z/n has order n/gcd(2,n).
Practical limit. Largest passing sample 1,000 (116 ms, 80.6 MiB peak process RSS). RSS cutoff at 10,000. The first sampled passing call above 100 ms used 1,000 (116 ms). Element orders are cheap compared with constructing every subgroup. Check the representation and group operation before transferring a timing.
Measured times, memory and outcomes
group order · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.739
74.6
4
Baseline
Passed
0.827
75.3
6
Baseline
Passed
0.937
75.2
12
Baseline
Passed
0.954
76.2
24
Baseline
Passed
1.52
75.9
100
Stretch
Passed
7.19
76.4
1,000
Stretch
Passed
116
80.6
10,000
Stretch
RSS cutoff
—
393.3
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.cyclic · 31 passing test cases, 11 distinct argument descriptions
Is an equivalence relation on ? If so, give its classes.
Worked solution
Yes (reflexive, symmetric, transitive): classes and .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as discrete from "@ratmath/discrete";
console.log(discrete.relation([1, 2, 3], [[1, 1], [2, 2], [3, 3], [1, 2], [2, 1]]).classes());
Checked output
[[1, 2], [3]]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Cyclic groups of order 2–24 and permutations typically of degree 3–5; represent elements differently from a full group listing.
Focal example. The code above passed its displayed check in 0.400 ms on Node.
Related workload in this unit.structures.symmetric.orderStatistics · permuted points. Baseline test points across courses 2, 3, 4, 5. Count every permutation by order; the histogram totals n! and contains one identity.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 7 (73.20 ms, 89.4 MiB peak process RSS). Library refusal at 8. The first sampled passing call above 100 ms used 6 (157 ms). An explicit order histogram visits group elements. Sₙ has n! elements. A formula for the order of Sₙ avoids this enumeration.
Measured times, memory and outcomes
permuted points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
1.16
75.6
3
Baseline
Passed
1.36
75.1
4
Baseline
Passed
2.07
75.2
5
Baseline
Passed
10.28
80.6
6
Stretch
Passed
157
90.6
7
Stretch
Passed
73.20
89.4
8
Stretch
Library refusal · RangeError: the group has more than 20000 elements
26.99
90.1
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
discrete.relation · 1 passing test case, 2 distinct argument descriptions
Compare (5−3)−1=1 with 5−(3−1)=3. One counterexample defeats associativity.
Using RatMath
Put the arithmetic inside the R tag so RatMath parses the literals. Keep fractions as ratios throughout the calculation and attach the units from the problem to the result.
JavaScript module
import { R } from "@ratmath/core";
console.log(String(R`5-(3-1)`));
Checked output
3
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Cyclic groups of order 2–24 and permutations typically of degree 3–5; represent elements differently from a full group listing.
Focal example. The code above passed its displayed check in 0.102 ms on Node.
Same arithmetic expression. Replaced its first numeral 5 with 0, 1, 2, 7, 12, 100, 1000, -3, 1/2. All 9 defined variants agreed exactly with Python’s rational arithmetic. This varies the arithmetic operation while holding the rest of the expression fixed.
Related workload in this unit.core.R · whole-number operand. Baseline test points across courses 0, 1, 10, 20, 100, 1,000, 1,000,000. (n+7)(n−3) by independent BigInt arithmetic.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 9,007,199,254,740,991 (1.67 ms, 75.3 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact integer arithmetic grows with operand bit length. Enter large integers as decimal strings or BigInts before any JavaScript Number conversion.
Measured times, memory and outcomes
whole-number operand · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
1.75
75
1
Baseline
Passed
1.70
75.7
10
Baseline
Passed
1.78
75.1
20
Baseline
Passed
1.88
75.4
100
Baseline
Passed
1.55
75.4
1,000
Baseline
Passed
1.36
75.3
1,000,000
Baseline
Passed
1.39
74.8
1,000,000,000
Stretch
Passed
1.69
76.3
9,007,199,254,740,991
Stretch
Passed
1.67
75.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
core.R · 2 passing test cases, 10 distinct argument descriptions
If e and f are both two-sided identities, why must e=f?
Worked solution
Evaluate ef first using the left identity e and then using the right identity f.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Cyclic groups of order 2–24 and permutations typically of degree 3–5; represent elements differently from a full group listing.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 08 / 40 · Group axioms and elements
Cancellation
Worked by hand
Problem
Prove left cancellation in a group.
Worked solution
From ab=ac multiply by a⁻¹ on the left. Associativity and the identity law give b=c.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Cyclic groups of order 2–24 and permutations typically of degree 3–5; represent elements differently from a full group listing.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 09 / 40 · Subgroups and actions
Subgroups of a cyclic group
Direct calculation@ratmath/structures
Problem
How many subgroups does have?
Worked solution
One for each divisor of 12: 1, 2, 3, 4, 6, 12. Six subgroups.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
console.log(structures.cyclic(12).subgroups().length);
Checked output
6
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Orbits, cosets and subgroups of groups of order a few to a few dozen; a list of all subsets is far larger.
For this problem type. Common examples include cyclic orders under 30, polygons with 3–12 sides, and permutations on 3–5 letters. Group order and permutation degree measure different things.
Focal example. The code above passed its displayed check in 0.782 ms on Node.
Related workload in this unit.structures.cyclic.elementOrder · group order. Baseline test points across courses 2, 4, 6, 12, 24. The element 2 of Z/n has order n/gcd(2,n).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000 (116 ms, 80.6 MiB peak process RSS). RSS cutoff at 10,000. The first sampled passing call above 100 ms used 1,000 (116 ms). Element orders are cheap compared with constructing every subgroup. Check the representation and group operation before transferring a timing.
Measured times, memory and outcomes
group order · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.739
74.6
4
Baseline
Passed
0.827
75.3
6
Baseline
Passed
0.937
75.2
12
Baseline
Passed
0.954
76.2
24
Baseline
Passed
1.52
75.9
100
Stretch
Passed
7.19
76.4
1,000
Stretch
Passed
116
80.6
10,000
Stretch
RSS cutoff
—
393.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.cyclic · 31 passing test cases, 11 distinct argument descriptions
For the dihedral group of order 8, find the order of the centre and the class equation.
Worked solution
, order 2. The other classes are , , : (centre first), i.e. .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
const D = structures.dihedral(4);
console.log([D.order, D.centre().order, D.classEquation()]);
Checked output
[8, 2, 8 = 2 + 2 + 2 + 2]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Orbits, cosets and subgroups of groups of order a few to a few dozen; a list of all subsets is far larger.
For this problem type. Common examples include cyclic orders under 30, polygons with 3–12 sides, and permutations on 3–5 letters. Group order and permutation degree measure different things.
Focal example. The code above passed its displayed check in 0.794 ms on Node.
Related workload in this unit.structures.symmetric.orderStatistics · permuted points. Baseline test points across courses 2, 3, 4, 5. Count every permutation by order; the histogram totals n! and contains one identity.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 7 (73.20 ms, 89.4 MiB peak process RSS). Library refusal at 8. The first sampled passing call above 100 ms used 6 (157 ms). An explicit order histogram visits group elements. Sₙ has n! elements. A formula for the order of Sₙ avoids this enumeration.
Measured times, memory and outcomes
permuted points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
1.16
75.6
3
Baseline
Passed
1.36
75.1
4
Baseline
Passed
2.07
75.2
5
Baseline
Passed
10.28
80.6
6
Stretch
Passed
157
90.6
7
Stretch
Passed
73.20
89.4
8
Stretch
Library refusal · RangeError: the group has more than 20000 elements
26.99
90.1
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.dihedral · 31 passing test cases, 9 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
console.log(String(structures.symmetric(3).classEquation()));
Checked output
6 = 1 + 2 + 3
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Orbits, cosets and subgroups of groups of order a few to a few dozen; a list of all subsets is far larger.
For this problem type. Common examples include cyclic orders under 30, polygons with 3–12 sides, and permutations on 3–5 letters. Group order and permutation degree measure different things.
Focal example. The code above passed its displayed check in 0.242 ms on Node.
Related workload in this unit.structures.symmetric.orderStatistics · permuted points. Baseline test points across courses 2, 3, 4, 5. Count every permutation by order; the histogram totals n! and contains one identity.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 7 (73.20 ms, 89.4 MiB peak process RSS). Library refusal at 8. The first sampled passing call above 100 ms used 6 (157 ms). An explicit order histogram visits group elements. Sₙ has n! elements. A formula for the order of Sₙ avoids this enumeration.
Measured times, memory and outcomes
permuted points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
1.16
75.6
3
Baseline
Passed
1.36
75.1
4
Baseline
Passed
2.07
75.2
5
Baseline
Passed
10.28
80.6
6
Stretch
Passed
157
90.6
7
Stretch
Passed
73.20
89.4
8
Stretch
Library refusal · RangeError: the group has more than 20000 elements
26.99
90.1
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.symmetric · 40 passing test cases, 7 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
console.log(
[structures.alternating(5).order, structures.symmetric(5).index(structures.alternating(5))]
);
Checked output
[60, 2]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Orbits, cosets and subgroups of groups of order a few to a few dozen; a list of all subsets is far larger.
For this problem type. Common examples include cyclic orders under 30, polygons with 3–12 sides, and permutations on 3–5 letters. Group order and permutation degree measure different things.
Focal example. The code above passed its displayed check in 5.94 ms on Node.
Related workload in this unit.structures.symmetric.orderStatistics · permuted points. Baseline test points across courses 2, 3, 4, 5. Count every permutation by order; the histogram totals n! and contains one identity.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 7 (73.20 ms, 89.4 MiB peak process RSS). Library refusal at 8. The first sampled passing call above 100 ms used 6 (157 ms). An explicit order histogram visits group elements. Sₙ has n! elements. A formula for the order of Sₙ avoids this enumeration.
Measured times, memory and outcomes
permuted points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
1.16
75.6
3
Baseline
Passed
1.36
75.1
4
Baseline
Passed
2.07
75.2
5
Baseline
Passed
10.28
80.6
6
Stretch
Passed
157
90.6
7
Stretch
Passed
73.20
89.4
8
Stretch
Library refusal · RangeError: the group has more than 20000 elements
26.99
90.1
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.alternating · 27 passing test cases, 6 distinct argument descriptions
How many necklaces of 4 beads in 2 colours are there, up to rotation?
Worked solution
Fixed colourings: identity 16, rotation by 2 fixes 4, rotations by 1 and 3 fix 2 each: .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
const C = structures.cyclic(4);
const strings = Array.from({ length: 16 }, (_, m) => m.toString(2).padStart(4, "0"));
console.log(
String(structures.burnside(structures.action(C, strings, (g, s) => s.slice(Number(g)) + s.slice(0, Number(g)))))
);
Checked output
(1/4)·(16 + 4 + 2 + 2) = 6
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Orbits, cosets and subgroups of groups of order a few to a few dozen; a list of all subsets is far larger.
For this problem type. Common examples include cyclic orders under 30, polygons with 3–12 sides, and permutations on 3–5 letters. Group order and permutation degree measure different things.
Focal example. The code above passed its displayed check in 0.560 ms on Node.
Related workload in this unit.structures.cyclic.elementOrder · group order. Baseline test points across courses 2, 4, 6, 12, 24. The element 2 of Z/n has order n/gcd(2,n).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000 (116 ms, 80.6 MiB peak process RSS). RSS cutoff at 10,000. The first sampled passing call above 100 ms used 1,000 (116 ms). Element orders are cheap compared with constructing every subgroup. Check the representation and group operation before transferring a timing.
Measured times, memory and outcomes
group order · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.739
74.6
4
Baseline
Passed
0.827
75.3
6
Baseline
Passed
0.937
75.2
12
Baseline
Passed
0.954
76.2
24
Baseline
Passed
1.52
75.9
100
Stretch
Passed
7.19
76.4
1,000
Stretch
Passed
116
80.6
10,000
Stretch
RSS cutoff
—
393.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.cyclic · 31 passing test cases, 11 distinct argument descriptions
How many ways can the 4 vertices of a square be coloured with 3 colours, up to rotation? Up to rotation and reflection?
Worked solution
Rotations: . With reflections (two diagonal flips fix each, two edge flips each): .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as discrete from "@ratmath/discrete";
console.log(
[discrete.countColourings(discrete.symmetry.cyclic(4), 3), discrete.countColourings(discrete.symmetry.dihedral(4), 3)]
);
Checked output
[24n, 21n]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Orbits, cosets and subgroups of groups of order a few to a few dozen; a list of all subsets is far larger.
Focal example. The code above passed its displayed check in 6.73 ms on Node.
Related workload in this unit.discrete.binomial · objects. Baseline test points across courses 2, 5, 10, 52. Check k!(n−k)!·C(n,k)=n! for k=floor(n/2).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 10,000 (8.36 ms, 88 MiB peak process RSS). The runs did not locate a ceiling for this family. Coefficient bit length grows with n and k. Counting is far cheaper than actually listing all k-subsets.
Measured times, memory and outcomes
objects · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.144
74.7
5
Baseline
Passed
0.151
73.9
10
Baseline
Passed
0.142
75.1
52
Baseline
Passed
0.141
75.9
100
Stretch
Passed
0.128
75
500
Stretch
Passed
0.171
76
2,000
Stretch
Passed
0.526
78.6
10,000
Stretch
Passed
8.36
88
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
discrete.countColourings · 1 passing test case, 2 distinct argument descriptions
A group of order 24 acts on a set. A point has stabilizer of order 6. What is its orbit size?
Worked solution
Apply the coset count [G:Gₓ].
Using RatMath
Put the arithmetic inside the R tag so RatMath parses the literals. Keep fractions as ratios throughout the calculation and attach the units from the problem to the result.
JavaScript module
import { R } from "@ratmath/core";
console.log(String(R`24/6`));
Checked output
4
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Orbits, cosets and subgroups of groups of order a few to a few dozen; a list of all subsets is far larger.
Focal example. The code above passed its displayed check in 0.109 ms on Node.
Same arithmetic expression. Replaced its first numeral 24 with 0, 1, 2, 7, 12, 100, 1000, -3, 1/2. All 9 defined variants agreed exactly with Python’s rational arithmetic. This varies the arithmetic operation while holding the rest of the expression fixed.
Related workload in this unit.core.Rational.add · denominator. Baseline test points across courses 1, 2, 3, 12, 100, 1,000. Cross-multiply 1/n + 1/(n+1) against (2n+1)/(n(n+1)).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,007 (0.038 ms, 76.3 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact work depends on the bit lengths of both numerator and denominator. A long sum of relatively prime fractions can build a large common denominator.
Measured times, memory and outcomes
denominator · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.034
74.9
2
Baseline
Passed
0.036
75.6
3
Baseline
Passed
0.040
75.9
12
Baseline
Passed
0.039
75.2
100
Baseline
Passed
0.041
75
1,000
Baseline
Passed
0.035
75.8
1,000,003
Stretch
Passed
0.044
75
1,000,000,007
Stretch
Passed
0.038
76.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
core.R · 2 passing test cases, 10 distinct argument descriptions
Input contract · An integer can lose a digit before RatMath receives it. The decimal integer 9007199254740993 supplied as a JavaScript Number has already become 9007199254740992. The Rational constructor refuses this unsafe Number. Supply a BigInt or an exact string. Converting a rounded Number back to BigInt preserves the earlier error.
Day 16 / 40 · Subgroups and actions
Orbit and stabilizer
Direct calculation@ratmath/core
Problem
The symmetric group S₄ acts on the four positions of a square by arbitrary permutations of the positions. What is the size of the stabilizer of one position?
Worked solution
The orbit has four elements. Orbit–stabilizer gives 24/4=6. Equivalently the other three positions can be freely permuted.
Using RatMath
Put the arithmetic inside the R tag so RatMath parses the literals. Keep fractions as ratios throughout the calculation and attach the units from the problem to the result.
JavaScript module
import { R } from "@ratmath/core";
console.log(String(R`24/4`));
Checked output
6
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Orbits, cosets and subgroups of groups of order a few to a few dozen; a list of all subsets is far larger.
Focal example. The code above passed its displayed check in 0.095 ms on Node.
Same arithmetic expression. Replaced its first numeral 24 with 0, 1, 2, 7, 12, 100, 1000, -3, 1/2. All 9 defined variants agreed exactly with Python’s rational arithmetic. This varies the arithmetic operation while holding the rest of the expression fixed.
Related workload in this unit.core.Rational.add · denominator. Baseline test points across courses 1, 2, 3, 12, 100, 1,000. Cross-multiply 1/n + 1/(n+1) against (2n+1)/(n(n+1)).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,007 (0.038 ms, 76.3 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact work depends on the bit lengths of both numerator and denominator. A long sum of relatively prime fractions can build a large common denominator.
Measured times, memory and outcomes
denominator · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.034
74.9
2
Baseline
Passed
0.036
75.6
3
Baseline
Passed
0.040
75.9
12
Baseline
Passed
0.039
75.2
100
Baseline
Passed
0.041
75
1,000
Baseline
Passed
0.035
75.8
1,000,003
Stretch
Passed
0.044
75
1,000,000,007
Stretch
Passed
0.038
76.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
core.R · 2 passing test cases, 10 distinct argument descriptions
Input contract · An integer can lose a digit before RatMath receives it. The decimal integer 9007199254740993 supplied as a JavaScript Number has already become 9007199254740992. The Rational constructor refuses this unsafe Number. Supply a BigInt or an exact string. Converting a rounded Number back to BigInt preserves the earlier error.
Day 17 / 40 · Normality and quotients
Finite abelian groups
Direct calculation@ratmath/structures
Problem
List the abelian groups of order 72 up to isomorphism.
Worked solution
: three partitions of 3 times two partitions of 2, six groups: , , , , , .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
console.log(structures.abelianGroups(72).map(String));
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Quotients, centers and commutators in explicitly given small groups; normality must hold for group quotients.
Focal example. The code above passed its displayed check in 0.557 ms on Node.
Related workload in this unit.structures.cyclic.elementOrder · group order. Baseline test points across courses 2, 4, 6, 12, 24. The element 2 of Z/n has order n/gcd(2,n).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000 (116 ms, 80.6 MiB peak process RSS). RSS cutoff at 10,000. The first sampled passing call above 100 ms used 1,000 (116 ms). Element orders are cheap compared with constructing every subgroup. Check the representation and group operation before transferring a timing.
Measured times, memory and outcomes
group order · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.739
74.6
4
Baseline
Passed
0.827
75.3
6
Baseline
Passed
0.937
75.2
12
Baseline
Passed
0.954
76.2
24
Baseline
Passed
1.52
75.9
100
Stretch
Passed
7.19
76.4
1,000
Stretch
Passed
116
80.6
10,000
Stretch
RSS cutoff
—
393.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.abelianGroups · 1 passing test case, 6 distinct argument descriptions
Yes, since and has order 6. No: has no element of order 4.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
const S = structures;
console.log(
[S.isIsomorphic(S.cyclic(6), S.directProduct(S.cyclic(2), S.cyclic(3))), S.isIsomorphic(S.kleinFour(), S.cyclic(4))]
);
Checked output
[true, false]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Quotients, centers and commutators in explicitly given small groups; normality must hold for group quotients.
Focal example. The code above passed its displayed check in 1.67 ms on Node.
Related workload in this unit.structures.cyclic.elementOrder · group order. Baseline test points across courses 2, 4, 6, 12, 24. The element 2 of Z/n has order n/gcd(2,n).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000 (116 ms, 80.6 MiB peak process RSS). RSS cutoff at 10,000. The first sampled passing call above 100 ms used 1,000 (116 ms). Element orders are cheap compared with constructing every subgroup. Check the representation and group operation before transferring a timing.
Measured times, memory and outcomes
group order · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.739
74.6
4
Baseline
Passed
0.827
75.3
6
Baseline
Passed
0.937
75.2
12
Baseline
Passed
0.954
76.2
24
Baseline
Passed
1.52
75.9
100
Stretch
Passed
7.19
76.4
1,000
Stretch
Passed
116
80.6
10,000
Stretch
RSS cutoff
—
393.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.isIsomorphic · 8 passing test cases, 1 distinct argument description
has order 3, so the quotient has order 4, generated by : it is .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
const G = structures.cyclic(12);
const Q = G.quotient(G.subgroup([G.element(4)]));
console.log([Q.order, Q.isCyclic]);
Checked output
[4, true]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Quotients, centers and commutators in explicitly given small groups; normality must hold for group quotients.
For this problem type. Common examples include cyclic orders under 30, polygons with 3–12 sides, and permutations on 3–5 letters. Group order and permutation degree measure different things.
Focal example. The code above passed its displayed check in 0.652 ms on Node.
Related workload in this unit.structures.cyclic.elementOrder · group order. Baseline test points across courses 2, 4, 6, 12, 24. The element 2 of Z/n has order n/gcd(2,n).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000 (116 ms, 80.6 MiB peak process RSS). RSS cutoff at 10,000. The first sampled passing call above 100 ms used 1,000 (116 ms). Element orders are cheap compared with constructing every subgroup. Check the representation and group operation before transferring a timing.
Measured times, memory and outcomes
group order · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.739
74.6
4
Baseline
Passed
0.827
75.3
6
Baseline
Passed
0.937
75.2
12
Baseline
Passed
0.954
76.2
24
Baseline
Passed
1.52
75.9
100
Stretch
Passed
7.19
76.4
1,000
Stretch
Passed
116
80.6
10,000
Stretch
RSS cutoff
—
393.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.cyclic · 31 passing test cases, 11 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
console.log(structures.symmetric(3).derivedSubgroup().order);
Checked output
3
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Quotients, centers and commutators in explicitly given small groups; normality must hold for group quotients.
For this problem type. Common examples include cyclic orders under 30, polygons with 3–12 sides, and permutations on 3–5 letters. Group order and permutation degree measure different things.
Focal example. The code above passed its displayed check in 0.212 ms on Node.
Related workload in this unit.structures.symmetric.orderStatistics · permuted points. Baseline test points across courses 2, 3, 4, 5. Count every permutation by order; the histogram totals n! and contains one identity.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 7 (73.20 ms, 89.4 MiB peak process RSS). Library refusal at 8. The first sampled passing call above 100 ms used 6 (157 ms). An explicit order histogram visits group elements. Sₙ has n! elements. A formula for the order of Sₙ avoids this enumeration.
Measured times, memory and outcomes
permuted points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
1.16
75.6
3
Baseline
Passed
1.36
75.1
4
Baseline
Passed
2.07
75.2
5
Baseline
Passed
10.28
80.6
6
Stretch
Passed
157
90.6
7
Stretch
Passed
73.20
89.4
8
Stretch
Library refusal · RangeError: the group has more than 20000 elements
26.99
90.1
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.symmetric · 40 passing test cases, 7 distinct argument descriptions
How many elements of order 4 are in the quaternion group ?
Worked solution
: six. ( has order 2 and order 1.)
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
console.log([...structures.quaternion().orderStatistics()]);
Checked output
[[1, 1], [2, 1], [4, 6]]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Quotients, centers and commutators in explicitly given small groups; normality must hold for group quotients.
For this problem type. Common examples include cyclic orders under 30, polygons with 3–12 sides, and permutations on 3–5 letters. Group order and permutation degree measure different things.
Focal example. The code above passed its displayed check in 0.363 ms on Node.
Related workload in this unit.structures.symmetric.orderStatistics · permuted points. Baseline test points across courses 2, 3, 4, 5. Count every permutation by order; the histogram totals n! and contains one identity.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 7 (73.20 ms, 89.4 MiB peak process RSS). Library refusal at 8. The first sampled passing call above 100 ms used 6 (157 ms). An explicit order histogram visits group elements. Sₙ has n! elements. A formula for the order of Sₙ avoids this enumeration.
Measured times, memory and outcomes
permuted points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
1.16
75.6
3
Baseline
Passed
1.36
75.1
4
Baseline
Passed
2.07
75.2
5
Baseline
Passed
10.28
80.6
6
Stretch
Passed
157
90.6
7
Stretch
Passed
73.20
89.4
8
Stretch
Library refusal · RangeError: the group has more than 20000 elements
26.99
90.1
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.quaternion · 21 passing test cases, 1 distinct argument description
For a homomorphism from a group of size 30 with a kernel of size 5, what is the image size?
Worked solution
Every nonempty fiber is a coset of the kernel.
Using RatMath
Put the arithmetic inside the R tag so RatMath parses the literals. Keep fractions as ratios throughout the calculation and attach the units from the problem to the result.
JavaScript module
import { R } from "@ratmath/core";
console.log(String(R`30/5`));
Checked output
6
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Quotients, centers and commutators in explicitly given small groups; normality must hold for group quotients.
Focal example. The code above passed its displayed check in 0.076 ms on Node.
Same arithmetic expression. Replaced its first numeral 30 with 0, 1, 2, 7, 12, 100, 1000, -3, 1/2. All 9 defined variants agreed exactly with Python’s rational arithmetic. This varies the arithmetic operation while holding the rest of the expression fixed.
Related workload in this unit.core.Rational.add · denominator. Baseline test points across courses 1, 2, 3, 12, 100, 1,000. Cross-multiply 1/n + 1/(n+1) against (2n+1)/(n(n+1)).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,007 (0.038 ms, 76.3 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact work depends on the bit lengths of both numerator and denominator. A long sum of relatively prime fractions can build a large common denominator.
Measured times, memory and outcomes
denominator · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.034
74.9
2
Baseline
Passed
0.036
75.6
3
Baseline
Passed
0.040
75.9
12
Baseline
Passed
0.039
75.2
100
Baseline
Passed
0.041
75
1,000
Baseline
Passed
0.035
75.8
1,000,003
Stretch
Passed
0.044
75
1,000,000,007
Stretch
Passed
0.038
76.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
core.R · 2 passing test cases, 10 distinct argument descriptions
Representatives 0 and 4 name the same source class and distinct target classes. Thus the proposed map is ill-defined.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Quotients, centers and commutators in explicitly given small groups; normality must hold for group quotients.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 24 / 40 · Normality and quotients
Order of an element
Direct calculation@ratmath/numtheory
Problem
Find the multiplicative order of 2 modulo 11.
Worked solution
The order divides 10. , , so the order is 10.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as numtheory from "@ratmath/numtheory";
console.log(numtheory.multiplicativeOrder(2, 11));
Checked output
10n
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Quotients, centers and commutators in explicitly given small groups; normality must hold for group quotients.
For this problem type. Use small moduli, often 2–200, and one to four congruences or trial residues. Verify coprimality or primality when required.
Focal example. The code above passed its displayed check in 0.198 ms on Node.
Same API, measured input family.numtheory.multiplicativeOrder · prime modulus. Baseline test points across courses 3, 5, 7, 11, 23. Compute the order by multiplying 2 repeatedly modulo p until the first return to 1.
Practical limit. Largest passing sample 10,007 (0.475 ms, 74.3 MiB peak process RSS). The runs did not locate a ceiling for this family. The least positive exponent requires a unit modulo the modulus. Modular factoring and order structure affect running time.
Measured times, memory and outcomes
prime modulus · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
3
Baseline
Passed
0.281
75.7
5
Baseline
Passed
0.413
76.2
7
Baseline
Passed
0.300
74.5
11
Baseline
Passed
0.352
74.9
23
Baseline
Passed
0.338
75.6
101
Stretch
Passed
0.384
75.7
1,009
Stretch
Passed
0.512
75.9
10,007
Stretch
Passed
0.475
74.3
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Day 25 / 40 · Finite group structure
Sylow theorems
Direct calculation@ratmath/structures
Problem
How many Sylow 3-subgroups and Sylow 2-subgroups does have?
Worked solution
, : ; the eight 3-cycles make four subgroups of order 3, so . is odd and divides 3; the Sylow 2-subgroups are the three copies of : .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
const G = structures.symmetric(4);
console.log([G.sylowCount(3), G.sylowCount(2)]);
Checked output
[4, 3]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Permutation groups such as S₃, S₄ or A₅, and small p-groups; distinguish permutation degree from group order.
For this problem type. Common examples include cyclic orders under 30, polygons with 3–12 sides, and permutations on 3–5 letters. Group order and permutation degree measure different things.
Focal example. The code above passed its displayed check in 0.749 ms on Node.
Related workload in this unit.structures.symmetric.orderStatistics · permuted points. Baseline test points across courses 2, 3, 4, 5. Count every permutation by order; the histogram totals n! and contains one identity.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 7 (73.20 ms, 89.4 MiB peak process RSS). Library refusal at 8. The first sampled passing call above 100 ms used 6 (157 ms). An explicit order histogram visits group elements. Sₙ has n! elements. A formula for the order of Sₙ avoids this enumeration.
Measured times, memory and outcomes
permuted points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
1.16
75.6
3
Baseline
Passed
1.36
75.1
4
Baseline
Passed
2.07
75.2
5
Baseline
Passed
10.28
80.6
6
Stretch
Passed
157
90.6
7
Stretch
Passed
73.20
89.4
8
Stretch
Library refusal · RangeError: the group has more than 20000 elements
26.99
90.1
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.symmetric · 40 passing test cases, 7 distinct argument descriptions
Is simple? What are the orders of its normal subgroups, and does it have a subgroup of order 6?
Worked solution
No: the Klein four-group is normal. Normal subgroups have orders 1, 4, 12. There is no subgroup of order 6 (the converse of Lagrange fails): subgroup orders are 1, 2, 3, 4, 12.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
const A = structures.alternating(4);
console.log(
[A.isSimple, A.normalSubgroups().map((h) => h.order), [...new Set(A.subgroups().map((h) => h.order))].sort((a, b) => a - b)]
);
Checked output
[false, [1, 4, 12], [1, 2, 3, 4, 12]]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Permutation groups such as S₃, S₄ or A₅, and small p-groups; distinguish permutation degree from group order.
For this problem type. Common examples include cyclic orders under 30, polygons with 3–12 sides, and permutations on 3–5 letters. Group order and permutation degree measure different things.
Focal example. The code above passed its displayed check in 0.887 ms on Node.
Related workload in this unit.structures.symmetric.orderStatistics · permuted points. Baseline test points across courses 2, 3, 4, 5. Count every permutation by order; the histogram totals n! and contains one identity.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 7 (73.20 ms, 89.4 MiB peak process RSS). Library refusal at 8. The first sampled passing call above 100 ms used 6 (157 ms). An explicit order histogram visits group elements. Sₙ has n! elements. A formula for the order of Sₙ avoids this enumeration.
Measured times, memory and outcomes
permuted points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
1.16
75.6
3
Baseline
Passed
1.36
75.1
4
Baseline
Passed
2.07
75.2
5
Baseline
Passed
10.28
80.6
6
Stretch
Passed
157
90.6
7
Stretch
Passed
73.20
89.4
8
Stretch
Library refusal · RangeError: the group has more than 20000 elements
26.99
90.1
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.alternating · 27 passing test cases, 6 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
console.log(structures.Zn(15).unitGroup().text);
Checked output
C2 × C4
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Permutation groups such as S₃, S₄ or A₅, and small p-groups; distinguish permutation degree from group order.
Focal example. The code above passed its displayed check in 0.297 ms on Node.
Related workload in this unit.structures.Zn.units · modulus. Baseline test points across courses 2, 6, 12, 30. Enumerate the residues independently and select those coprime to n by Euclid's algorithm.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 10,000 (22.59 ms, 87 MiB peak process RSS). The runs did not locate a ceiling for this family. Enumerating units or ideals scales with the size of the residue ring. A large modulus encoded in a few digits can still imply a large list.
Measured times, memory and outcomes
modulus · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.373
74.3
6
Baseline
Passed
0.611
75.5
12
Baseline
Passed
0.473
75.1
30
Baseline
Passed
0.541
75
120
Stretch
Passed
1.29
74.5
1,000
Stretch
Passed
6.59
76.5
10,000
Stretch
Passed
22.59
87
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.Zn · 3 passing test cases, 4 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as numtheory from "@ratmath/numtheory";
console.log(numtheory.totient(360));
Checked output
96n
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Permutation groups such as S₃, S₄ or A₅, and small p-groups; distinguish permutation degree from group order.
For this problem type. Typical hand examples are positive integers up to thousands. For computation, distinguish a known-factor input or prime-count endpoint from a hard semiprime.
Focal example. The code above passed its displayed check in 0.124 ms on Node.
Related workload in this unit.numtheory.factor · known semiprime. Baseline test points across courses 15, 77, 899, 10,403. Recover both planted prime factors, including exponent one.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,036,000,099 (5.12 ms, 77 MiB peak process RSS). The runs did not locate a ceiling for this family. Equal-length integers can have very different factoring times. These planted semiprimes give sample timings, with no general bound for the next integer.
Measured times, memory and outcomes
known semiprime · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
15
Baseline
Passed
0.331
76
77
Baseline
Passed
0.309
76.3
899
Baseline
Passed
0.298
74.9
10,403
Baseline
Passed
0.327
75.7
1,022,117
Stretch
Passed
0.397
75.8
100,160,063
Stretch
Passed
0.922
75.4
1,000,036,000,099
Stretch
Passed
5.12
77
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
numtheory.totient · 1 passing test case, 6 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as numtheory from "@ratmath/numtheory";
console.log(numtheory.primitiveRoot(13));
Checked output
2n
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Permutation groups such as S₃, S₄ or A₅, and small p-groups; distinguish permutation degree from group order.
For this problem type. Use small moduli, often 2–200, and one to four congruences or trial residues. Verify coprimality or primality when required.
Focal example. The code above passed its displayed check in 0.164 ms on Node.
Same API, measured input family.numtheory.primitiveRoot · prime modulus. Baseline test points across courses 3, 5, 7, 11, 23. Powers of a primitive root must visit every nonzero residue modulo p.
Practical limit. Largest passing sample 10,007 (0.286 ms, 75.6 MiB peak process RSS). The runs did not locate a ceiling for this family. Primitive roots exist for prime moduli here. Composite moduli need existence checks. Generating and retaining every power is linear in the group order.
Measured times, memory and outcomes
prime modulus · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
3
Baseline
Passed
0.244
75.7
5
Baseline
Passed
0.247
75.4
7
Baseline
Passed
0.373
75.4
11
Baseline
Passed
0.335
74.6
23
Baseline
Passed
0.406
74.9
101
Stretch
Passed
0.302
75.7
1,009
Stretch
Passed
0.283
73.9
10,007
Stretch
Passed
0.286
75.6
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Day 30 / 40 · Finite group structure
Cycle index
Direct calculation@ratmath/discrete
Problem
Write the cycle index of the rotation group of a square acting on its vertices.
Worked solution
Identity , quarter turns (twice), half turn : .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as discrete from "@ratmath/discrete";
console.log(String(discrete.cycleIndex(discrete.symmetry.cyclic(4))));
Checked output
(1/2) s4 + (1/4) s2^2 + (1/4) s1^4
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Permutation groups such as S₃, S₄ or A₅, and small p-groups; distinguish permutation degree from group order.
Focal example. The code above passed its displayed check in 0.240 ms on Node.
Related workload in this unit.structures.symmetric.orderStatistics · permuted points. Baseline test points across courses 2, 3, 4, 5. Count every permutation by order; the histogram totals n! and contains one identity.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 7 (73.20 ms, 89.4 MiB peak process RSS). Library refusal at 8. The first sampled passing call above 100 ms used 6 (157 ms). An explicit order histogram visits group elements. Sₙ has n! elements. A formula for the order of Sₙ avoids this enumeration.
Measured times, memory and outcomes
permuted points · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
1.16
75.6
3
Baseline
Passed
1.36
75.1
4
Baseline
Passed
2.07
75.2
5
Baseline
Passed
10.28
80.6
6
Stretch
Passed
157
90.6
7
Stretch
Passed
73.20
89.4
8
Stretch
Library refusal · RangeError: the group has more than 20000 elements
26.99
90.1
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
discrete.cycleIndex · 1 passing test case, 1 distinct argument description
The first multiple that kills both components is lcm(4,6).
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as numtheory from "@ratmath/numtheory";
console.log(numtheory.lcm(4,6));
Checked output
12n
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Permutation groups such as S₃, S₄ or A₅, and small p-groups; distinguish permutation degree from group order.
Focal example. The code above passed its displayed check in 0.077 ms on Node.
Related workload in this unit.numtheory.factor · known semiprime. Baseline test points across courses 15, 77, 899, 10,403. Recover both planted prime factors, including exponent one.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,036,000,099 (5.12 ms, 77 MiB peak process RSS). The runs did not locate a ceiling for this family. Equal-length integers can have very different factoring times. These planted semiprimes give sample timings, with no general bound for the next integer.
Measured times, memory and outcomes
known semiprime · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
15
Baseline
Passed
0.331
76
77
Baseline
Passed
0.309
76.3
899
Baseline
Passed
0.298
74.9
10,403
Baseline
Passed
0.327
75.7
1,022,117
Stretch
Passed
0.397
75.8
100,160,063
Stretch
Passed
0.922
75.4
1,000,036,000,099
Stretch
Passed
5.12
77
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
numtheory.lcm · 1 passing test case, 1 distinct argument description
In a group of order 21 how many Sylow 7-subgroups are possible?
Worked solution
The count divides 3 and is 1 modulo 7. Only 1 qualifies, so the subgroup is normal.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Permutation groups such as S₃, S₄ or A₅, and small p-groups; distinguish permutation degree from group order.
For this problem type. Common examples include cyclic orders under 30, polygons with 3–12 sides, and permutations on 3–5 letters. Group order and permutation degree measure different things.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 33 / 40 · Rings and fields
Zero divisors and units
Direct calculation@ratmath/structures
Problem
List the zero divisors and the units of .
Worked solution
Zero divisors: 2, 3, 4 (, ), plus 0 if counted. Units: 1, 5.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
const R = structures.Zn(6);
console.log([R.elements().filter((x) => R.isZeroDivisor(x)).map(String), R.units().map(String)]);
Checked output
[["0", "2", "3", "4"], ["1", "5"]]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Residue rings with moduli roughly 2–30, and small polynomial or Gaussian-integer examples.
Focal example. The code above passed its displayed check in 0.198 ms on Node.
Same API, measured input family.structures.Zn.units · modulus. Baseline test points across courses 2, 6, 12, 30. Enumerate the residues independently and select those coprime to n by Euclid's algorithm.
Practical limit. Largest passing sample 10,000 (22.59 ms, 87 MiB peak process RSS). The runs did not locate a ceiling for this family. Enumerating units or ideals scales with the size of the residue ring. A large modulus encoded in a few digits can still imply a large list.
Measured times, memory and outcomes
modulus · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.373
74.3
6
Baseline
Passed
0.611
75.5
12
Baseline
Passed
0.473
75.1
30
Baseline
Passed
0.541
75
120
Stretch
Passed
1.29
74.5
1,000
Stretch
Passed
6.59
76.5
10,000
Stretch
Passed
22.59
87
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.Zn · 3 passing test cases, 4 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
const R = structures.Zn(7);
console.log([R.isField, String(R.inverse(3))]);
Checked output
[true, "5"]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Residue rings with moduli roughly 2–30, and small polynomial or Gaussian-integer examples.
Focal example. The code above passed its displayed check in 0.132 ms on Node.
Related workload in this unit.structures.Zn.units · modulus. Baseline test points across courses 2, 6, 12, 30. Enumerate the residues independently and select those coprime to n by Euclid's algorithm.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 10,000 (22.59 ms, 87 MiB peak process RSS). The runs did not locate a ceiling for this family. Enumerating units or ideals scales with the size of the residue ring. A large modulus encoded in a few digits can still imply a large list.
Measured times, memory and outcomes
modulus · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.373
74.3
6
Baseline
Passed
0.611
75.5
12
Baseline
Passed
0.473
75.1
30
Baseline
Passed
0.541
75
120
Stretch
Passed
1.29
74.5
1,000
Stretch
Passed
6.59
76.5
10,000
Stretch
Passed
22.59
87
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.Zn · 3 passing test cases, 4 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
const f = structures.gaussianIntegers().factor(5);
console.log([String(f.unit), f.factors.map((x) => `${x.prime}^${x.exponent}`)]);
Checked output
["1", ["2 − i^1", "2 + i^1"]]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Residue rings with moduli roughly 2–30, and small polynomial or Gaussian-integer examples.
Focal example. The code above passed its displayed check in 1.53 ms on Node.
Related workload in this unit.structures.Zn.units · modulus. Baseline test points across courses 2, 6, 12, 30. Enumerate the residues independently and select those coprime to n by Euclid's algorithm.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 10,000 (22.59 ms, 87 MiB peak process RSS). The runs did not locate a ceiling for this family. Enumerating units or ideals scales with the size of the residue ring. A large modulus encoded in a few digits can still imply a large list.
Measured times, memory and outcomes
modulus · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.373
74.3
6
Baseline
Passed
0.611
75.5
12
Baseline
Passed
0.473
75.1
30
Baseline
Passed
0.541
75
120
Stretch
Passed
1.29
74.5
1,000
Stretch
Passed
6.59
76.5
10,000
Stretch
Passed
22.59
87
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.gaussianIntegers · 3 passing test cases, 1 distinct argument description
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
const P = structures.polynomialDomain("x");
console.log(String(structures.gcd(P.from("x^3 - 1"), P.from("x^2 - 1"))));
Checked output
x − 1
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Residue rings with moduli roughly 2–30, and small polynomial or Gaussian-integer examples.
Focal example. The code above passed its displayed check in 0.393 ms on Node.
Related workload in this unit.structures.Zn.units · modulus. Baseline test points across courses 2, 6, 12, 30. Enumerate the residues independently and select those coprime to n by Euclid's algorithm.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 10,000 (22.59 ms, 87 MiB peak process RSS). The runs did not locate a ceiling for this family. Enumerating units or ideals scales with the size of the residue ring. A large modulus encoded in a few digits can still imply a large list.
Measured times, memory and outcomes
modulus · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.373
74.3
6
Baseline
Passed
0.611
75.5
12
Baseline
Passed
0.473
75.1
30
Baseline
Passed
0.541
75
120
Stretch
Passed
1.29
74.5
1,000
Stretch
Passed
6.59
76.5
10,000
Stretch
Passed
22.59
87
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.polynomialDomain · 1 passing test case, 1 distinct argument description
is irreducible, so is maximal: a field (). : in the quotient, so it is not a domain.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
const R = structures.ring(["x"]);
const Q = (f) => structures.ideal(R, [R.poly(f)]).quotientRing();
console.log([Q("x^2 + 1").isField(), Q("x^2 - 1").isIntegralDomain()]);
Checked output
[true, false]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Residue rings with moduli roughly 2–30, and small polynomial or Gaussian-integer examples.
Focal example. The code above passed its displayed check in 2.83 ms on Node.
Related workload in this unit.structures.Zn.units · modulus. Baseline test points across courses 2, 6, 12, 30. Enumerate the residues independently and select those coprime to n by Euclid's algorithm.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 10,000 (22.59 ms, 87 MiB peak process RSS). The runs did not locate a ceiling for this family. Enumerating units or ideals scales with the size of the residue ring. A large modulus encoded in a few digits can still imply a large list.
Measured times, memory and outcomes
modulus · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.373
74.3
6
Baseline
Passed
0.611
75.5
12
Baseline
Passed
0.473
75.1
30
Baseline
Passed
0.541
75
120
Stretch
Passed
1.29
74.5
1,000
Stretch
Passed
6.59
76.5
10,000
Stretch
Passed
22.59
87
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.ring · 27 passing test cases, 30 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as structures from "@ratmath/structures";
const F = structures.galoisField(2, 3, [1, 1, 0, 1]);
console.log(F.format(F.inv(F.add(F.gen, F.one))));
Checked output
a² + a
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Residue rings with moduli roughly 2–30, and small polynomial or Gaussian-integer examples.
For this problem type. Use characteristic 2, 3, 5 or 7 and extension degrees typically 2–4. Listing every element costs pᵈ entries.
Focal example. The code above passed its displayed check in 0.517 ms on Node.
Same API, measured input family.structures.galoisField · prime characteristic. Baseline test points across courses 2, 3, 5, 7. Choose an irreducible quadratic over F_p. Exhaustively check a·a⁻¹=1 for each nonzero field element.
Practical limit. Largest passing sample 31 (17.96 ms, 88.5 MiB peak process RSS). The runs did not locate a ceiling for this family. At fixed extension degree two the field already has p² elements. Exhaustive field checks scale with pᵈ at degree d.
Measured times, memory and outcomes
prime characteristic · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.246
75
3
Baseline
Passed
0.302
75.4
5
Baseline
Passed
0.735
75.8
7
Baseline
Passed
3.06
75.8
11
Stretch
Passed
1.63
76.9
19
Stretch
Passed
9.46
80.9
31
Stretch
Passed
17.96
88.5
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
structures.galoisField · 1 passing test case, 1 distinct argument description
What is the sum of the ideals (6) and (10) in the integers?
Worked solution
It is generated by gcd(6,10)=2. Bézout expresses this generator as a sum from the two ideals.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as numtheory from "@ratmath/numtheory";
console.log(numtheory.gcd(6,10));
Checked output
2n
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Residue rings with moduli roughly 2–30, and small polynomial or Gaussian-integer examples.
Focal example. The code above passed its displayed check in 0.083 ms on Node.
Same API, measured input family.numtheory.gcd · operand bits. Baseline test points across courses 4, 8, 16, 32. Consecutive integers m,m+1 are coprime, so gcd(7m,7(m+1))=7.
Practical limit. Largest passing sample 32,768 (0.183 ms, 75.3 MiB peak process RSS). The runs did not locate a ceiling for this family. Euclidean reduction depends on operand size and their quotient sequence. Consecutive Fibonacci numbers need more steps than many inputs of the same bit length.
Measured times, memory and outcomes
operand bits · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
4
Baseline
Passed
0.171
74.8
8
Baseline
Passed
0.132
74.7
16
Baseline
Passed
0.129
74.8
32
Baseline
Passed
0.131
76.2
256
Stretch
Passed
0.124
74.5
4,096
Stretch
Passed
0.165
74.9
32,768
Stretch
Passed
0.183
75.3
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
numtheory.gcd · 1 passing test case, 1 distinct argument description
Why can a finite integral domain with identity be shown to be a field?
Worked solution
Multiplication by any nonzero element is injective, hence surjective on a finite set. In particular 1 is in its image.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Residue rings with moduli roughly 2–30, and small polynomial or Gaussian-integer examples.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.