Question

In: Math

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

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

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

Ans: 0.785

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

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

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

Solutions

Expert Solution

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)


Related Solutions

Let S ∈ R3 be the sphere of radius 1 centered on the origin. a) Prove...
Let S ∈ R3 be the sphere of radius 1 centered on the origin. a) Prove that there is at least one point of S at which the value of the x + y + z is the largest possible. b) Determine the point (s) whose existence was proved in the previous point, as well as the corresponding value of x + y + z.
Four lines from a square in the z = 0 plane, centered at the origin, with...
Four lines from a square in the z = 0 plane, centered at the origin, with a side length of 2a. The lines at x = a and x = -a have a positive charge density +λ0, and the lines at y = a and y = -a have a negative charge density −λ0. a. Find an expression for the potential at an arbitrary point (x, y, z). b. Use your result from part (a) to find the potential at...
a) Let D be the disk of radius 4 in the xy-plane centered at the origin....
a) Let D be the disk of radius 4 in the xy-plane centered at the origin. Find the biggest and the smallest values of the function f(x, y) = x 2 + y 2 + 2x − 4y on D. b) Let R be the triangle in the xy-plane with vertices at (0, 0),(10, 0) and (0, 20) (R includes the sides as well as the inside of the triangle). Find the biggest and the smallest values of the function...
A cube has sides of length L = 1.00 mm. One corner is at the origin....
A cube has sides of length L = 1.00 mm. One corner is at the origin. The nonuniform electric field is given by E~ = (19.00N/C ·m) x ˆi−(1.34N/C ·m) z ˆk. (a) find the electric flux through each of the six cube faces S1, S2, S3, S4, S5, S6. (b) Find the total electric charge inside the cube.
Consider a rhombus that is not square (i.e., the four sides all have the same length, but the angles between sides is not 90°).
Consider a rhombus that is not square (i.e., the four sides all have the same length, but the angles between sides is not 90°). Describe all the symmetries of the rhombus. Write down the Cayley table for the group of symmetries,
Three charges at the corners of a square of sides s = 3.40 m. Here, q1...
Three charges at the corners of a square of sides s = 3.40 m. Here, q1 = q2 = −q and q3 = −1.5q where q = 9.00 nC. q2 is at the top left of the square, q3 at the bottom left and q1 at the bottom right. (a) What is the magnitude of the electric field at the center of the square due to these three charges? (b) You now replace q1 in the square with another point...
Let C be a plane curve parameterized by arc length by α(s), T(s) its unit tangent...
Let C be a plane curve parameterized by arc length by α(s), T(s) its unit tangent vector and N(s) be its unit normal vector. Show d dsN(s) = −κ(s)T(s).
A point charge +q is at the origin. A spherical Gaussian surface centered at the origin...
A point charge +q is at the origin. A spherical Gaussian surface centered at the origin encloses +q. So does a cubical surface centered at the origin and with edges parallel to the axes. Select "True" or "False" for each statement below. 1. Suppose (for this statement only), that q is moved from the origin but is still within both the surfaces. The flux through both surfaces is changed. 2.If the radius of the spherical Gaussian Surface is varied, the...
A point charge +q is at the origin. A spherical Gaussian surface centered at the origin...
A point charge +q is at the origin. A spherical Gaussian surface centered at the origin encloses +q. So does a cubical surface centered at the origin and with edges parallel to the axes. Select "True" or "False" for each statement below. 1. Suppose (for this statement only), that q is moved from the origin but is still within both the surfaces. The flux through both surfaces is changed. 2.If the radius of the spherical Gaussian Surface is varied, the...
A square membrane has all four sides (length a) tightly clamped. Some of its vibrational modes...
A square membrane has all four sides (length a) tightly clamped. Some of its vibrational modes are also dampened by a clamp placed at the center of the membrane. Find the first four distinct vibrational frequencies of this "square drum."
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT