Skip to content

Commit 0094739

Browse files
authored
Update README.markdown
1 parent 263faef commit 0094739

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Miller-Rabin Primality Test/README.markdown

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ In 1976, Gray Miller introduced an algorithm, through his ph.d thesis[1], which
44

55
## Probabilistic
66

7-
The result of the test is simply a boolean. However, `true` does not implicate *the number is prime*. In fact, it means *the number is **probably** prime*. But `false` does mean *the number is composite*.
7+
The result of the test is simply a boolean. However, `true` does not implicate _the number is prime_. In fact, it means _the number is **probably** prime_. But `false` does mean _the number is composite_.
88

9-
In order to increase the accuracy of the test, it needs to be iterated few times. If it returns `true` in every single iteration, than we can say with confidence that *the number is pro......bably prime*.
9+
In order to increase the accuracy of the test, it needs to be iterated few times. If it returns `true` in every single iteration, than we can say with confidence that _the number is pro......bably prime_.
1010

1111
## Algorithm
1212

@@ -16,7 +16,7 @@ Now make a sequence, in modulo `n`, as following:
1616

1717
> a^d, a^(2·d), a^(4·d), ... , a^((2^(s-1))·d), a^((2^s)·d) = a^(n-1)
1818
19-
And we say the number `n` passes the test, *probably prime*, if 1) `a^d` is congruence to `1` in modulo `n`, or 2) `a^((2^k)·d)` is congruence to `-1` for some `k = 1, 2, ..., s-1`.
19+
And we say the number `n` passes the test, _probably prime_, if 1) `a^d` is congruence to `1` in modulo `n`, or 2) `a^((2^k)·d)` is congruence to `-1` for some `k = 1, 2, ..., s-1`.
2020

2121
### Pseudo Code
2222

@@ -32,11 +32,11 @@ mrPrimalityTest(7, iteration: 10) // test if 7 is prime & iterate 10 times
3232
```
3333

3434
## Reference
35-
1. G. L. Miller, "Riemann's Hypothesis and Tests for Primality". *J. Comput. System Sci.* 13 (1976), 300-317.
36-
2. M. O. Rabin, "Probabilistic algorithm for testing primality". *Journal of Number Theory.* 12 (1980), 128-138.
35+
1. G. L. Miller, "Riemann's Hypothesis and Tests for Primality". _J. Comput. System Sci._ 13 (1976), 300-317.
36+
2. M. O. Rabin, "Probabilistic algorithm for testing primality". _Journal of Number Theory._ 12 (1980), 128-138.
3737
3. Miller–Rabin primality test - Wikipedia, the free encyclopedia
3838

39-
*Written for Swift Algorithm Club by **Sahn Cha**, @scha00*
39+
_Written for Swift Algorithm Club by **Sahn Cha**, @scha00_
4040

4141
[1]: https://cs.uwaterloo.ca/research/tr/1975/CS-75-27.pdf
4242
[2]: http://www.sciencedirect.com/science/article/pii/0022314X80900840

0 commit comments

Comments
 (0)