Q:

Monte Carlo simulation, unable to understand

Frontier Bakery keeps stock of a popular brand of cake. Daily demand based on past experience is as given below:-
      Experience indicates
Daily demand   0   15  25  35  45  50
  Probability     0. 01   0.15    0.20    0.50    0.12    0.02
Consider the following sequence of random numbers:-
      R. No. 48,78, 09, 51, 56, 77, 15, 14, 68, 09.
      Using the sequence, 5 simulate the demand for the next 10 days

Now I have the solution to this ,but cannot connect the dots.
The text book solution computes the cumulative demand and fits random no for each demand calling it a "random no. coding"
The previous table becomes
DEMAND  PROBABILITY  Cumulative P   Random no. fitted
0       0.01         0.01           00-00
15      0.15         0.16           01-15
25      0.20         0.36           16-35
35      0.50         0.86           36-85
45      0.12         0.98           86-97
50      0.02         1.00           98-99

Now I have three doubts ,How are we writing the random no. fitted column for each row,and what is the purpose of it?
The book claims if in the sequence the first number in 48,78,09,51,56,77,15,14,68,09 . That is 48 lies between 36-85 its corresponding demand is 35 but why?
Thirdly ,What does these random no represent(48,78,09,51,56,77,15,14,68,09 )?

A:

We are going to use the random numbers to generate a table of demand for each day.  We want the probabilities of each demand to match the data we have, so $12$ of the numbers should correspond to a demand of $45$.  The random number fitted column is one way of making a correspondence between random numbers and demand.  There is nothing magic about having a contiguous range of numbers correspond to one demand, but it is easier to program.  You could assign $37$ and $64$ to create a demand of $50$, other numbers to create other demands, and look it up in a table, as long as the correct number of randoms create each demand level.    
If you check each range in the random number fitted column, you find the correct number of randoms that can create the demand on that line.  So we show that anything in $[86-97]$ creates a demand of $45$.  There are $97-86+1=12$ numbers in that range, so we will get a demand of $45 \ \ 12\%$ of the time.  
The list $48,78,09,51,56,77,15,14,68,09 $ is just one set of ten outputs from the random number generator.  The problem just asks you to look each one up in the table and report the series of demands this set generates.

