Sun's dial
Scroll or click + drag to spin dials. Use the slider or the text input to create a dial for any positive number. Click “save template” to download an image, which you can print to make a physical version
Joint with Dina Buric. Thanks to Jonathan Love for figuring out the key labeling
Using Sun’s dial
Sunzi’s remainder theorem, sometimes called the Chinese Remainder Theorem, posits that one can solve certain systems of modular equations. For example, suppose that $x$ satisfies the following equations
\[\begin{align} x&\equiv 2 \mod 5 \\ x&\equiv 3 \mod 7 \end{align}\]Then there is a solution for $x$, and any two solutions are congruent $\mod 5\cdot 7 = 35$. The earliest known use of this is a riddle in the 3rd century Chinese book Sunzi Suanjing, written by Sunzi (meaning “master Sun”, named after Sun Tzu, author of “art of war”). But how did Sunzi find $x$? Perhaps he used Sun’s dial, a mechanical mechanism that solves systems of modular equations. Simply line up the 2 tic on the inner 5 dial with the 3 tic on the outer 7 dial (See figure). Then read the arrow, which points to 17. Indeed, $17\equiv 2 \pmod 5$ and $17\equiv 3 \pmod 7$.
Solving a modular system on sun's dial of modulus 35.
Let’s try a system of three equations.
\[\begin{align} x&\equiv 2 \mod 3 \\ x&\equiv 3 \mod 4 \\ x&\equiv 2 \mod 5 \end{align}\]Sun’s remainder theorem suggests we can solve for $x\mod 3 \cdot 4 \cdot 5 = 60$. Here is Sun’s dial for 60, which has three wheels, and the steps for reading it.
Solving a modular system on sun's dial of modulus 60.
We work our way outwards. Step 1 is to spin the innermost wheel, to align the 2 tic on the 3 dial with the 3 tick on the 4 dial. The arrow from the 3 dial points to 11, meaning $x\equiv 11 \pmod{12}$. Then we move to the next disc. We align 11 on the $3*4$ disc to 2 on the 5 disc, and the arrow points to $47$. Therefore, the solution is $x \equiv 47 \pmod{60}$.
How it works
The magic of Sun’s dial comes from the labeling of the ticks, which is not in order. Let’s start with a blank dial, and rederive the labeling. (You can get a blank dial by unticking “draw labels”).
Unlabeled Sun's dial of modulus 35
As the arrows point to the numbers 0 through 34 on the outside ring, there is always exactly one pair of ticks which align. This is one part of Sunzi’s theorem. In modern language, this outside number represents a number in $\mathbb{Z}/35$, while the pair of inside ticks represents $\mathbb{Z}/5 \times \mathbb{Z}/7$. There is a bijection between these two sets, $\mathbb{Z}/35 \cong \mathbb{Z}/5 \times \mathbb{Z}/7$.
Sun’s dial is a decoder wheel, passing us between a number mod $35$ and a pair of a number mod $5$ and number mod $7$. You want to send your friend bob a message (a number $x \pmod{35}$ ), without carol knowing. So, you encrypt $x$ as a pair $(x\mod{5},\, x\mod{7})$, and pass those numbers to Bob. The only way to find $x$ is to solve a system of modular equations, but with Sun’s dial on hand, Bob has no trouble decoding your message.
Sun’s dial can be run in reverse, encoding $x$ by computing its value modulo 5 and modulo 7. Indeed, set the arrow to $x$ on the outer ring, and read off the numbers next to the tics that align (Try it!). Since it’s so easy to encode $x$, this lets us fill in our unlabeled dial. We start with 1, which is $1\pmod{5}$ and $1 \pmod{7}$.
Set the arrow to 1, then fill in 1 on the ticks that align
Next up is 2, which is $2\pmod{5}$ and $2 \pmod{7}$.
Set the arrow to 2, then fill in 2 on the ticks that align
And so on. Repeating this process, you label your Sun’s dial in no time. But we can do even better. Notice that the gap between 0 and 1 on the 5 dial is 2/5ths of a circle, which is the same as the gap between 1 and 2. After all $2 \pmod{35} = 2 \cdot 1 \pmod{35}$. So, the spacing of 2 from 0 should be double the spacing of 1 from 0 on every dial. A similar logic applies to $3$, and so on. All in all, the spacing between consecutive labels is constant. We start at zero, jump two spots and place 1, jump two spots and place 2, etc. The labeling is entirely determined by the placement of the $1$.
The spacing between consecutive labels is constant on each dial.
Let’s look more closely at the 1 position. When the arrow points to 1 on the outer circle, the ticks that align are $2/5$ around the circle on the 5 dial, and $3/7$ around the circle on the 7s dial. Adding these angles together, we learn
\[\frac{2}{5} - \frac{3}{7} = \frac{1}{35}\]multiplying through by 35, we obtain
\[\boxed{2 \cdot 7 - 3 \cdot 5 = 1}\]Since $5$ and $7$ are coprime, we know by Bezout’s identity that there were some integers $a,b$ such that $7a + 5b = 1$. Sun’s dial just mechanically solved for $a=2$ and $b=-3$!
The placement of the 1s mechanically solves Bezout's identity.
Bezout’s identity is the beating heart of Sunzi’s remainder theorem. When solving a system of modular equations algebraically, the first step is to solve Bezout’s identity. While Sun’s dial seemed to circumvent this, Bezout’s identity was hiding in the labeling. In general, the solution to Bezout’s identity provides the spacing of the labels around each dial. Encoding the number $1$ mechanically measures the spacing of the labels, and hence mechanically solves Bezout’s identity.
Build your own!
You can build your own of Sun’s dial for solving modular systems of any number you’d like. Simply set the number with the slider or text input to generate the dial. Click “save template” and print out your template. If you’d like to figure out the labels yourself, untick “draw labels” for an unlabeled template.
Template for sun's dial of modulus $60 = 3 \cdot 4 \cdot 5$.
Cut these circles out and stack them. Hold them together by punching all three through the center with a axel. I used a paper fastener. Then add the arrows. I taped toothpicks or cardboard arrows to the zero arm of the dial, extending it to point at the numbers on the next ring outwards. I recommend using study materials, either cardstock (if you have it) or glue the paper to cardboard. Here is my cardboard mockup:
A cardboard sun's dial of modulus 15.
The concept of Sun’s dial was born during the workshop on Integrating Research and Illustration in Number Theory, on Wednesday. That Friday, I gave a lightning talk where I passed out 30 of these to the participants of the workshop. Me, Dina, and Gioia were able to assembly line this many dials in a few hours.
Many sun's dials, made in a short time.