2) escape.py A square room is drawn on the Cartesian plane, with corn.docx

This preview shows page 1 - 3 out of 3 pages.

Image of page 1

Subscribe to view the full document.

2) escape.py A square room is drawn on the Cartesian plane, with corners at (0,0), (1,0), (0,1), and (1,1). The room has exits located at (0.2,0), (0,0.2), and (1,1). A person is dropped at a random location in the room. (Technically, this means that the x and y coordinates of the person's location are independent standard uniform random variables.) The person escapes the room by running to the nearest exit in a straight line. Shown below is an example. The person is represented as the black circle in the middle of the room. The person's paths to cach exit are highlighted, and the blue path is the shortest one. (1,1) (0,0.2) (0.2,0) Your job: using a simulation, estimate 1. the average distance that the person will have to run to get to the nearest exit, and 2. the probability that the person has to run less than 0.4 to get to the nearest exit. Here is a bit more direction: you should simulate pick 100,000 random points in the square (i.e., 100,000 pairs of random floats cach between 0 and 1). For each of the 100,000 random points, compute the distances
Image of page 2
Image of page 3
  • Fall '19

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes