Pump Simulation

  • Objective
  • Level
  • Prerequisites
  • Platform
  • Instructor's Notes
  • Credits
    Objective: To illustrate a network flow situation using a probability experiment employing the Monte Carlo technique.  (For a general description of the Monte Carlo technique go to the Elementary Probability Demo Collection.)

    Level: High school, precalculus, or probability courses for math majors.

    Prerequisites: Basic probability concepts; knowledge of equally likely chance and the chance of winning a lottery.

    Platform: A 0 -1 spinner device or a calculator or computer which has a function that randomly generates zeros and ones. There are two  accompanying JAVA applets which perform simulations discussed in this demo: javapumpsim and javapumpexperimenter.

    Instructor's Notes: 

    Two of the most fundamental notions of probability are those of equally likely outcomes and independent events. Certainly most students have seen spinners in board games. A 0 -1 spinner provides a easy illustration of these two important notions. (See Figure 1. ) In the elementary grades 0 - 1 spinners are often used as teaching devices for very basic probability concepts. Here we provide a demo suitable for high school and collegiate liberal arts math courses that employ such spinners in for a simulation. (In place of a "physical " spinner a "digital" spinner in the form of a random number generator on a calculator or computer can be used.) Of course this can be considered a Monte Carlo simulation in which the random numbers generated to model the behavior of a system are just zero or one.

                     Figure 1.
    Our simulation can be described as follows. A section of a city has aging water mains and five pumping stations as shown in Figure 2. Assume that at a particular time each pumping station, numbered 1 through 5, has probability 1/2 that it will fail. We want to estimate the probability that water will flow from A to B by some path as depicted in Figure 2. (The line segments with arrows show the water mains or conduits.)

                              Figure 2.
    One way to use this demo is in a collaborative group setting where the 
    class is divided into 5 groups. Each group has its own 0 - 1 spinner (or some equivalent technology for generating zeros and ones randomly). Each of the groups represents a pumping station, and uses its random number generator for zeros and ones to determine if its pump fails; 0 indicates the pump fails and 1 indicates the pump is operational. After each group has used its spinner, the result is analyzed to see if there is a path for the water to go from A to B. For instance if the random values in the following table
    are generated, then water can flow from A to B through pump station 5 to station 4 and reach B. This path is shown in Figure 3.
                                                                     Figure 3.

    The following animation illustrates the procedure described above. This animation was created from the MATLAB routine pumpsim.m and can be downloaded by clicking on  pumpfiles.ZIP. See also the JAVA applet  javapumpsim which has the same functionality.

    Students can construct a chart to keep track of how many times the water successfully flows from A to B, compared  to the total number of trials. The probability of water successfully flowing from A to B at any particular time can be estimated by the ratio of the number of successes to the total number of trials only after a large number of trials. A natural question is, how many trials should be used? If you get this question, your students have tuned in to this modeling problem and are ready for more ideas in probability theory. 

    The following table gives some sample probability estimates for a successful flow of  the water from A to B. If you ran a series of the experiments with the same number of trials your results may vary. (The estimated probabilities have been rounded to two decimal places.)

    Based on this set of tabular data you might suspect the exact probability is close to 0.59 and in fact it can be shown that the exact probability in this situation is 19/32 which is about 0.59375. Hence of simulation produces reasonable estimates. (A MATLAB routine pumpdemo.m can be downloaded to generate data like that in the preceding table; click on  pumpfiles.ZIP. For a description of this routine click on pumpdescription. In addition the JAVA applet javapumpexperimenter can be used for such experiments.)

    By using this demo students can grasp the nature of random phenomena and  gain some experience with a powerful technique that can be used to analyze many real-world problems. They will have engaged in mathematical prediction and estimation, two important aspects in mathematics.

    This simulation can be modified in a variety of ways. For instance, vary the probability that a pumping station fails. Remove or add a pumping station. Assign different probabilities to each pumping station; maybe one station is significantly older than another. These modifications open up a variety of modeling simulations that students can explore. If your students propose such changes to the original problem you have really enticed them to think about the underlying modeling process and should consider the use of this demonstration a success.

    Credits:  This demo was adapted from

    E. Silver and J.P. Smith, "Random Digits and Simulation", in Teaching Statistics and Probability, 1981 Yearbook of the National Council of Teachers of Mathematics, pp.70-73, Reston, Va.: The Council, 1981.
    by David R. Hill.

    We also acknowledge contributions by Un Jung Sin , student at Temple University. The MATLAB routines were written by David R. Hill. The Java applets were developed by Philip Nicastro, a student at Temple University.

    DRH 5/28/01   Last updated 1/25/2005

    Since 6/14/01