Next: The worse case: Fibonacci
Up: Analyzing the efficiency of
Previous: Analyzing the efficiency of
Let N be a fixed positive integer, and suppose that x and y
are positive integers in the interval [1,N] with
. Suppose
the Euclidean algorithm requires exactly
divisions to compute
. Then setting an=x and an-1=y, we may write out
the steps of the algorithm as follows:
where qi is the quotient when ai is divided by ai-1. The
last non-zero remainder a0 is the greatest common divisor of
x and y.
The information in the inputs x and y to the Euclidean
algorithm is measured by the number of binary digits in each. Thus,
measures the total
amount of input information.
David Hayes
2/4/1999