A Clock (Modular) Arithmetic Renaming Calculator
Here is a calculator for finding different "names"
of a whole number on a clock with a given number of hours.
(In mathematical terminology, it finds congruent integers
for a given modulus.)
If this doesn't make any sense to you,
here's an explanation of what
clock arithmetic is,
with an interactive clock that shows the different names
for a number on a clock in another way.
Instructions
- Type the number you want another name for in the first box.
- Type the number of hours on the clock you want to use in the
second box (after "mod").
- Click the "=" button to get the smallest nonnegative
"name" for the first number on the clock.
- If you want a bigger name, click the "up" button.
If you want a smaller name, click the "down" button.
Problems? Got an "E"?
- All numbers must be whole numbers. The first number
can be positive, negative, or 0.
- The number of hours on the clock (modulus) must be a
whole number at least 2.
- If you type in a number bigger than the box, it will turn to
an "E" (for Error) because thill turn to
an "E" (for Error) because this computer program can't handle
numbers above a certain size.
- You have to click "=" or hit the return key after typing
for the program to calculate anything.
Technical mathematical comments
- The notation is not quite standard; the "mod m" part should
come at the end of the sentence, not in the middle.
And you should use the congruent symbol (3 horizontal bars)
instead of the = sign.
Technical computer comments
- This program uses the built-in java mod (%) operator.
Because of limitations on the size of integers in java,
this applet can't handle very big numbers. Maybe someday
I'll fix it to deal with very long integers.
- The source code.
Comments welcome:
susan@math.csusb.edu
To:
Susan Addington's Home Page
The
Number Bracelets Page (a game to play with modular arithmetic)
CSUSB Math Dept. Home Page