Question: Write a program that implements Euclid's extended algo- rithm. Then perform the following experiment: run it on a random selection of inputs of a
Write a program that implements Euclid's extended algo- rithm. Then perform the following experiment: run it on a random selection of inputs of a given size, for sizes bounded by some parameter N; compute the average number of steps of the algorithm for each input size n < N, and use gnuplot to plot the result. What does f(n)-which is the "average number of steps" of Euclid's extended algorithm on input size n-look like? Note that size is not the same as value; inputs of size n are inputs with a binary representation of n bits.
Step by Step Solution
3.46 Rating (156 Votes )
There are 3 Steps involved in it
Heres a Python implementation of Euclids extended algorithm and the experiment you described python import random import math import gnuplotpy def ext... View full answer
Get step-by-step solutions from verified subject matter experts
