![]() |
|
![]() |
|
|
|
ReliaSoft > Software > RENO > Examples > Example C-1
|
|||||||||||||
Problem Statement: Consider two simple questions regarding the probabilities associated with a dice roll: When you roll a single 6-sided die, what is the probability of rolling a 4? When you roll two 6-sided dice, what is the probability of rolling a pair of 4s? RENO Solution: Define two Random Variables to describe the possible results from rolling each die, as shown next for the first die.
Probability of Rolling a 4 To determine the probability of rolling a 4 with a single die, construct the Flowchart as follows:
Step 1: Use a Standard Block to obtain the result of the dice roll from the "DiceRoll1" Random Variable described above.
Step 2: Use a Conditional Block to check whether the roll was a 4. If true, then a 1 is passed down the TRUE path. A FALSE path is not required for this example.
Step 3: Use a Result Storage Block to keep a sum of the number of times that a 4 is rolled (across all simulations).
Step 4: Use a Standard Block to convert the sum to a percentage.
In this equation, the reserved keyword IN represents the sum from the previous construct and the reserved keyword SIMS_TOTAL represents the total number of simulations. Step 5: Use another Result Storage Block to store the final percentage (given as a decimal).
In the Simulation Console, enter 5000 for the number of simulations.
When simulation is complete, the results are displayed in the Simulation Results Explorer and in the Flowchart, as shown next.
The estimated probability of rolling a 4 is 16.26%. Probability of Rolling a Pair of 4s Add a new Flowchart to the project by selecting Add Flowchart from the Project menu. You can rename the new Flowchart by right-clicking the new Flowchart in the Project Explorer and selecting Rename Item from the shortcut menu that appears. In the text box, type Roll Pair of 4s and press Enter. To determine the probability of rolling a pair of 4s with two dice, construct the Flowchart as follows:
In this case, two Standard Blocks are required to obtain the result from each die and a Logic Gate is used instead of a Conditional Block. With AND selected for Gate Type, this construct requires that both paths meet the conditional requirement in order for the condition to be TRUE.
It is important to note that the Required Number of Executed Paths field in the Logic Gate must be set to 2. This ensures that both incoming paths are executed before the Logic Gate is executed. The rest of the Flowchart is identical to the one described above. In the Simulation Console, enter 10,000 for the number of simulations.
When simulation is complete, the results are displayed in the Simulation Results Explorer and in the Flowchart, as shown next.
The probability of rolling a pair of 4s is 2.83%. A RENO project with the solution for this example (called "Dice Roll.rnp") is shipped with the software and stored in the Examples\Casino folder in the application directory (e.g. C:\Program Files\ReliaSoft\RENO\Examples\Casino\Dice Roll.rnp).
|
|
||||||||||||
|
[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. |
LEGAL [Terms of Use] [Linking Guidelines] |
| Copyright ©1992-2008 ReliaSoft Corporation, All Rights Reserved |
Contact Webmaster |