next up previous
Next: Up: Previous:

Analysis

For any integer \(k \geq 1\), if \(a > b \geq 0\) and b < Fk+1, then Euclid(a,b) makes fewer than k recursive calls.

Remember that \(F_k \;=\; F_{k-1} \;+\; F_{k-2}\), \(F_k \approx \frac{\phi^k}{\sqrt{5}}\), \(\phi \;=\; \frac{1+\sqrt{5}}{2}\)

\(b \;<\; F_{k+1} \;=\; \frac{\phi^{k+1}}{\sqrt{5}}\), \(b \;<\; \frac{\phi \phi^k}{\sqrt{5}}\)
\(\phi^k \;>\; \frac{\sqrt{5}}{\phi}b\), \(k \;>\; log_{\phi} \frac{\sqrt{5}}{\phi}b\)
k = O(lg b) recursive calls
O(
$\beta$) arithmetic operations
O(
\(\beta^3\)) bit operations


next up previous
Next: Up: Previous: