Let S be the square centered at the origin with sides of length 2, and C...

Free

70.2K

Verified Solution

Question

Basic Math

Let S be the square centered at the origin with sides of length2, and C be the unit circle centered at the origin.

(a) If you randomly throw a point on S, what is the probabilitythat it will lie in C?

Ans: 0.785

(b) Describe how you could use simulation to estimate theprobability in part (a).

(c) How can you use simulation to estimate a?

For part b and c, there maybe a need to generate randomvariables for the simulation by Box-Muller, Accept/Reject orimportance sampling. Any help on b and c will be appreciated !

Answer & Explanation Solved by verified expert
3.6 Ratings (643 Votes)

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)


Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students