Suppose you had a 13 hour clock, labeled 0 to 12. Start at 0 and go counterclockwise 104
hours (since you went counterclockise, that's -104 hours. Youl'll find
yourself ack at 0 (since 104/13=8). But wait, we
went too far, so go clockwise 3 hours and we'll see that the clock
reads 3 for...
-------------------------------------
It's a dwarf integer.
Dammit, why does it complain that my message is too short?
Here I'm trying to post a witty response and I have to put up with this crap. Dammit, still need 4 more characters. Oh wait, I just realizes, my message was too...
Oh, I forgot to mentio: if you don't like A=1, pick another.
In a linear congruence, if A is a solution, so is A+Y,
or A+nY, for that matter. So we can chose any A, as
long as it's a multiple of four plus one.
For instance, we can pick A=1001 and recalculate B
(B=834), giving us: 1001*9...
To solve for 12345, re-arrange your formula to
(AX-M)/Y=-B
In this form, iy's a Linear Congruence, so you can use the Modular Inverse
of X&Y to find A as follows:
A = invert(X,Y)*M (mod Y) = 1*12345%4 = 1
then solve fo B: (1*9-12345)/4=-B
-3084 = -B
B = 3084Be careful, though. You CAN...
Good. Now you know that the successor of 0mod4 is 1mod4. Now you just need to find the successor of 1mod4. When you have figured out the successor rules, you just need to find the initial state. Then, with the successor rules in hand, you can build a state machine. As uou already know, not every...