Probability. Robert P. Dobrow
Чтение книги онлайн.
Читать онлайн книгу Probability - Robert P. Dobrow страница 28
R: SIMULATING THE DIVISIBILITY PROBABILITY
# Divisible356.R # simdivis() simulates one trial > simdivis <- function() { num <- sample(1:1000,1) if (num%%3==0 || num%%5==0 || num%%6==0) 1 else 0 } > simlist <- replicate(10000, simdivis()) mean(simlist) [1] 0.4707
1.10 SUMMARY
In this chapter, the first principles of probability were introduced: from random experiment and sample space to the properties of probability functions. We start with discrete sample spaces—sets are either finite or countably infinite. The simplest probability model is when outcomes in a finite sample space are equally likely. In that case, probability reduces to “counting.” Counting principles are presented for both permutations and combinations. Binomial coefficients count: (i) the number of
Random experiment: An activity, process, or experiment in which the outcome is uncertain.
Sample space : Set of all possible outcomes of a random experiment.
Outcome : The elements of a sample space.
Event: A subset of the sample space; a collection of outcomes.
Probability function: A function that assigns numbers to the elements such thatFor events , .
Equally likely outcomes: Probability model for a finite sample space in which all elements have the same probability.
CountingMultiplication principle: If there are ways for one thing to happen, and ways for a second thing to happen, then there are ways for both things to happen.Permutations: A permutation of is an -element ordering of the numbers. There are permutations of an -element set.Binomial coefficient: The binomial coefficient or “ choose ” counts: (i) the number of -element subsets of and (ii) the number of element sequences with exactly ones. Each subset is also referred to as a combination.
Stirling's approximation: For large ,
Sampling: When sampling from a population, sampling with replacement is when objects are returned to the population after they are sampled; sampling without replacement is when objects are not returned to the population after they are sampled.
Properties of probabilities:Simple addition rule: If and are mutually exclusive, that is, disjoint, then Implication: If implies , that is, if , then .Complement: The probability that does not occur .General addition rule: For all events and , .
Monte Carlo simulation is based on the relative frequency interpretation of probability. Given a random experiment and an event is approximately the fraction of times in which occurs in repetitions of the random experiment. A Monte Carlo simulation of is based on three principles:Trials: Simulate the random experiment, typically on a computer using the computer's random numbers.Success: Based on the outcome of each trial, determine whether or not occurs. Save the result.Replication: Repeat the aforementioned steps times. The proportion of successful trials is the simulated estimate of .
Setting seeds for reproducibility is vital when generating random numbers.
Problem-solving strategies:Taking complements: Finding the probability of the complement of an event, might be easier in some cases than finding , the probability of the event. This arises in “at least” problems. For instance, the complement of the event that “at least one of several things occur” is the event that “none of those things occur.” In the former case, the event involves a union. In the latter case, the event involves an intersection.Inclusion–exclusion: This is another method for tackling “at least” problems. For three events, inclusion–exclusion gives equals
EXERCISES
Understanding Sample Spaces and Events
1 1.1 Your friend was sick and unable to make today's class. Explain to your friend, using your own words, the meaning of the terms (i) random experiment, (ii) sample space, and (iii) event.For the following problems 1.2–1.5, identify (i) the random experiment, (ii) the sample space, and (iii) the event of interest.
2 1.2 Roll four dice. Consider the probability of getting all fives.
3 1.3 A pizza shop offers three toppings: pineapple, peppers, and pepperoni. A pizza can have 0, 1, 2, or 3 toppings. Consider the probability that a random customer asks for two toppings.
4 1.4 Bored one day, you decide to play the video game Angry Birds until you win. Every time you lose, you start over. Consider the probability that you win in less than 1000 tries.
5 1.5 In Julia's garden, there is a 3% chance that a tomato will be bad. Julia harvests 100 tomatoes and wants to know the probability that at most five tomatoes are bad.
6 1.6 In two dice rolls, let be the outcome of the first die, and the outcome of the second die. Then is the sum of the two dice. Describe the following events in terms of simple outcomes of the random experiment: (Example solution: .)....
7 1.7 A bag contains red and blue balls. You reach into the bag and take balls. Let be the number of red balls you take. Let be the number of blue balls. Express the following events in terms of and , assuming valid values for , , and :You pick no red balls. (Example solution: .)You pick one red and two blue balls.You pick four balls.You pick twice as many red balls as blue balls.You pick at least two red balls.
8 1.8 A couple plans to continue having children until they have a girl or until they have six children, whichever comes first. Describe an appropriate sample space for this random experiment.
Probability Functions
1 1.9 A sample space has four elements such that is twice as likely as , which is three times as likely as , which is four times as likely as . Find the probability function.
2 1.10 A sample space has four elements such that is ten times as likely as , which is four times as likely as . Finally, is as likely as and combined. Find the probability function.
3 1.11 A sample space has four elements. For the potential probability functions