diff --git a/contents/euclidean_algorithm/euclidean_algorithm.md b/contents/euclidean_algorithm/euclidean_algorithm.md index 4ff49152f..26c308501 100644 --- a/contents/euclidean_algorithm/euclidean_algorithm.md +++ b/contents/euclidean_algorithm/euclidean_algorithm.md @@ -166,6 +166,12 @@ Here's a video on the Euclidean algorithm: +## Proof + +Some intuition as to why the Euclidean Algorithm works lies in it's proof. Only a proof for the subtraction method will be given at this point, but the modular version follows the same line of reasoning. + +Given two positive integers $$a$$ and $$b$$, they have a greatest common divisor $$d$$. There is always a common divisor, because every number is divisable by 1. Since $$a$$ and $$b$$ is divisable by $$d$$, $$a - b$$ is also divisable by $$d$$ ($$b < a$$). Let's call this value $$c$$. Now we once more have two numbers $$b$$ and $$c$$, which are both divisable by $$d$$. This process can be continued until the values are equal: this is the greatest common divisor $$d$$. + ## Example Code {% method %}