Page 385 - Excel for Scientists and Engineers: Numerical Methods
P. 385

3 62                                       EXCEL: NUMERICAL METHODS




               Problems

                  Data  for, and answers to, the following problems are found  in the folder "Ch.  15
                  (Random Numbers & Monte Carlo)" in the  "Problems & Solutions" folder on the
                  CD.

               1.  Estimation of 7c.  The equation of a circle  is x2 + y2 = r2. Evaluate x by
                  determining the area of a circle of radius r circumscribed by a square of side
                  2r. x is the ratio of the area of the circle to that of the square.  Generate a
                  pair of random numbers to use as the x and y coordinates.  If the distance of
                  the  point  from  the  origin  is  less than  or equal to r, it  is within  the  circle.
                  Repeat this N times, evaluating Nc;, the number of points that fall within the
                  circle.  The ratio Nc /N should be a reasonable estimate of 7r.

               2.  Male  Children.  A  king  wishes  to  increase  the  number  of  males  in  his
                  kingdom.  He decrees  that  all  women  in  his  kingdom  may  have  as  many
                  children as they wish, as long as they are boys.  As  soon as a woman has a
                  female baby, she must stop bearing children.  If this decree is followed, what
                  will be the ratio of boys to girls in the kingdom?
               3.  Traffic Model.  Create a simple mode!  of traffic patterns at a stoplight.  Use
                  one row of a spreadsheet to represent a unit  of time, say 5  seconds.  Use a
                  random  number  to  decide  whether  a  car  arrives  at  the  intersection  in  a
                  particular  time  unit.  Vary  the traffic  density  (probability)  and traffic  light
                  timing; observe the effect on congestion at the stoplight.
               4.  Traveling Salesman.  Given  a number  of cities  and the costs of traveling
                  from  any city to any other  city, what  is  the  cheapest round-trip  route that
                  visits each city?

               5.  Choose  Once.  Using  spreadsheet  formulas  only,  create  a  list  of  unique
                  integers (e.g., 1-1  5) in random order.

               6.  Deck of Cards.  Using spreadsheet formulas only, simulate the shuffling of a
                  deck of 52 cards.

               7.  Frequency of  Occurrence of Digits.  Create  1000 random  numbers  and
                  determine the frequency of occurrence of the numbers 0 through 9 in the first
                  digit.

               8.  Frequency  of  Occurrence  of  Digits  11.   Create  two  columns,  each
                  containing  1000 random numbers, RN1 and RN2. Determine the frequency
                  of occurrence in the first significant digit of the numbers  1 through  9 in the
                  product RN1 x RN2. Repeat for the product RN1 x RN2 x  RN3.
   380   381   382   383   384   385   386   387   388   389   390