Euclidean algorithm
From Maths
Revision as of 08:52, 21 May 2015 by Alec (Talk | contribs) (Created page with "'''Note:''' this is an algorithm for computing the GCD of two positive integers ==Definition== The algorithm is as follows<ref>The mathematics of ciphers, Number theory a...")
Note: this is an algorithm for computing the GCD of two positive integers
Contents
Definition
The algorithm is as follows[1]:
Input | [ilmath]a,b\in\mathbb{N}_+[/ilmath], such that [ilmath]a\ge b[/ilmath] (swap them around if [ilmath]a< b[/ilmath]) |
---|---|
Output | The GCD of [ilmath]a[/ilmath] and [ilmath]b[/ilmath] |
Process |
|
Proofs of correctness
TODO: These proofs
The algorithm terminates
Given this algorithm loops until [ilmath]R=0[/ilmath] it is important to know for certain that eventually we will have [ilmath]R=0[/ilmath]
The algorithm computes the GCD
Equally important is the proof that the algorithm always outputs the GCD of [ilmath]a[/ilmath] and [ilmath]b[/ilmath]
References
- ↑ The mathematics of ciphers, Number theory and RSA cryptography - S. C. Coutinho