Example RA-1 - Buy a Lock for Gym Locker?
Problem Statement:
Consider a gym locker that is used by members to store clothes and other valuables. The lockers themselves cannot be locked; however locks can be purchased for the lockers. Suppose that:
- The value of the items in the lockers is normally distributed with a mean of $500 and a standard deviation of $150.
- The possibility of a thief stealing the items from a locker is 5% if unlocked and 1% if locked.
- A lock costs $5. The lock can fail (according to a Weibull distribution with beta = 2 and eta = 900) and the member has to replace it.
- Also assume that members lose their keys (average time to key loss being 600 days). It costs another $10 to break the lock whenever a key is lost.
Determine the expected cost in one year of buying vs. not buying a lock.
RENO Solution:
The first step is to use Random Variables to describe the time to lose a key, the time to lock failure and the value of the contents, as shown next.



Then, create a flowchart to estimate the cost of losing your belongings. This same flowchart will be used in the model for both cases to be evaluated in this example (i.e. the option of buying a lock or not buying a lock). Because this will be a subchart that is referenced by another flowchart, a single starting point and a single ending point is required. This is a requirement for subcharts in order to maintain integrity and avoid ambiguity. The subchart is shown next.

Keep in mind that there is a different probability of occurrence for each case (with lock or without lock). To keep the subchart generic, the probability will not be defined in the subchart. Instead, the main flowchart will pass the value to the subchart. The reserved keyword IN, which evaluates to the value of the constructs preceding the current construct, will be used to define the Conditional Block in the subchart, as shown next.

In this case, we draw a random number uniformly distributed from 0 to 100 and test to see if it is less than or equal to the fixed probability of items being stolen from the locker (i.e. 5% if unlocked and 1% if locked). If true, this indicates that the items were stolen and the value of the loss is passed to the TRUE path. If false, then "0" is passed to the FALSE path.
Note that even though we have the answers, we need a way to exit the subchart without terminating the simulation. In other words, we need to define paths for both the TRUE and FALSE situations that lead us eventually to the End node. To do that, we use two blocks, "Stolen" and "Not Stolen," both evaluating to IN (i.e. continuing execution by passing the variables passed to them by the previous construct). To join the two paths, we need to utilize a construct that is designed to accept multiple inputs. One option is to use a Summing Gate, which outputs the sum of active inputs. In this case, only one input is possible, thus only a single output will occur ("Value" or "0").
With the subchart constructed we can now create a flowchart with models for both cases: No Lock and Lock. The model for the case of the "No Lock Option" is shown next (with results based on 1,000 simulations and a seed of 1 for repeatability).

The model begins with a Block called "Probability" that evaluates to the specified probability for this case (5%). This will be passed to the subchart, "Stolen Costs." The subchart will then return either the value of the loss or "0" if no loss. We then use a storage variable to store an average value of all the outcomes (including the zeroes).
The model for the case of the "Lock Option" is shown next.

In this case, an additional Block, "Total Costs," is added to include the additional costs of replacing failed locks and lost keys. A simple way to account for the additional costs is by defining an Equation Variable to compute the additional costs, as shown next.

5*(INT(365/LockFail))+10*(INT(365/KeyLoss))
The expected number of lock failures over one year is given by:
(INT(365/LockFail))
The expected number of key losses over one year is given by:
(INT(365/KeyLoss))
The expected numbers of each event, multiplied by the cost of each event ($5 per lock failure and $10 per key loss), will result in the additional expected costs over the year.
With the Equation Variable defined, you can then set up the Block as follows:

You could also specify the equation directly within the Block and omit the Equation Variable, as shown next. This would produce identical results.

A RENO project with the solution for this example (called "Lockers.rnp") is shipped with the software and stored in the Examples\Risk Analysis folder in the application directory (e.g. C:\Program Files\ReliaSoft\RENO\Examples\Risk Analysis\Lockers.rnp).


