ri is used as in the asynchronous case to indicate which register the ith processor is inspecting. Bits in italics are randomly generated.
r0 r1 R0 R1 B0 B1 C0 C1 r0 r1
0 0 0 0 0 1
subcase 3 0 1 0 0 1 1 1 1 1 0
subcase 3 1 0 1 1 0 0 0 0 0 1
subcase 3 0 1 0 0 0 0 0 0 1 0
subcase 3 1 0 0 0 1 0 0 1 0 1
subcase 2/3 0 1 0 1 1 1 # 1 - 0
subcase 1 - 0 - # halt
So I gave most of the credit for this part of the problem to any computation that basically made sense, and also liberalized the grading scale a bit.
The other generators are the residues in odd-numbered positions of this list (assuming that the first list position is position 1).
GCD(17,10) 1 = 17(3) + 10(-5) GCD(10, 7) 1 = 10(-2) + 7(3) GCD( 7, 3) 1 = 7(1) + 3(-2) GCD( 3, 1) 1 = 3(0) + 1(1) GCD( 1, 0)So the reciprocal of 10 mod 17 is -5, or 12, which agrees with the value calculated above. And the reciprocal of 17 mod 10 is 3.
EXTRA CREDIT:
(n-1)(n-2)b2/2 + b[b(n-1)], or
[b2/2][(n-1)(n-2) + 2(n-1)], or
[b2/2][n(n-1)]
which is equal to the desired value.
These terms increase by roughly a factor of 4. By comparing the coefficients with the powers of 4, the hypothesis sk = (4k-1)b2 / 3 is suggested. This may be verified by an easy induction:
Note that in terms of n, the time cost is (n2-1)b2 / 3, or about 2/3 of the cost of computing the nth power directly from the definition.
These terms are just less by k than the terms of the previous sequence (noting that the previous sequence begins at k=0 and not k=1). This suggests that sk = [-k+(4k-1)/3]b2. This may be verified easily by induction:
[-k+1+(4k-1-1)/3]b2 + [b2k-1-1][b2k-1-1]?? + [b2k-2][b]??, or
[b2/3][(4k-1-3k+2) + 3(4k-1-2k+1) + 3(2k-2)], or
[b2/3][4(4k-1)-3k+2+3-6], or
[b2/3][4k-3k-1]
which is equal to the desired value.Note that in terms of n, the time cost is [(n+1)2-3log2(n+1)+-1][b2/3], or [-log2(n+1)+(n2+2n)/3]b2, which is once again about 2/3 of the cost of computing the nth power directly from the definition.
1281 = 128 1282 = 82 1283 = 46 1286 = 26 12812 = 49 12824 = 102 12825 = 98 12850 = 199 12851 = 183 128102 = 49 128103 = 2
22 = 4 24 = 16 25 = 32 210 = 1024 220 = 5677 221 = 5183 242 = 1126 284 = 2821 285 = 5642 2170 = 2146 2171 = 4292
42922 = 829 42924 = 2260 42928 = 4183 429216 = 2704 429232 = 5152 429264 = 1633 429265 = 4751 4292130 = 4654 4292131 = 5612Note that 5612 is not the original message. So the problem with assuming that Carmichael numbers are prime is not with the security of the method, but with its accuracy. In other words, the algorithm will fail obviously and early on, with high probability.
The computation will differ for the other test, depending on the value of x. But for example, if x = 01010100112 = 339, then 3x = 1017, and the exponentiation algorithm would start with the witness 2 and compute the powers of 2 with exponents 2, 3, 6, 7, 14, 15, 30, 31, 62, 63, 126, 127, 254, 508, and 1016. The respective powers are 4, 8, 64, 128, 112, 224, 343, 686, 742, 467, 451, 902, 4, 16, and 256. Since this last power is not 1, we may safely conclude that 1017 is composite. For other values of 3x, additional witnesses may be required.