The simulation is divided into periods, each period begins with a working copier and ends once the copier is repaired. Period one begins on the first business day of the JET Copier, eventually the copier breaks down and gets repaired, this ends the first period. Second period begins and events repeat. And so on. After each period the total elapsed time is calculate. The total elapsed time calculates the time between breakdowns and once the total elapsed time reaches 52 (the number of weeks in a year) the simulation stops.
From the graph given in the problem for time between breakdowns we come up with the equation:
X=6*sqrt(rand()) [formula 1]
Using formula 1 we calculate time to breakdown for each of the periods (column F) based on a random number generated for each of the periods (r1). Once a breakdown time is calculated we generate another random number (r2) to calculate how much days will be required for a repair by cross checking the r2 with the data given for repair time probabilities.
Now for each repair there is at least one day and a maximum of 4 days when the business is closed and loosing copies. For day one we calculate a number of copies lost based on the information we have that the shop usually makes between 2000 and 8000 copies, so number of copies is 2000+rand()*6000. For the second, third, and fourth days we check the number of days spent on the repair in that period and calculate losses (copies) if the repair was