Matlab routine pumpdemo.m

Description:

A Monte Carlo simulation of a pumping network. There are five pumping stations whose probability
of being operational is 1/2. We estimate the probability that water will flow from A to B by randomly
generating a string of 5 entries that are either 0 or 1. A 1 indicates that the pump is operational.
 
 

Water will flow from A to B if and only if the randomly generated string of 0s and 1s have the following
pairs of pumps assigned a 1:
 
               1 & 3,  1 & 4,  2 & 3,  4 & 5
 
INPUT: Number of trials to use (default is 500)
 
OUTPUT: Number of trials used & an estimate of the probabilty of the water flowing from A to B.