a)
probability = area of circle/ area of square = pi/4 = 0.785
b)
we can generate two random random numbers x and y from 0 to
1
and if sqrt(x^2+ y^2) < 1 , then we call it success , we can
simulate this or many trials
c)
code in python
import numpy as np
import matplotlib.pyplot as pl
trials = 10000
counts = 0
for i in range(trials):
x =
np.random.random()
y =
np.random.random()
x2 =
x**2
y2 =
y**2
x_y = x2 +
y2
dxy =
np.sqrt(x_y)
if dxy <=
1:
counts = counts + 1
print ("number of trial =" ,trials ,",required probability is
::",counts/trials)