Assignment - 2
Q5. According to Ernesto Cesaro given 2 randomly chosen integers x and y, the probability that gcd(x,y) = 1 is 6/(pi^2). The program generates n pairs of random numbers and find their GCD using Euclid's Algorithm and find the probability of the value becoming 1. It will then calculates the value of pi from the calculated probablity.
Number of pairs of numbers to be considered
g++ -std=gnu++11 Assign2Q8.5.cpp
./a.out
Name : Nileena P C RollNo : CS21M519 Email-ID : [email protected]