Lesson
The theory — Stargate Address Math Dialer
A gate address is an ordered selection without repetition — a permutation. Order matters (the same symbols dialled in a different sequence are a different address) and no symbol repeats, which is exactly the case counted by P(n, k) = n! / (n − k)!.
What each symbol means
n- the number of symbols available on the ring:
39. k- how many are dialled:
7. P(n, k)- the count of ordered selections,
39! / 32! = 77,519,922,480. destinations- the smaller count,
1,987,690,320— addresses that actually go somewhere, once one of the seven is spoken for.
Where the formula comes from
- Count the dialling directly. The first symbol has 39 choices; the second has 38, because no symbol repeats; the third 37, and so on for seven picks.
- Multiplying:
39 × 38 × 37 × 36 × 35 × 34 × 33. Written with factorials that is39! / 32!, since the trailing32!is precisely the part not used — which is the formula displayed above,= 77,519,922,480. - Now fix the last glyph as the point of origin, and only six are free from the remaining 38:
P(38, 6) = 38 × 37 × 36 × 35 × 34 × 33 = 1,987,690,320. That is the second number, and it is exactly the first divided by 39.
How to read what you see
Two counts side by side with the formula between them. Divide one by the other and you get exactly 39, which is the arithmetic signature of having reserved one of the seven slots.
- Assumes
- That no symbol repeats and that order matters. Drop the first and you would raise 39 to the seventh power instead; drop the second and you would be counting combinations, which for 7 of 39 is smaller by a factor of
7! = 5040. - Breaks when
- Large counts flatter a search. Nearly two billion addresses sounds like an inexhaustible galaxy, but a permutation count says nothing about how many are valid — most sequences would point nowhere at all, exactly as most seven-letter strings are not words. Counting the possibilities is the easy half; knowing which ones mean something is the hard half, and no factorial will tell you.
Problem solved in full
-
Checksum for a 7-glyph preset weighted by 17( i + 3) 8 steps
The 7-glyph (stable) preset dials 3, 9, 17, 21, 28, 35, 1. The panel weights the glyph in slot i — counting from zero — by 17(i + 3), adds, and reduces mod 97. Work out the checksum by hand; then decide whether dialling two of those glyphs the wrong way round could ever pass unnoticed.
-
Write the weights out first, because everything after this is arithmetic on them. Seven slots, seven weights, and they climb in steps of exactly 17 — that regularity is the whole engine of the proof at the end.
-
Multiply each glyph number by its slot's weight and add. Nothing is modular yet; this is an ordinary sum, and the 17 could be factored out of every term if you preferred.
-
Now divide by 97 and keep the remainder: 129 whole 97s fit inside 12,597 and leave 84. That is what the Checksum (mod 97) tile reads, and it is the last figure this derivation takes from the tool; everything below is yours.
-
Here is the question the tile cannot answer. Swap the glyphs in slots i and j: every other term in the sum is untouched, so the total moves by one amount only — the two glyphs have traded weights. Expand it and the difference of the weights collapses to 17(i − j), because the weights are an arithmetic progression with common difference 17.
-
Test that formula rather than trusting it. Slots 0 and 1 hold 3 and 9, so Δ = 17(0 − 1)(9 − 3) = −102, and −102 leaves 92 mod 97 — predicting 84 + 92 = 176, which is 79. Ask the tool for the same seven glyphs with the first two exchanged,
?address=9,3,17,21,28,35,1, and the tile reads 79. -
For a swap to slip past, Δ must be not merely small but zero mod 97 — the checksum has to land on 84 again. So 97 must divide 17(i − j)(vj − vi). 97 is prime and does not divide 17, and a product is a multiple of a prime only if one of its factors already is: so 97 must divide the slot gap or the glyph gap on its own.
-
Neither can supply it. Two different slots are at most 8 apart, because there are at most nine chevrons; two different glyphs drawn from 1 to 39 differ by at most 38. Both gaps are non-zero and both are smaller than 97, so Δ is never 0 mod 97. No transposition of two glyphs is invisible to this checksum — not for this address, and not for any address you can dial, because nine chevrons is what keeps the slot gap under 97. Hand the tool a longer address through the URL and that guarantee is the first thing to go.
-
Catching every transposition is not the same as certifying the address, and this is where the tile quietly oversells itself. Of the 5,039 other orderings of these same seven glyphs, 62 also come out at 84 — where 97 equal buckets would give about 52. Roughly one wrong order in a hundred reads as correct. It rejects the commonest mis-dial and nothing more.
Answer
84 — and no swap of two glyphs can ever leave it at 84. That guarantee is a bound, though, not a property of checksums: it holds only while 97 is bigger than both the longest slot gap and the widest glyph difference. Widen the ring to 98 glyphs and it dies at once — 1, 98, 17, 21, 28, 35, 3 and 98, 1, 17, 21, 28, 35, 3 both check as 35, because their gap of 97 is annihilated by the modulus (computed here; the tool's ring stops at 39). That is precisely why IBAN check digits are taken mod 97 rather than mod 10: pick a prime larger than anything the field can vary by and every transposition is forced to show. The tool computes the checksum and says nothing about what it catches, and the 62-in-5,039 figure is the second thing it never computes — the one that stops you trusting the tile.
-
References (1)
- Ordered selections without repetition, which is what P(n, k) counts: I. Niven, "Permutations and Combinations," in Mathematics of Choice: How to Count Without Counting, 7–26. Mathematical Association of America.