Estimating probabilities by simulation

用模拟估计概率

How do you estimate a probability by simulation?

Repeat the experiment with random numbers many times; the relative frequency estimates the probability and improves with more trials.

ApplicationKP000838

Sign in to read the whole lesson, with 1 interactive aid, 1 more worked example, 7 exercises

Sign in / Sign up

Mastery goals

  • Can design a simulation with random numbers to estimate a probability
  • Can explain how the number of trials affects the reliability of the estimate

10.3.2 Random simulation

Estimating a probability by relative frequency needs a large number of repeated trials. Is there another way that can take the place of doing the trials?

We know that random numbers can be produced with a calculator or computer software. In fact, for different random experiments we can also build corresponding simulations with random numbers, and in this way carry out a large number of repeated trials quickly.

For example, to produce random integers from to , we can do as in a lottery draw: put numbered balls of the same material and size into the drawing machine, mix them thoroughly and draw one ball; the number on that ball is called a random number. The random numbers produced by a calculator or computer are produced by a fixed algorithm and are periodic (with a very long period), but they have properties similar to those of random numbers. So the random numbers produced by a calculator or computer are not truly random; we call them pseudo-random numbers.

For example, for the experiment of tossing a fair coin, we can have a calculator or computer produce random numbers taking values in the set , with standing for tails and for heads. Producing the two random numbers and over and over is then like tossing the coin over and over.

As another example, a bag holds red balls and white balls, alike except for their colour. For the experiment of drawing one ball from the bag, we can have a calculator or computer produce random numbers taking values in the set , with , standing for red balls and , , for white balls. Producing random integers from to over and over is then like drawing a ball from the bag over and over.

Table 10.3-3 shows the results of simulating this ball-drawing experiment with spreadsheet software, where is the number of trials, the frequency of drawing a red ball and the relative frequency of drawing a red ball.

Table 10.3-3

Draw a line chart of the relative frequency (Figure 10.3-2).

00.20.40.60.81relative frequency102050100150200250300
Figure 10.3-2: how the relative frequency of drawing a red ball changes with the number of trials (the values of are placed in order along the horizontal axis, not to scale).

The figure shows that as the number of trials grows, the relative frequency of drawing a red ball settles at the probability .

The method of solving problems by random simulation is called the Monte Carlo method.

The Monte Carlo method arose and developed during the Second World War; its founder was John von Neumann. It is widely used in fields such as applied physics, atomic energy, solid-state physics, chemistry, biology, ecology, sociology and economic behaviour.

Example 3

Choose students at random from your class and find out their birth months, assuming that birth in January, February, …, December is equally likely. Let event “at least two of them were born in the same month”. Design a way to simulate this, simulate it times, and estimate the probability of .

Solution: Method 1 By assumption each person's birth month is equally likely to be any of the months, and different people do not affect each other, so observing the birth months of people can be treated as repeatable trials.

So we can simulate with the following drawing with replacement: put balls numbered , , , into a bag, alike except for their numbers. Draw a ball at random times with replacement; the numbers stand for the birth months of the people, and this completes one simulated trial. If at least of the numbers are the same, event has happened. Repeating this simulated trial times, we can count the relative frequency of .

Method 2 Simulate with spreadsheet software. Enter “=RANDBETWEEN(1,12)” in each of the cells A1, B1, C1, D1, E1, F1 to get numbers standing for the birth months of people; this completes one simulated trial. Select the cells A1 to F1, point the mouse at the small black square in the lower right corner, and drag down to row with the left button held: this is like doing repeated trials. Count the relative frequency of the rows containing a repeated number to get an estimate of the probability of .

Table 10.3-4 gives the results of the simulated trials. Event happened times, so the estimate of the probability of is , not far from the probability of (about ).

Table 10.3-4

TrialABCDEFRepeated number
11911938yes
2101219412yes
3253149no
498101212no
5336447yes
67125310no
7395652yes
81991087yes
91138266yes
10238678yes
11761091210yes
1210211535yes
133949511yes
14645817no
151187459no
16498469yes
1771271182yes
18121211245yes
1912106188yes
208710295no

Summary

1. Structure of the chapter

Random phenomena, random trialsSample points, sample spaceRandom eventsRelations and operations of eventsalso leads to basic properties of probabilityIndependence of eventsleads to computing probabilitiesProbability of an eventClassical probability modelBasic properties of probabilityComputing probabilitiesUsing probability to solve real problemsStability of frequency, random simulation, estimating probability by frequencyleads to using probability to solve real problems
Structure of the chapter: random phenomena, random trials → sample points, sample space → random events. Random events → relations and operations of events, and the probability of an event. Relations and operations of events → independence of events, and relations and operations of events → basic properties of probability. The probability of an event → the classical probability model, and the probability of an event → the stability of frequency, random simulation trials, estimating probability by frequency. Classical probability model → basic properties of probability → computing probabilities; independence of events → computing probabilities. Computing probabilities, together with the stability of frequency, random simulation trials and estimating probability by frequency → using probability to solve real problems.

2. Looking back and thinking

Among the phenomena of nature and human society, some have results that can be known in advance under given conditions; these are called deterministic phenomena. Others have results that cannot be known in advance; these are called non-deterministic phenomena. A phenomenon whose result cannot be known in advance under given conditions, but in which the frequency of each result shows stability over a large number of repeated observations, is called a random phenomenon. Probability theory is the branch of mathematics that studies the regularity of random phenomena.

In this chapter, after making clear what probability studies, we introduced the concepts of sample points and finite sample spaces, defined random events as subsets of the sample space, and then, by analogy with the relations and operations of sets, studied the relations and operations of random events. Next we focused on the features of the classical probability model and on the definition and computation of classical probability, and explored the basic properties of probability. Then we used probability to discuss a special relation between events, namely independence, and used independence to simplify some probability calculations. Finally we studied the stability of the frequency of a random event and random simulation, a very practical method when frequency is used to estimate probability.

In junior high school we already had a first look at random events, computing probabilities when outcomes are equally likely, and estimating probability by frequency. In this chapter we abstracted the concepts of sample points and the sample space from random trials and regarded random events as subsets of the sample space; this is the foundation for studying probability problems. Representing random events by sample points is the key step in turning a real problem into a mathematical one and must be taken seriously. By the definition of probability, if the sample space of a random trial is , then for every event there is a unique real number corresponding to it. This suggests that we can build a path for studying probability by analogy with the process and methods used to study functions: discover and pose the questions to be studied in probability, form methods of study and draw conclusions. For example, we can make a table and, by analogy with the properties of functions, discover and pose properties of probability:

Properties of the function Properties of the probability
1. Domain: the set of values of .1. The “range of values” of the event : is a subset of the sample space , and the elements of are taken from .
2. Range: the set of values of .2. The range of values of : .
3. Values at special points: e.g. for (, ), .3. Probabilities of special events: (1) ; (2) ; (3) if are the elementary events, then .
4. Monotonicity: for any , when , (or ).4. Monotonicity: if , then .
……

Of course, the objects probability studies are far more complicated than those functions study, so we should think more broadly when learning probability. For example, we can also start from the relations and operations of events, or make an analogy with the properties of length and area, to discover some basic properties of probability.

Whether a random event happens in a single trial is uncertain, but over a large number of repeated trials its occurrence shows regularity. Probability is a measure of how likely a random event is to happen. The classical probability model is the simplest probability model, in which the probabilities of the events involved can be computed directly. Note that the probability of a random event in the classical model can be defined only when the trial has finitely many results and each result is equally likely. When learning, understand the meaning of the probability of a random event on the basis of understanding concepts such as the sample space and random events; at the same time, use the classical model to understand the sample space and what it means for a random event to happen.

In reality there are also many random events whose probabilities cannot be computed directly as in the classical model; they have to be estimated by frequency. Be sure to understand the features of frequency and the relation between probability and frequency. The frequency of a random event is an approximate value of its probability, and as the number of trials increases, the frequency gradually settles at the probability. Frequency is random: with different numbers of trials the frequency may differ, and even different runs of the same number of trials may give different frequencies. Probability, however, is a fixed number that does not depend on any particular run of trials.

As in the study of statistics, probability also requires handling large amounts of data. In this chapter we learned the method of random simulation, using a computer to generate random integers and simulate certain random trials. This not only makes handling data more efficient but also lets us get a better feel for what probability means. So we should value the role of information technology and learn, as far as possible, to use computing tools to handle data and carry out random simulations.

Review the whole chapter with the following questions in mind.

  1. Can you give some examples of random phenomena? What method would you use to find out the regularity of such a random phenomenon?
  1. Can you give a few examples from daily life of making decisions with probability?
  1. What are the features of the classical probability model?
  1. From the basic properties of probability, can you derive other properties of probability?
  1. If two events and are independent, how is related to and ?
  1. Is the frequency from repeated trials always closer to the probability than the frequency from repeated trials? Do you have a way to find out whether the frequency you got is close to the probability?
  1. Is the result obtained by random simulation a frequency or a probability?

Related points

All points in this topic

Cite this page: Estimating probabilities by simulation · KnowledgeTree (知识树), https://www.knowledgetree.world/en/kp/KP000838