<< Chapter < Page | Chapter >> Page > |
In many cases, we model the sequence as a Bernoulli sequence , in which the results on the successive component trials are independent and have the same probabilities. Thus,formally, a sequence of success-failure trials is Bernoulli iff
Simulation of Bernoulli trials
It is frequently desirable to simulate Bernoulli trials. By flipping coins, rolling a die with various numbers of sides (as used in certain games), or using spinners, it isrelatively easy to carry this out physically. However, if the number of trials is large—say several hundred—the process may be time consuming. Also, there are limitations onthe values of p , the probability of success. We have a convenient two-part m-procedure for simulating Bernoulli sequences. Thefirst part, called btdata , sets the parameters. The second, called bt , uses the random number generator in MATLAB to produce a sequence of zeros and ones (for failures and successes). Repeated calls for bt produce new sequences.
>>btdata
Enter n, the number of trials 10Enter p, the probability of success on each trial 0.37
Call for bt>>bt
n = 10 p = 0.37 % n is kept small to save printout spaceFrequency = 0.4
To view the sequence, call for SEQ>>disp(SEQ) % optional call for the sequence
1 12 1
3 04 0
5 06 0
7 08 0
9 110 1
Repeated calls for bt yield new sequences with the same parameters.
To illustrate the power of the program, it was used to take a run of 100,000 component trials, with probability p of success 0.37, as above. Successive runs gave relative frequencies 0.37001 and 0.36999. Unless the random number generator is“seeded” to make the same starting point each time, successive runs will give different sequences and usually different relative frequencies.
The binomial distribution
A basic problem in Bernoulli sequences is to determine the probability of k successes in n component trials. We let S n be the number of successes in n trials. This is a special case of a simple random variable, which we study in more detail in the chapter on "Random Variables and Probabilities" .
Let us characterize the events . As noted above, the event of exactly k successes is the union of the minterms generated by in which there are k successes (represented by k uncomplemented E i ) and failures (represented by complemented E i c ). Simple combinatorics show there are ways to choose the k places to be uncomplemented. Hence, among the 2 n minterms, there are which have k places uncomplemented. Each such minterm has probability . Since the minterms are mutually exclusive, their probabilities add. We conclude that
These probabilities and the corresponding values form the distribution for S n . This distribution is known as the binomial distribution , with parameters . We shorten this to binomial , and often write binomial . A related set of probabilities is , . If the number n of component trials is small, direct computation of the probabilities is easy with hand calculators.
Notification Switch
Would you like to follow the 'Applied probability' conversation and receive update notifications?