How many steps before the euclidean algorithm terminates?

935 Views Asked by At

Before disregarding my question and tagging it as duplicate. Please consider that I have read the similar posts on this, but I couldn't wrap my head around the hints proving the $2\log_2(b)$ part. Maybe I'm not smart enough or maybe I just got started with number theory. I am hoping to get a better hint and how I can relate the "halving" of the remainder every two steps with the value of b and $2\log_2(b)$.

Here are the posts that asked the same question on stackexchange that I have read:

(1)Show that the number of steps in the Euclidean algorithm is less than $\frac{2\log b}{\log 2}$

(2)Show that the Euclidean Algorithm terminates in less than seven times the number of digits in $b$.

My attempt on first part of the problem

proof of $r_{i+2} < \frac{1}{2}r_i:$

Let $a - bq_1 = r_1$ s.t. $b=r_0$

$(case 1):$ If $b=r_0< \frac{1}{2}a$ then $q_1 \geq 2$ so that $r_1 < r_0$. Furthermore, in $r_0 - r_1q_2 = r_2$, since $r_1 \leq \frac{1}{2}r_0$ then it must be that $q_2 \geq 2$ so that $r_2 < r_1$. Therefore, $r_2 < r_1 < \frac{1}{2}r_0$ or $r_{i+2}<r_{i+1}< \frac{1}{2}r_i$ or simply $r_{i+2}<\frac{1}{2}r_i$.

$(case 2):$ If $b=r_0> \frac{1}{2}a$ then $ a- r_0q_1 = r_1$ such that $r_1 < \frac{1}{2}a$ and $r_1 < r_0$ and $q_1=1$

$(subcase 2.1):$ If $r_1 > \frac{1}{2}r_0$ then definitely, $r_2 < \frac{1}{2}r_0$ or $r_{i+2}<\frac{1}{2}r_i$

$(subcase 2.2)$ If $r_1 < \frac{1}{2}r_0$ then $q_2 \geq 2$ so that $r_2 < r_1$. Therefore, $r_2<r_1< \frac{1}{2}r_0$ or $r_{i+2}<r_{i+1}< \frac{1}{2}r_i$

From here, I am struggling to apply logarithms to show the final step.