//Root macro to calculate pi using monte-carlo simulation. Edited version of montecarlo.C with some new attempts. { vector nTotal = {100,1000,10000,100000,1000000}; int circle_points = 0; int square_points = 0; TRandom3 rand(0); for (Int_t i = 0; i < nTotal.size(); i++){ for (Int_t j = 0; j < nTotal[i]; j++){ Double_t x = rand.Rndm(); Double_t y = rand.Rndm(); Double_t distance = x*x + y*y; if (distance <= 1) circle_points++; square_points++; } } Double_t pi = double(4*circle_points)/(square_points); cout<