* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download 9.8 Exercises
History of randomness wikipedia , lookup
Indeterminism wikipedia , lookup
Probabilistic context-free grammar wikipedia , lookup
Random variable wikipedia , lookup
Dempster–Shafer theory wikipedia , lookup
Probability box wikipedia , lookup
Infinite monkey theorem wikipedia , lookup
Birthday problem wikipedia , lookup
Law of large numbers wikipedia , lookup
Inductive probability wikipedia , lookup
Conditioning (probability) wikipedia , lookup
Module 9: Introduction to Probability and Statistics This module discusses the basics of probability and statistics. It is intended for readers who have a need for an introduction to this topic, or an accelerated review of it. Readers with a strong background in probability and statistics may skip this module. Others will find it useful, as well as a convenient source for review. 9.1 Introduction Probability and statistics are two closely related branches of mathematics. They apply to all science and engineering fields, sociology, business, education, insurance, and many others. For this reason, we devote all subsequent modules to this topic. In some cases, measurements of various parameters are deterministic; this means that the results can be predicted exactly. However, in most cases there are many unpredictable variables involved, and it becomes an impossible task to predict the result exactly. Consider, for example, the case of a radar system detection, where the radar system detects the presence of a target and extracts useful information such as range (distance) and range rate (velocity) of the target. Here, we are confronted with probabilities such as: a. the probability of false alarm, that is, the probability that the radar receiver decides that a target is present when in fact it is not present. b. the probability of detection, that is, the probability that the radar receiver decides a target is present when in fact it is present. Obviously, we need to use a mathematical procedure to analyze such situations. This mathematical procedure is the field of probability and statistics. 9.2 Probability and Random Experiments Probability is a measure of the likelihood of the occurrence of some event. The probability of an event A occurring is denoted as P(A); this is a real number between zero and one, that is, The sum of the probabilities of all possible events A1, A2, … An is equal to one, that is, where the symbol Σ denotes summation. Relation (9.1) states that the total probability is equal to I; it is similar to the geometric axiom that the whole is equal to the sum of its parts. 1 Module 9 ©AMAT INTERNATIONAL TRAINING We define a random experiment as one that is repeated many times under similar circumstances, but it yields unpredictable results in each trial. For example, when we roll a die, we conduct a random experiment where the outcome (result or event)[*] is one of the numbers 1 through 6. As another example, a security (stock in a certain public company) may yield a predictable dividend value, but the price of the security varies in an unpredictable manner over a period of time. The term population refers to a set of all possible outcomes of a random experiment. A specific number or value which is a result of a random experiment, is called a random variable. A discrete random variable can assume only certain values; for instance, the tossing of a die or the flipping of a coin, can only result in certain values. A continuous random variable, on the other hand, can assume any value within a given interval. For instance, temperature or pressure can assume an infinite number of values within a certain interval. We will discuss random variables, in detail, on the next module. As stated earlier, the outcomes of a random experiment fluctuate because the causes which determine the outcomes cannot be controlled. However, if the conditions of the experiment are somewhat uniform – for example, if the same die is used in successive throws, or if the same resistor is used in an experiment and held at a constant temperature – we will observe some statistical regularities when we consider all results of a very large number of the random experiment. These statistical regularities can be expressed by laws, which yield the probability of the occurrence of an event. An example of statistical regularity will be given in the next section. [*]Sometimes outcomes and results (events) are used interchangeably; in a strict sense the set of outcomes in a random experiment is infinite, and if we choose those sets which are of interest to us, we call them events or results. 9.3 Relative Frequency Let A denote one of the possible outcomes of a random experiment as a result of N independent trials. Now, let N(A) represent the number of times that result A occurs. Then, the ratio is called the relative frequency of the result A. Obviously, the relative frequency must be a number between zero and one, that is, The plot of Figure 9.1 shows fN(A) versus N for a typical sequence of trials in a coin-tossing experiment, where A denotes either "heads" or "tails". We observe that the relative frequency fN(A) varies wildly for small values of N independent trials, but as N → ∞, it stabilizes in the vicinity of the 1/2 value. This is a simple example of statistical regularity. 2 Module 9 ©AMAT INTERNATIONAL TRAINING Figure 9.1: Relative Frequency in N Independent Trials Different events from a random experiment are denoted as A1, A2, A3,…, AN. Events that cannot occur simultaneously in a given trial, are called mutually exclusive. For instance, if A1 represents "heads" and A2 "tails", then A1 and A2 are mutually exclusive events since they cannot occur simultaneously if only a single coin is tossed just once. The occurrence of the event "either Ai or Aj" satisfies the equality or As another example, consider the throwing of a die where Ai denotes the result that the ith face shows. Then, the result "even face shows up" represents the result A2 or A4 or A6 and therefore, Thus, for a fair die, we expect the relative frequency of each Ai to settle about the 1/6 value, and the relative frequency of "even face shows up" to stabilize at 1/2R. To illustrate the basic concepts of probability, we find it convenient to use probabilities that relate to games of chance. The following example illustrates the validity of Equation (9.5). Example 9.1 A box contains two blue and eight red balls. Compute the probability of drawing a blue ball (without looking inside the box, of course). Solution: Here, we have two possible events: B is a blue ball and R is a red ball. Since there are two blue balls in a box containing 10 balls total, we would expect the blue balls to be drawn 20% of the time and the red balls 80% of the time. Thus, the probabilities are P(B) = 0.2 and P(R) = 0.8. Now, suppose that these 10 balls, besides being colored, are also numbered I through 10. If we keep drawing a ball from the box a very large number of times while we are placing the ball back in the box before drawing the next one, we would expect that any of these balls would appear 1/10 or 10% of the time since each ball is equally likely to be drawn. Then, if we add together the chances of drawing any of the two blue balls we get the probability of 3 Module 9 ©AMAT INTERNATIONAL TRAINING This demonstrates Equation (9.5) which states that we can add the probabilities of each group of mutually exclusively events to determine the probability of occurrence of the overall group. Example 9.2 Two dice are thrown. What is the probability of getting a six? Solution: Each die has six faces; then the possible outcomes are 6 × 6 = 36, that is, the probability of drawing any combination of two faces is 1/36. The five different combinations that add up to 6 are 5 + 1, 4 + 2, 3 + 3, 2 + 4, 1 + 5. Therefore, the probability of getting a six is We can also use the following approach: There are 36 possible outcomes but only 5 are the desired ones which will yield a 6. Therefore, if we choose the drawing of a 6 as the desired event, this will occur 5/36 of the time in many repeated tosses 9.4 Combinations and Permutations Sometimes we use combinations and permutations to compute probabilities. Consider the experiment where we select two numbers from the four number set [1, 2, 3, and 4]. The possible pairs, without regard to the order, are (1, 2), (1, 3), (1, 4), (2, 3), (2, 4), and (3, 4). Thus, there are six possible pairs. In this case, we say that when selecting two items from a set of four distinct items, there are six possible combinations. In general, suppose we have a collection of n objects. The number of combinations of these n objects taken r at a time, is denoted as C(n, r); It is computed from the expression [*] Example 9.3 A deck of 52 cards consists of the numbers 2 through 10, jack, queen, king and ace where each of these can be any of the four suits, i.e., heart, spade, diamond or club. Compute the number of combinations in a five card poker game that can be dealt from this deck of cards. Solution: 4 Module 9 ©AMAT INTERNATIONAL TRAINING We are seeking the number of combinations. Therefore, from (9.7), Next, let us consider the case where we pick r items from n possible events, but we are interested in the order of selection of the r items. Now, the number of permutations of n possible events taken r at a time is denoted as P(n, r). It is be computed from the expression Example 9.4 Compute the number of permutations if we select 2 numbers from the set of four numbers [1, 2, 3, and 4]. Solution: The permutations are (1, 2), (2, 1), (1, 3), (3, 1), (1, 4), (4, 1), (2, 3), (3, 2), (2, 4), (4, 2), (3, 4), and (4, 3). Therefore, for this example, there are 12 permutations. The number of permutations can also be obtained from (9.8). For this example, n = 4 and r = 2. Thus, Example 9.5 In a lotto contest, six numbers are selected from the set of numbers [1, 2, 3,…, 55, 56]. Compute the probabilities of selecting the correct six numbers to win the lotto when: a. the order of selection of the six numbers is immaterial b. the order of selection is important Solution: a. Since the order of selection is immaterial, we need to compute the number of possible combinations. For this example, n = 56 and r = 6. Then, using (9.7), Check with Excel: =FACT(56)/(FACT(6)*FACT(56−6)) returns the same number. Therefore, the probability of winning the lotto when combinations are considered, is b. When the order of selection is important, we need to compute the number of possible permutations. Then, using (9.8), 5 Module 9 ©AMAT INTERNATIONAL TRAINING Thus, in this case, the probability of winning the lotto when permutations are considered, is Example 9.6 In a 52-card game, a royal flush is a selection of five cards consisting of an ace, a king, a queen, a jack and a ten, all of the same suit. Compute the probability that a player will draw a royal flush when the order of the five cards drawn is unimportant. Solution: In Example 9.3, we found that the number of combinations of a five card poker game that can be dealt from this deck of cards is and since there are four possible royal flushes (one for each suit), the probability of a royal flush is [*]A number m followed by an exclamation mark (!), i.e., m!, is the product of all positive integers from m down to 1. In other words, m! = m · (m − 1) · (m − 2) · (m − 3) · … · 3 · 2 · 1. Thus, 10! = 10 × 9 × … × 2 × 1 = 3, 628, 000. We call m! m factorial. It is also discussed in Appendix B. 9.5 Joint and Conditional Probabilities In the preceding discussion, we have considered the probability of one particular event occurring, i.e., the tossing of a coin or the throwing of a die. Quite often, however, we need to consider the joint probability representing the joint occurrence of two or more events. Consider, for example, that in the drawing of two cards from a 52 deck the first card is diamond and the second is also a diamond. This is an example of a joint probability and we wish to find the probability that the second card will be diamond when the first was also a diamond. In our subsequent discussion, we will consider the joint occurrence of only two events A and B and we will denote the joint probability as P(AB). In the above example, the second event is conditioned (dependent) upon the first. We measure this dependence by the conditional probability of B occurring given that A has occurred; this conditional probability is denoted as P(B|A). It is computed from 6 Module 9 ©AMAT INTERNATIONAL TRAINING We will derive (9.9) shortly. Example 9.7 Compute the probability that, in the drawing of two cards from a 52 deck, the first card is red (heart or diamond) and the second is black (club or spade), provided that the first card drawn is not returned back to the deck of the cards before the second is drawn. Solution: We let R represent the drawing of the first card (red) and B the drawing of the second (black). The desired joint probability of drawing first R and then B is denoted as P(RB). Since there are 26 red and 26 black cards, the probability of drawing first a red card is P(R) = 26/52 = 1/2. After the first card is drawn, there are 51 cards left, 25 red and 26 black. Therefore, the probability of drawing a black card is 26/51. Thus, the second drawing becomes conditional (dependent) upon the first drawing, and the conditional probability is P(B|R) = 26/51. The joint probability P(RB) of drawing a red card first and a black second is computed from (9.9), which is rearranged as The concepts of joint occurrences and conditional probability can be generalized as follows: Suppose we perform a random experiment, and we observe the occurrence of events A and B in that order. We repeat this experiment many times while we measure the relative frequency of occurrence separately as A and B and also as a pair AB. Here, we wish to find if event B is, or is not dependent on event A, and if it is, to determine the relative dependence, that is, to compute P(B|A) from the relative frequency measurements. We let nAB denote the number of times that the combination AB occurs in n repetitions of the experiment. Then, using the definition of the relative frequency in (9.2), and assuming that n represents a very large number, the joint probability P(AB) of A occurring first and then B is However, in the same n trials, the event A occurred nA times and the event B occurred nB times. Since some of the times in which event A occurred it was followed by event B, nA includes nAB. Then, the ratio represents the relative frequency of occurrence of event B occurring after event A has occurred. This is the conditional probability P(B|A), that is, 7 Module 9 ©AMAT INTERNATIONAL TRAINING In the previous example, n represented a very large number of drawings of two successive cards, nA the number of times that a red card shows up, nB the number of times a black card shows up, nAB and the number of times a red is followed by a black card. If, in (9.12), we divide both nAB and nA by n we get and multiplying (9.13) by P(A) we get We observe that (9.14) is the same as (9.9) except that it is re-arranged. Now, suppose that the probability of event B occurring is independent of event A. Then (9.14) reduces to P(B|A) = P(B). This situation would occur if, in the two-card example, the first card drawn is returned back to the deck of the cards before the second is drawn. Then, substitution of P(B|A) = P(B) into (9.14) yields Relation (9.15) states that if event is independent of event A, we can compute the joint probability P(AB) by multiplying together the separate probabilities P(A) and P(B). In this case, the order of occurrence of events A and B is immaterial and we can also express (9.15) as These simplifications have led us to the condition of statistical independence which states that two events are said to be statistically independent if their probabilities satisfy the following relations. Example 9.8 A box contains two red and three white balls. Two balls are drawn from this box. Compute the joint probabilities of drawing two red balls in succession if a. we do not place the first ball back into the box before drawing the second. b. we do place the first ball back into the box before drawing the second. Solution: a. Let event R1 be a red ball drawn on the first draw, and event R2 another red ball on the second draw. Then, the probability of drawing a red ball on the first draw is P(R1) = 2/5. Since only one red ball remains in the box which now contains only four balls, the conditional probability of drawing the second red ball on the second draw is P(R2/R1) = 1/4. Therefore, the joint probability P(R1R2) is 8 Module 9 ©AMAT INTERNATIONAL TRAINING We can obtain the same result using combinations (no need to use permutations since the red balls are assumed identical). Then, Thus, we have 10 possible combinations of five balls arranged in groups of two. Since we are only interested in the combination which contains two red balls, the probability of this occurring is P(R1R2) = 1/10. This is the same answer as before. b. If the first ball is placed back into the box before the second is drawn, the events R1 and R2 are statistically independent and thus Example 9.9 Box A contains two red balls and one white, and Box B contains three red balls and two white. One of the boxes is selected at random, and one ball is drawn from it. Compute the probability that the ball drawn is red. Solution: Here, there are two possibilities of drawing a red ball, so we let R denote a red ball, P(R) denote the probability of drawing a red ball, P(AR) denote the joint probability that a red ball is drawn from Box A, and P(BR) denote the joint probability that a red ball is drawn from Box B. The possibilities of drawing a red ball are: a. Choose Box A and draw R or b. Choose box B and draw R Since events (a) and (b) are mutually exclusive, Now, the probability of choosing Box A is 1/2 and drawing a red ball from it is 2/3. Then, Similarly, the probability of choosing Box B is 1/2 and drawing a red ball from it is 3/5. Then, Therefore, the probability that ball drawn is red is 9 Module 9 ©AMAT INTERNATIONAL TRAINING 9.6 Bayes' Rule Let C be any event, and D1, D2,…, Dn be mutually exclusive events one of which will definitely occur. We use Bayes' Rule to compute the probabilities of the various events D1, D2,…, Dn which can cause event C to occur. Mathematically, Bayes' rule states that In (9.18), P(Dk) represents the probabilities of the events before the experiment is performed; these are referred to as the a priori probabilities. After the experiment is performed and event C has occurred, the probabilities P(C/Dk) are referred to as the posteriori probabilities. We can think of Bayes' rule as one which evaluates the probability of the "cause" Dk given the "effect" C. Example 9.10 In Example 9.9 what is the probability that the red ball was drawn from Box A? Solution: We will apply Bayes' rule to obtain the solution. Since there were two boxes, we use n = 2 in (9.18). For our example, C is the drawn red ball and so we replace it with R. Also, Dk represents either Box A or B, and since we are seeking the probability that the red ball was drawn from Box A, we replace it with A. Because box A contained 3 balls, one of which was red, while Box B contained 5 balls, three of which were red, (9.18) is written as Therefore, the probability that the red ball was drawn from Box A is 9.7 Summary Probability is a measure of the likelihood of the occurrence of some event. The probability of an event A occurring is denoted as P(A); this is a real number between zero and one. The sum of the probabilities of all possible events is equal to one. A random experiment is an experiment that is repeated many times under similar circumstances, but it yields unpredictable results in each trial. The term population refers to a set of all possible outcomes of a random experiment. A random variable is a specific number or value which is a result of a random experiment. A discrete random variable can assume only certain values. 10 Module 9 ©AMAT INTERNATIONAL TRAINING A continuous random variable can assume any value within a given interval. The relative frequency fN(A) is defined as fN(A) = N(A)/N where N(A) is the number of times that result A occurs in N independent trials. Statistical regularity refers to the condition where the relative frequency stabilizes in a certain value as the number of independent trials approaches infinity. Events that cannot occur simultaneously in a given trial are said to be mutually exclusive. Combinations are arrangements of objects where the order of arrangement does not matter. In a collection of n objects the number of combinations of these n objects taken r at a time, is denoted as C(n, r) and it is computed from the expression Permutations are arrangements of objects where different ordering are considered different results. In a collection of n objects the number of permutations of n possible events taken r at a time is denoted as P(n, r). It is be computed from the expression A joint probability represents the joint occurrence of two or more events. The joint probability of event A occurring first and event B occurring second is denoted as P(AB). If a second event B is conditioned (dependent) on an event A occurring first, we measure this dependence by the conditional probability of B occurring given that A has occurred; this conditional probability is denoted as P(B|A) and it is computed from Two events are said to be statistically independent if their probabilities satisfy the following relations. Bayes' rule states that if C is any event, and D1, D2,…, Dn be mutually exclusive events one of which will definitely occur, we can compute the probabilities of the various events D1, D2,…, Dn which can cause event C to occur using the relation 11 Module 9 ©AMAT INTERNATIONAL TRAINING 9.8 Exercises 1. A box contains 9 white and 14 black balls. Compute the probability that a white ball is drawn on the first trial. 2. Two dice are thrown. What is the probability of getting a. 7 b. 11 3. Compute the number of combinations and permutations in a 7 card poker game that can be dealt from a 52-card deck. 4. In a lotto contest, 5 numbers are selected from the set of numbers [1, 2, 3, …, 45]. Compute the probability of selecting the correct five numbers to win the lotto if the order of the selection of the five numbers is unimportant. 5. Compute the probability that in the drawing of 2 cards from a 52-card deck the first card is a club and the second is a diamond. 6. A box contains 7 blue and 9 red balls. Compute the joint probability of drawing two blue balls in succession if we do not place the first ball back into the box before drawing the second ball. 7. Box A contains 5 red and 4 blue balls and Box B contains 6 red and 9 blue balls. One of the boxes was selected at random and a red ball was drawn from it. What is the probability that the drawn red ball was picked from Box B? 9.9 Solutions to Exercises 1. There are 23 balls total and the probability of getting any ball is 1/23. Since there are 9 white balls, P(white) = 9/23 2. The probability of drawing any combination is 1/6 × 1/6 = 1/36. Then, a. The combinations which add up to 7 are 1 + 6, 2 + 5, 3 + 4, 4 + 3, 5 + 2, and 6 + 1, that is, 6 combinations. Therefore, P(7) = 2/36 = 1/18 b. The combinations which add up to 11 are 5 + 6 and 6 + 5, that is, 2 combinations. Therefore, P(11) = 6/36 = 1/6 3. Combinations: Check with Excel: =FACT(52)/(FACT(7)*FACT(52−7)) returns the same number. Permutations: 4. Because it is stated that the order is unimportant, we need to find the combinations. Thus, and 12 Module 9 ©AMAT INTERNATIONAL TRAINING 5. Let P(C) = Probability of drawing a club, P(D) = Probability of drawing a diamond. Then, 6. B = 7, R = 9, B + R = 16, P(B1) = 7/16, P(B2/B1) = 6/15 and thus 7. and by Bayes' rule End of Chapter 9……………………… 13 Module 9 ©AMAT INTERNATIONAL TRAINING