1 / 18

Simulation Examples in EXCEL

Simulation Examples in EXCEL. Montana Going Green 2010. Example 1. Flip of a fair coin. Algorithm. Inputs: Number of trials (flips), N Output: P(H), P(T) Step 1: Set Counter H and T at 0. Step 2: For I = 1 to N (number of flips) do

chinara
Download Presentation

Simulation Examples in EXCEL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Simulation Examples in EXCEL Montana Going Green 2010

  2. Example 1 • Flip of a fair coin

  3. Algorithm • Inputs: Number of trials (flips), N • Output: P(H), P(T) • Step 1: Set Counter H and T at 0. • Step 2: For I = 1 to N (number of flips) do • Step 3: Generate a random number, xi, between [0,1] • Step 4: If 0 < xi < .5, then H=H+1, else T=T+1 • Step 5: Calculate P(H) = H/N and P(T)=T/N • Output P(H) and P(T) • Stop

  4. Go to EXCEL

  5. Example 2 • Area under a nonnegative curve such as y=x3from [0,2].

  6. Algorithm

  7. Let’s go to EXCEL

  8. Example 3 Buffon Needle Experiment • In mathematics, Buffon's needle problem is a question first posed in the 18th century by Georges-Louis Leclerc, Comte de Buffon: • Suppose we have a floor made of parallel strips of wood, each the same width, and we drop a needle onto the floor. What is the probability that the needle will lie across a line between two strips? • Buffon's needle was the earliest problem in geometric probability to be solved; it can be solved using integral geometry. The solution, in the case where the needle is not greater than the width of the strips, can be used to design a Monte Carlo method for approximating the number π.

  9. Needle Experiment

  10. Process

  11. Go to EXCEL

  12. Fun GameMonty Hall • Here is the typical scenario. Monty has the grand prize behind one of three doors. The contestant picks a different door. Monty choose the a different door (not yours and not the grand prize). Do you stay with your pick or switch to the other door? • This question became a big discussion with in Parade Magazine.

  13. The problem was originally posed in a letter by Steve Selvin to the American Statistician in 1975. A well-known statement of the problem was published in Marilyn vos Savant's "Ask Marilyn" column in Parade magazine in 1990: • Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice? • —Whitaker/vos Savant 1990

  14. Throughout the many years of Let's Make A Deal's popularity, mathematicians have been fascinated with the possibilities presented by the "Three Doors" ...  and a mathematical urban legend has developed surrounding "The Monty Hall Problem."  The CBS drama series NUMB3RS featured the Monty Hall Problem in the final episode of its 2004-2005 season.  The show's mathematician offered his own, very definite solution to the problem involving hidden cars and goats. • The 2008 movie 21 opens with an M.I.T. math professor (played by Kevin Spacey) using the Monty Hall Problem to explain mathematical theories to his students.  His lecture also includes the popular "goats and cars behind three doors" example favored by many versions of the Problem

  15. Let’s go to EXCEL

  16. Other problems • Service with a smile: A small service department has one server. Customers arrive according to the distribution in Table 1. The server can handle the customers according to the distribution in Table 2. You want to use a simulation to estimate the busy time of the server, the average length of the queue, the average waiting time of customers, and the average number of customers present. Use a simulation with one hundred events.

  17. Tables for Problem

More Related