ReliaSoft Reliability Software, Training and Consulting Services

 
 

See a worldwide directory. Reliability Software

ReliaSoft > Software > RENO > Examples > Example M-2

RENO: Probabilistic Event and Risk Analysis Visual Stochastic Event SimulatorSM
Flowchart and solve the most complex probabilistic problems.

EXAMPLES


Example M-2 - Buffon's Needle

Software Used: 
RENO


Problem Statement:

More than 200 years before Metropolis coined the name “Monte Carlo” method, George Louis Leclerc, Comte de Buffon, proposed the following problem.

“If a needle of length l is dropped at random on the middle of a horizontal surface ruled with parallel lines a distance d > l apart, what is the probability that the needle will cross one of the lines?”

Buffon asked what was the probability that the needle would fall across one of the lines. That will occur only if A <lsin(q).

In this case, the distance from the end of the needle to the horizontal line (denoted as “A”) is randomly distributed [0, d). The angle at which the needle falls (denoted as theta, q) is also randomly distributed [0, 180).

Even though this probability can be easily obtained, it is interesting to note that the great mathematician Laplace perceived an amusing approximation for pi, p. Laplace argued that if Buffon’s experiment is performed with the needle being dropped N times, with M hits, then pi could be approximated by (2*N/M).

This example project attempts to approximate this value.

RENO Solution:

Define two Constants to describe the distance between the two horizontal lines (d) and the length of the needle (l).

Distance Constant and NeedleLength Constant

Define two Random Variables to describe the distance from the end of the needle to the horizontal line (A) and the angle at which the needle falls (Theta), as shown next.

DropDistance Random Variable

Theta Random Variable

Define an Equation Variable to determine the span of the needle based on the length of the needle and the angle at which it falls (lsin(q)). If this is greater than A, then the needle crossed the horizontal line. SIN and RADIANS are pre-defined functions in RENO that can be typed into equations or inserted via the Function Wizard.

Hit Equation Variable

Construct the flowchart as follows:

Flowchart to model the problem

Step 1: Use a Block to obtain the distance from the end of the needle to the horizontal line (A), based on the Random Variable.

Needle Drop Standard Block

Step 2: Use a Conditional Block to determine whether the needle crossed the horizontal line. If the span of the needle (determined by the Equation Variable called “Hit”) is greater than or equal to the distance that was passed from the preceding Block (A), then the needle crossed the horizontal line and a 1 is passed to the TRUE path. A FALSE path is not required for this example.

Conditional to determine if needle crossed the line

Step 3: Use a Result Storage construct to store a sum of the number of times that the needle crossed the horizontal line (i.e. M in Laplace’s equation to approximate p).

Step 4: Use a Block to enter Laplace’s equation to approximate p. In this equation, the reserved keyword IN represents the value of M passed from the previous construct and the reserved keyword SIMS_TOTAL represents the total number of simulations (i.e. N in Laplace’s equation).

Standard Block using Laplace's equation

Step 5: Use another Result Storage construct to store the final result.

Specify to perform 1,000 simulations and vary the seed from 1 to 10 with increments of 1, as shown next. This will result in 10 runs of 1,000 simulations each, using a different set of randomly generated numbers for each run to give us a feel for the variation in the results.

Simulation Console set for 1000 simulations per run

Simulation Console varying seed from 1 to 10 in increments of 1

The results are displayed in the Simulation Results Explorer as shown next.

Results displayed in Simulation Results Explorer

The flowchart displays the last value of p, corresponding to seed 10.

Flowchart with results displayed

A RENO project with the solution for this example (called "Buffon's Needle.rnp") is shipped with the software and stored in the Examples\Misc Fun folder in the application directory (e.g. C:\Program Files\ReliaSoft\RENO\Examples\Misc Fun\Buffon's Needle.rnp).
 

Questions?

More Help Options...

RENO Pages

 *RENO Home
  *Overview
  *Features
    *Flyer (*.pdf)
    *Brochure (*.pdf)
  *Case Studies
  *Free Demo
  *Updates
  *Register/Activate

All Software

*Products Home
  *Order/Pricing
  *License Options
  *Maintenance
  *Support
  *Training
  *Testimonials
  *Software Users

Next Seminar

Untitled Page
No upcoming seminars. See the full seminar calendar...
More Seminars...

 

[Home]   [Software]   [Training]   [Consulting]   [Resources]   [Corporate]   [Search]   [Site Map]   [weibull.com]

ReliaSoft is a registered trademark of ReliaSoft Corporation in the United States and other countries.
Contact: Worldwide Office Numbers

LEGAL [Terms of Use] [Linking Guidelines]
[On-Line Privacy Statement]

Add RSS Feeds

Copyright ©1992-2008 ReliaSoft Corporation, All Rights Reserved

Contact Webmaster