text
stringlengths
270
6.81k
the law of total probability, and applications of its use, are provided in Section 1.5. Suppose now that A and B are two events such that A contains B (in symbols, B). In words, all outcomes in B are also in A. Intuitively, A is a “larger” event A than B, so we would expect its probability to be larger. We have the following result. Theorem 1.3.2 Let A and B be two events with A B. Then P A P B P A Bc (1.3.2) B A Bc, where B and A Bc are disjoint. Hence, PROOF We can write A P A P B P A Bc by additivity. Because we always have P A Bc 0, we conclude the following. Corollary 1.3.1 (Monotonicity) Let A and B be two events, with A B. Then P A P B On the other hand, rearranging (1.3.2), we obtain the following. Corollary 1.3.2 Let A and B be two events, with A B. Then P A Bc P A P B (1.3.3) More generally, even if we do not have A B, we have the following property. 12 Section 1.3: Properties of Probability Models Theorem 1.3.3 (Principle of inclusion–exclusion, two­event version) Let A and B be two events. Then 1.3.4) PROOF We can write A B Ac, and A B are disjoint. By additivity, we have B A Bc B Ac A B, where A Bc, P A B P A Bc P B Ac P A B (1.3.5) On the other hand, using Corollary 1.3.2 (with B replaced by A B), we have P A Bc 1.3.6) and similarly, P B Ac P B P A B (1.3.7) Substituting (1.3.6) and (1.3.7) into (1.3.5), the result follows. A more general version of the principle of inclusion–exclusion is developed in Chal­ lenge 1.3.10. Sometimes we do not need to evaluate the probability content of a union; we need only know it is bounded above by
the sum of the probabilities of the individual events. This is called subadditivity. Theorem 1.3.4 (Subadditivity) Let A1 A2 quence of events, not necessarily disjoint. Then be a finite or countably infinite se­ P A1 A2 P A1 P A2 PROOF See Section 1.7 for the proof of this result. We note that some properties in the definition of a probability model actually follow from other properties. For example, once we know the probability P is additive and are that P S 1, so we disjoint, P S must have P 1, it follows that we must have P 0. Indeed, because S and. But of course, P S P S P S 0. P Similarly, once we know P is additive on countably infinite sequences of disjoint events, it follows that P must be additive on finite sequences of disjoint events, too. for all Indeed, given a finite disjoint sequence A1 i n, to get a countably infinite disjoint sequence with the same union and the same sum of probabilities. An, we can just set Ai Summary of Section 1.3 The probability of the complement of an event equals one minus the probability of the event. Chapter 1: Probability Models 13 Probabilities always satisfy the basic properties of total probability, subadditivity, and monotonicity. The principle of inclusion–exclusion allows for the computation of P A B in terms of simpler events. EXERCISES 1 2 0 1. 100. Suppose further that P 1 100? 1.3.1 Suppose S (a) What is the probability P 2 3 4 (b) What is the smallest possible value of P 1 2 3? 1.3.2 Suppose that Al watches the six o’clock news 2 3 of the time, watches the eleven o’clock news 1 2 of the time, and watches both the six o’clock and eleven o’clock news 1 3 of the time. For a randomly selected day, what is the probability that Al watches only the six o’clock news? For a randomly selected day, what is the probability that Al watches neither news? 1.3.3 Suppose that an employee arrives late 10% of the time, leaves early 20% of
the time, and both arrives late and leaves early 5% of the time. What is the probability that on a given day that employee will either arrive late or leave early (or both)? 1.3.4 Suppose your right knee is sore 15% of the time, and your left knee is sore 10% of the time. What is the largest possible percentage of time that at least one of your knees is sore? What is the smallest possible percentage of time that at least one of your knees is sore? 1.3.5 Suppose a fair coin is ipped five times in a row. (a) What is the probability of getting all five heads? (b) What is the probability of getting at least one tail? 1.3.6 Suppose a card is chosen uniformly at random from a standard 52­card deck. (a) What is the probability that the card is a jack? (b) What is the probability that the card is a club? (c) What is the probability that the card is both a jack and a club? (d) What is the probability that the card is either a jack or a club (or both)? 1.3.7 Suppose your team has a 40% chance of winning or tying today’s game and has a 30% chance of winning today’s game. What is the probability that today’s game will be a tie? 1.3.8 Suppose 55% of students are female, of which 4/5 (44%) have long hair, and 45% are male, of which 1/3 (15% of all students) have long hair. What is the probability that a student chosen at random will either be female or have long hair (or both)? PROBLEMS 1.3.9 Suppose we choose a positive integer at random, according to some unknown 0 3, that P 4 5 6 probability distribution. Suppose we know that P 1 2 3 4 5 0 1. What are the largest and smallest possible values of 0 4, and that P 1 P 2? CHALLENGES 14 Section 1.4: Uniform Probability on Finite Spaces 1.3.10 Generalize the principle of inclusion–exclusion, as follows. (a) Suppose there are three events A, B, and C. Prove that b) Suppose there are n events A1 A2 An. Prove that P A1 An n i 1 P Ai n i j 1
j i P Ai Ai A j Ak P A1 An (Hint: Use induction.) DISCUSSION TOPICS 1.3.11 Of the various theorems presented in this section, which ones do you think are the most important? Which ones do you think are the least important? Explain the reasons for your choices. 1.4 Uniform Probability on Finite Spaces If the sample space S is finite, then one possible probability measure on S is the uniform probability measure, which assigns probability 1 S to each outcome. Here S is the number of elements in the sample space S. By additivity, it then follows that for any event A we have P A A S (1.4.1) EXAMPLE 1.4.1 Suppose we roll a six­sided die. The possible outcomes are S that S set P i from (1.4.1) that, for example, P 3 4 This is a good model of rolling a fair six­sided die once. 1 2 3 4 5 6, so 6. If the die is fair, then we believe each outcome is equally likely. We thus 1 6, etc. It follows 1 2, etc. 1 6, P 4 1 3, P 1 5 6 S so that P 3 1 6 for each i 2 6 3 6 EXAMPLE 1.4.2 For a second example, suppose we ip a fair coin once. Then S that S 2, and P heads P tails 1 2. heads, tails, so EXAMPLE 1.4.3 Suppose now that we ip three different fair coins. The outcome can be written as a sequence of three letters, with each letter being H (for heads) or T (for tails). Thus Here S P H H H T T T example, that P exactly two heads 1 8 3 8, etc. 8, and each of the events is equally likely. Hence, P H H H 1 8, 1 4, etc. Note also that, by additivity, we have, for Chapter 1: Probability Models 15 EXAMPLE 1.4.4 For a final example, suppose we roll a fair six­sided die and ip a fair coin. Then we can write S 1H 2H 3H 4H 5H 6H 1T 2T 3T 4T 5T 6T Hence, S 12 in this case, and P s 1 12 for each
s S. 1.4.1 Combinatorial Principles Because of (1.4.1), problems involving uniform distributions on finite sample spaces often come down to being able to compute the sizes A and S of the sets involved. That is, we need to be good at counting the number of elements in various sets. The science of counting is called combinatorics, and some aspects of it are very sophisti­ cated. In the remainder of this section, we consider a few simple combinatorial rules and their application in probability theory when the uniform distribution is appropriate. EXAMPLE 1.4.5 Counting Sequences: The Multiplication Principle Suppose we ip three fair coins and roll two fair six­sided dice. What is the prob­ ability that all three coins come up heads and that both dice come up 6? Each coin has two possible outcomes (heads and tails), and each die has six possible outcomes 1 2 3 4 5 6. The total number of possible outcomes of the three coins and two dice is thus given by multiplying three 2’s and two 6’s, i.e., 2 288. This is sometimes referred to as the multiplication principle. There are thus 288 possible out­ comes of our experiment (e.g., H H H 66 H T H 24 T T H 15 etc.). Of these outcomes, only one (namely, H H H 66) counts as a success. Thus, the probability that all three coins come up heads and both dice come up 6 is equal to 1/288. 6 6 2 2 Notice that we can obtain this result in an alternative way. The chance that any one of the coins comes up heads is 1/2, and the chance that any one die comes up 6 is 1/6. Furthermore, these events are all independent (see the next section). Under inde­ pendence, the probability that they all occur is given by the product of their individual probabilities, namely 288 More generally, suppose we have k finite sets S1 Sk and we want to count the number of sequences of length k where the ith element comes from Si, i.e., count the number of elements in S s1 sk : si Si S1 Sk The multiplication principle says that the number of such sequences is obtained by multiplying together the number of elements in each set Si, i.e., S S1 Sk 16 Section 1.4: Uniform Probability on Finite
Spaces EXAMPLE 1.4.6 Suppose we roll two fair six­sided dice. What is the probability that the sum of the numbers showing is equal to 10? By the above multiplication principle, the total number of possible outcomes is equal to 6 36. Of these outcomes, there are three that sum to 10, namely, 4 6, 5 5, and 6 4. Thus, the probability that the sum is 10 is equal to 3/36, or 1/12. 6 EXAMPLE 1.4.7 Counting Permutations Suppose four friends go to a restaurant, and each checks his or her coat. At the end of the meal, the four coats are randomly returned to the four people. What is the probability that each of the four people gets his or her own coat? Here the total number of different ways the coats can be returned is equal to 4 1, or 4! (i.e., four factorial). This is because the first coat can be returned to any of the four friends, the second coat to any of the three remaining friends, and so on. Only one of these assignments is correct. Hence, the probability that each of the four people gets his or her own coat is equal to 1 4!, or 1 24. 2 3 Here we are counting permutations, or sequences of elements from a set where no element appears more than once. We can use the multiplication principle to count permutations more generally. For example, suppose S n and we want to count the number of permutations of length k n obtained from S i.e., we want to count the number of elements of the set s1 sk : si S si s j when i j Then we have n choices for the first element s1, n ment, and finally n n n k also be written as n! n 1 choices for the second ele­ k 1 choices for the last element. So there are 1 permutations of length k from a set of n elements. This can k! Notice that when k n there are 1 1 n n k permutations of length n n! n n 1 2 1 EXAMPLE 1.4.8 Counting Subsets Suppose 10 fair coins are ipped. What is the probability that exactly seven of them are heads? Here each possible sequence of 10 heads or tails (e.g.,, etc.) is equally likely, and by the multiplication principle the total number of possible outcomes is
equal to 2 multiplied by itself 10 times, or 210 1024. Hence, the probability of any particular sequence occurring is 1 1024. But of these sequences, how many have exactly seven heads? 10. There are 10! 3! 10 To answer this, notice that we may specify such a sequence by giving the positions of the seven heads, which involves choosing a subset of size 7 from the set of possible indices 1 5 4 different permutations of length 10 9 7 from 1 and each such permutation specifies a sequence of seven heads and three tails But we can permute the indices specifying where the heads go in 7! different ways without changing the sequence of heads and tails. So the total number of outcomes with exactly seven heads is equal to 10! 3!7! 120. The probability that exactly seven of the 10 coins are heads is therefore equal to 120 1024, or just under 12%. Chapter 1: Probability Models 17 In general, if we have a set S of n elements, then the number of different subsets of size k that we can construct by choosing elements from S is n k n! k! n k! which is called the binomial coefficient. This follows by the same argument, namely, there are n! n k! permutations of length k obtained from the set; each such permu­ tation, and the k! permutations obtained by permuting it, specify a unique subset of S. It follows, for example, that the probability of obtaining exactly k heads when ipping a total of n fair coins is given by n k 2 n n! k! n k! 2 n This is because there are n 2n different sequences of n heads and tails. k different patterns of k heads and n k tails, and a total of More generally, if each coin has probability of being heads (and probability 1 of being tails), where 0 when ipping a total of n such coins is given by 1, then the probability of obtaining exactly k heads n k k 1 n k n! k! n k! k 1 n k (1.4.2) because each of the n k 1 1.5.2). If k tails has probability n k of occurring (this follows from the discussion of independence in Section k different patterns of k heads and n 1 2, then this reduces to the previous formula. EXAMPLE 1.4.9 Counting Sequences of Subsets and Partitions Suppose
we have a set S of n elements and we want to count the number of elements of S1 S2 Sl : Si S Si ki Si S j when i j namely, we want to count the number of sequences of l subsets of a set where no two subsets have any elements in common and the ith subset has ki elements. By the multiplication principle, this equals n k1 n k1 k2 n k1 kl 1 kl n! k1! kl 1!kl! n k1 kl! (1.4.3) because we can choose the elements of S1 in n k1 n k1 k2 ways, etc. ways, choose the elements of S2 in When we have that S Sl, in addition to the individual sets being mutually disjoint, then we are counting the number of ordered partitions of a set of n S1 S2 18 Section 1.4: Uniform Probability on Finite Spaces elements with k1 elements in the first set, k2 elements in the second set, etc. In this case, (1.4.3) equals n k1 k2 kl n! k1!k2! kl! (1.4.4) which is called the multinomial coefficient. For example, how many different bridge hands are there? By this we mean how many different ways can a deck of 52 cards be divided up into four hands of 13 cards each, with the hands labelled North, East, South, and West, respectively. By (1.4.4), this equals 52 13 13 13 13 52! 13! 13! 13! 13! 5 364474 1028 which is a very large number. Summary of Section 1.4 S. The uniform probability distribution on a finite sample space S satisfies P A A Computing P A in this case requires computing the sizes of the sets A and S. This may require combinatorial principles such as the multiplication principle, factorials, and binomial/multinomial coefficients. EXERCISES 1.4.1 Suppose we roll eight fair six­sided dice. (a) What is the probability that all eight dice show a 6? (b) What is the probability that all eight dice show the same number? (c) What is the probability that the sum of the eight dice is equal to 9? 1.
4.2 Suppose we roll 10 fair six­sided dice. What is the probability that there are exactly two 2’s showing? 1.4.3 Suppose we ip 100 fair independent coins. What is the probability that at least three of them are heads? (Hint: You may wish to use (1.3.1).) 1.4.4 Suppose we are dealt five cards from an ordinary 52­card deck. What is the probability that (a) we get all four aces, plus the king of spades? (b) all five cards are spades? (c) we get no pairs (i.e., all five cards are different values)? (d) we get a full house (i.e., three cards of a kind, plus a different pair)? 1.4.5 Suppose we deal four 13­card bridge hands from an ordinary 52­card deck. What is the probability that (a) all 13 spades end up in the same hand? (b) all four aces end up in the same hand? 1.4.6 Suppose we pick two cards at random from an ordinary 52­card deck. What is the probability that the sum of the values of the two cards (where we count jacks, queens, and kings as 10, and count aces as 1) is at least 4? Chapter 1: Probability Models 19 1.4.7 Suppose we keep dealing cards from an ordinary 52­card deck until the first jack appears. What is the probability that at least 10 cards go by before the first jack? 1.4.8 In a well­shufed ordinary 52­card deck, what is the probability that the ace of spades and the ace of clubs are adjacent to each other? 1.4.9 Suppose we repeatedly roll two fair six­sided dice, considering the sum of the two values showing each time. What is the probability that the first time the sum is exactly 7 is on the third roll? 1.4.10 Suppose we roll three fair six­sided dice. What is the probability that two of them show the same value, but the third one does not? 1.4.11 Consider two urns, labelled urn #1 and urn #2. Suppose urn #1 has 5 red and 7 blue balls. Suppose urn
#2 has 6 red and 12 blue balls. Suppose we pick three balls uniformly at random from each of the two urns. What is the probability that all six chosen balls are the same color? 1.4.12 Suppose we roll a fair six­sided die and ip three fair coins. What is the proba­ bility that the total number of heads is equal to the number showing on the die? 1.4.13 Suppose we ip two pennies, three nickels, and four dimes. What is the proba­ bility that the total value of all coins showing heads is equal to $0.31? PROBLEMS 1.4.14 Show that a probability measure defined by (1.4.1) is always additive in the sense of (1.2.1). 1.4.15 Suppose we roll eight fair six­sided dice. What is the probability that the sum of the eight dice is equal to 9? What is the probability that the sum of the eight dice is equal to 10? What is the probability that the sum of the eight dice is equal to 11? 1.4.16 Suppose we roll one fair six­sided die, and ip six coins. What is the probability that the number of heads is equal to the number showing on the die? 1.4.17 Suppose we roll 10 fair six­sided dice. What is the probability that there are exactly two 2’s showing and exactly three 3’s showing? 1.4.18 Suppose we deal four 13­card bridge hands from an ordinary 52­card deck. What is the probability that the North and East hands each have exactly the same num­ ber of spades? 1.4.19 Suppose we pick a card at random from an ordinary 52­card deck and also ip 10 fair coins. What is the probability that the number of heads equals the value of the card (where we count jacks, queens, and kings as 10, and count aces as 1)? CHALLENGES 1.4.20 Suppose we roll two fair six­sided dice and ip 12 coins. What is the probability that the number of heads is equal to the sum of the numbers showing on the two dice? 1.4.21 (The birthday problem) Suppose there are C people, each of whose birthdays (month and day only) are equally likely to fall
on any of the 365 days of a normal (i.e., non­leap) year. (a) Suppose C birthday? 2. What is the probability that the two people have the same exact 20 Section 1.5: Conditional Probability and Independence 2. What is the probability that all C people have the same exact (b) Suppose C birthday? (c) Suppose C same exact birthday? (Hint: You may wish to use (1.3.1).) (d) What is the smallest value of C such that the probability in part (c) is more than 0 5? Do you find this result surprising? 2. What is the probability that some pair of the C people have the 1.5 Conditional Probability and Independence Consider again the three­coin example as in Example 1.4.3, where we ip three differ­ ent fair coins, and for each s with P s S. What is the probability that the first coin comes up heads? Well, of course, this should be 1 2. We can see this more formally by saying that P first coin heads 1 2, as it should But suppose now that an informant tells us that exactly two of the three coins came up heads. Now what is the probability that the first coin was heads? The point is that this informant has changed our available information, i.e., changed our level of ignorance. It follows that our corresponding probabilities should also change. Indeed, if we know that exactly two of the coins were heads, then we know that the outcome was one of H H T, H T H, and T H H. Because those three outcomes should (in this case) still all be equally likely, and because only the first two correspond to the first coin being heads, we conclude the following: If we know that exactly two of the three coins are heads, then the probability that the first coin is heads is 2 3. More precisely, we have computed a conditional probability. That is, we have de­ termined that, conditional on knowing that exactly two coins came up heads, the con­ ditional probability of the first coin being heads is 2 3. We write this in mathematical notation as P first coin heads two coins heads 2 3 Here the vertical bar stands for “conditional on,” or
“given that.” 1.5.1 Conditional Probability In general, given two events A and B with P B 0, the conditional probability of A given B, written P A B, stands for the fraction of the time that A occurs once we know that B occurs. It is computed as the ratio of the probability that A and B both occur, divided by the probability that B occurs, as follows. Definition 1.5.1 Given two events A and B, with P B ability of A given B is equal to 0, the conditional prob1.5.1) Chapter 1: Probability Models 21 The motivation for (1.5.1) is as follows. The event B will occur a fraction P B of B of the time. The ratio the time. Also, both A and B will occur a fraction P A P A B P B thus gives the proportion of the times when B occurs, that A also occurs. That is, if we ignore all the times that B does not occur and consider only those times that B does occur, then the ratio P A B P B equals the fraction of the time that A will also occur. This is precisely what is meant by the conditional probability of A given B. In the example just computed, A is the event that the first coin is heads, while B is the event that exactly two coins were heads. Hence, in mathematical terms and. It follows that A H H T H T H. Therefore as already computed. On the other hand, we similarly compute that P first coin tails two coins heads 1 3 We thus see that conditioning on some event (such as “two coins heads”) can make probabilities either increase (as for the event “first coin heads”) or decrease (as for the event “first coin tails”). The definition of P B A immediately leads to the multiplication formula P A B P A P B A (1.5.2) This allows us to compute the joint probability of A and B when we are given the probability of A and the conditional probability of B given A Conditional probability allows us to express Theorem 1.3.1, the law of total proba­ bility, in a different and sometimes more helpful way. Theorem 1.5.1 (Law of total probability, conditioned version) Let A1
A2 be events that form a partition of the sample space S, each of positive probability. Let B be any event. Then P B P A2 P B A2 P A1 P B A1 PROOF The multiplication formula (1.5.2) gives that P Ai B The result then follows immediately from Theorem 1.3.1. P Ai P B Ai EXAMPLE 1.5.1 Suppose a class contains 60% girls and 40% boys. Suppose that 30% of the girls have long hair, and 20% of the boys have long hair. A student is chosen uniformly at random from the class. What is the probability that the chosen student will have long hair? To answer this, we let A1 be the set of girls and A2 be the set of boys. Then A1 A2 is a partition of the class. We further let B be the set of all students with long hair. We are interested in P B. We compute this by Theorem 1.5.1 as P B P A1 P B A1 P A2 P B A2 0 6 0 3 0 4 0 2 0 26 22 Section 1.5: Conditional Probability and Independence so there is a 26% chance that the randomly chosen student has long hair. Suppose now that A and B are two events, each of positive probability. In some ap­ plications, we are given the values of P A P B and P B A and want to compute P A B The following result establishes a simple relationship among these quanti­ ties. Theorem 1.5.2 (Bayes’ theorem) Let A and B be two events, each of positive prob­ ability. Then P A B PROOF We compute that This gives the result. Standard applications of the multiplication formula, the law of total probabilities, and Bayes’ theorem occur with two­stage systems. The response for such systems can be thought of as occurring in two steps or stages. Typically, we are given the prob­ abilities for the first stage and the conditional probabilities for the second stage. The multiplication formula is then used to calculate joint probabilities for what happens at both stages; the law of total probability is used to compute the probabilities for what happens at the second stage; and Bayes’ theorem is used to calculate the conditional probabilities for the first stage, given what has occurred at the second stage. We illus­ trate this
by an example. EXAMPLE 1.5.2 Suppose urn #1 has 3 red and 2 blue balls, and urn #2 has 4 red and 7 blue balls. Suppose one of the two urns is selected with probability 1 2 each, and then one of the balls within that urn is picked uniformly at random. What is the probability that urn #2 is selected at the first stage (event A) and a blue ball is selected at the second stage (event B)? The multiplication formula provides the correct way to compute this probability as 11 7 22 Suppose instead we want to compute the probability that a blue ball is obtained. Using the law of total probability (Theorem 1.5.1), we have that P B P A P B A P Ac P B Ac 1 2 7 11 1 2 2 5 Now suppose we are given the information that the ball picked is blue. Then, using Bayes’ theorem, the conditional probability that we had selected urn #2 is given by P A B P A P B 35 57 P B A 0 614 1 2 1 2 2 5 1 2 7 11 7 11 Chapter 1: Probability Models 23 Note that, without the information that a blue ball occurred at the second stage, we have that P urn #2 selected 1 2 We see that knowing the ball was blue significantly increases the probability that urn #2 was selected. We can represent a two­stage system using a tree, as in Figure 1.5.1. It can be help­ ful to draw such a figure when carrying out probability computations for such systems. There are two possible outcomes at the first stage and three possible outcomes at the second stage. S first stage outcome 1 first stage outcome 2 second stage outcome 1 second stage outcome 2 second stage outcome 3 second stage outcome 1 second stage outcome 2 second stage outcome 3 Figure 1.5.1: A tree depicting a two­stage system with two possible outcomes at the first stage and three possible outcomes at the second stage. 1.5.2 Independence of Events Consider now Example 1.4.4, where we roll one fair die and ip one fair coin, so that S 1H 2H 3H 4H 5H 6H 1T 2T 3T 4T 5T 6T and P s equal to P 5H 5T 1 12 for each s 2
12 S. Here the probability that the die comes up 5 is 1 6, as it should be. But now, what is the probability that the die comes up 5, conditional on knowing that the coin came up tails? Well, we can compute that probability as P die 5 coin tails P die 5 and coin tails P coin tails P 5T P 1T 2T 3T 4T 5T 6T 1 12 6 12 1 6 This is the same as the unconditional probability, P die 5. It seems that knowing that the coin was tails had no effect whatsoever on the probability that the coin came 24 Section 1.5: Conditional Probability and Independence up 5. This property is called independence. We say that the coin and the die are independent in this example, to indicate that the occurrence of one does not have any inuence on the probability of the other occurring. More formally, we make the following definition. Definition 1.5.2 Two events A and B are independent if P A B P A P B Now, because P A B if and only if P A B P B or P A has any impact on the probability of the other. B P B, we see that A and B are independent 0 and 0 0 respectively. Intuitively, events A and B are independent if neither one 0. Definition 1.5.2 has the advantage that it remains valid even if P B P A P A or P B A P B, provided that P A EXAMPLE 1.5.3 In Example 1.4.4, if A is the event that the die was 5, and B is the event that the coin 2 12 was tails, then P A P 5H 5T 1 6, and P B P 1T 2T 3T 4T 5T 6T 6 12 1 2 Also, P A and B are independent in this case. P 5T B 1 12, which is indeed equal to 1 6 1 2. Hence, A For multiple events, the definition of independence is somewhat more involved. Definition 1.5.3 A collection of events A1 A2 A3 are independent if P Ai1 Ai j P Ai1 P Ai j for any finite subcollection Ai1 Ai j of distinct events. EXAMPLE 1.5.4 According to Definition
1.5.3, three events A, B, and C are independent if all of the following equations hold and 1.5.3) (1.5.4) It is not sufficient to check just some of these conditions to verify independence. For example, suppose that S 1 4. Let A 1 4. Then each of the three equations 1 2, B (1.5.3) holds, but equation (1.5.4) does not hold. Here, the events A, B, and C are called pairwise independent, but they are not independent. 1 2 3 4, with P 1 1 3, and C P 4 P 2 P 3 Chapter 1: Probability Models 25 Summary of Section 1.5 P A B Conditional probability measures the probability that A occurs given that B oc­ curs; it is given by P A B Conditional probability satisfies its own law of total probability. Events are independent if they have no effect on each other’s probabilities. For­ mally, this means that P A B If A and B are independent, and P A P A and P B A 0, then P A B P A P B. 0 and P B P B. P B. EXERCISES 1.5.1 Suppose that we roll four fair six­sided dice. (a) What is the conditional probability that the first die shows 2, conditional on the event that exactly three dice show 2? (b) What is the conditional probability that the first die shows 2, conditional on the event that at least three dice show 2? 1.5.2 Suppose we ip two fair coins and roll one fair six­sided die. (a) What is the probability that the number of heads equals the number showing on the die? (b) What is the conditional probability that the number of heads equals the number showing on the die, conditional on knowing that the die showed 1? (c) Is the answer for part (b) larger or smaller than the answer for part (a)? Explain intuitively why this is so. 1.5.3 Suppose we ip three fair coins. (a) What is the probability that all three coins are heads? (b) What is the conditional probability that all three coins are heads, conditional on knowing that the number of heads is odd? (c) What is the conditional
probability that all three coins are heads, given that the number of heads is even? 1.5.4 Suppose we deal five cards from an ordinary 52­card deck. What is the con­ ditional probability that all five cards are spades, given that at least four of them are spades? 1.5.5 Suppose we deal five cards from an ordinary 52­card deck. What is the condi­ tional probability that the hand contains all four aces, given that the hand contains at least four aces? 1.5.6 Suppose we deal five cards from an ordinary 52­card deck. What is the condi­ tional probability that the hand contains no pairs, given that it contains no spades? 1.5.7 Suppose a baseball pitcher throws fastballs 80% of the time and curveballs 20% of the time. Suppose a batter hits a home run on 8% of all fastball pitches, and on 5% of all curveball pitches. What is the probability that this batter will hit a home run on this pitcher’s next pitch? 1.5.8 Suppose the probability of snow is 20%, and the probability of a traffic accident is 10%. Suppose further that the conditional probability of an accident, given that it 26 Section 1.5: Conditional Probability and Independence snows, is 40%. What is the conditional probability that it snows, given that there is an accident? 1.5.9 Suppose we roll two fair six­sided dice, one red and one blue. Let A be the event that the two dice show the same value. Let B be the event that the sum of the two dice is equal to 12. Let C be the event that the red die shows 4. Let D be the event that the blue die shows 4. (a) Are A and B independent? (b) Are A and C independent? (c) Are A and D independent? (d) Are C and D independent? (e) Are A, C, and D all independent? 1.5.10 Consider two urns, labelled urn #1 and urn #2. Suppose, as in Exercise 1.4.11, that urn #1 has 5 red and 7 blue balls, that urn #2 has 6 red and 12 blue balls, and that we pick three balls uniformly at random from each of the two urn
s. Conditional on the fact that all six chosen balls are the same color, what is the conditional probability that this color is red? 1.5.11 Suppose we roll a fair six­sided die and then ip a number of fair coins equal to the number showing on the die. (For example, if the die shows 4, then we ip 4 coins.) (a) What is the probability that the number of heads equals 3? (b) Conditional on knowing that the number of heads equals 3, what is the conditional probability that the die showed the number 5? 1.5.12 Suppose we roll a fair six­sided die and then pick a number of cards from a well­shufed deck equal to the number showing on the die. (For example, if the die shows 4, then we pick 4 cards.) (a) What is the probability that the number of jacks in our hand equals 2? (b) Conditional on knowing that the number of jacks in our hand equals 2, what is the conditional probability that the die showed the number 3? PROBLEMS 1.5.13 Consider three cards, as follows: One is red on both sides, one is black on both sides, and one is red on one side and black on the other. Suppose the cards are placed in a hat, and one is chosen at random. Suppose further that this card is placed at on the table, so we can see one side only. (a) What is the probability that this one side is red? (b) Conditional on this one side being red, what is the probability that the card showing is the one that is red on both sides? (Hint: The answer is somewhat surprising.) (c) Suppose you wanted to verify the answer in part (b), using an actual, physical experiment. Explain how you could do this. 1.5.14 Prove that A and B are independent if and only if AC and B are independent. 1.5.15 Let A and B be events of positive probability. Prove that P A B P A if and only if P B A P B. Chapter 1: Probability Models 27 CHALLENGES i 4 case.) 4 in part (b). Also, the cases i 1.5.16 Suppose we roll three fair six­sided dice. Compute the conditional probability that the first die shows 4, given
that the sum of the three numbers showing is 12. 1.5.17 (The game of craps) The game of craps is played by rolling two fair, six­sided dice. On the first roll, if the sum of the two numbers showing equals 2, 3, or 12, then the player immediately loses. If the sum equals 7 or 11, then the player immediately wins. If the sum equals any other value, then this value becomes the player’s “point.” The player then repeatedly rolls the two dice, until such time as he or she either rolls the point value again (in which case he or she wins) or rolls a 7 (in which case he or she loses). (a) Suppose the player’s point is equal to 4. Conditional on this, what is the conditional probability that he or she will win (i.e., will roll another 4 before rolling a 7)? (Hint: The final roll will be either a 4 or 7; what is the conditional probability that it is a 4?) 12, let pi be the conditional probability that the player will win, (b) For 2 conditional on having rolled i on the first roll. Compute pi for all i with 2 12. i 2 3 7 11 12 (Hint: You’ve already done this for i are trivial. The other cases are similar to the i (c) Compute the overall probability that a player will win at craps. (Hint: Use part (b) and Theorem 1.5.1.) 1.5.18 (The Monty Hall problem) Suppose there are three doors, labeled A, B, and C. A new car is behind one of the three doors, but you don’t know which. You select one of the doors, say, door A. The host then opens one of doors B or C, as follows: If the car is behind B, then they open C; if the car is behind C, then they open B; if the car is behind A, then they open either B or C with probability 1/2 each. (In any case, the door opened by the host will not have the car behind it.) The host then gives you the option of either sticking with your original door choice (i.e., A), or switching to the remaining unopened door (i.e., whichever of
B or C the host did not open). You then win (i.e., get to keep the car) if and only if the car is behind your final door selection. (Source: Parade Magazine, “Ask Marilyn” column, September 9, 1990.) Suppose for definiteness that the host opens door B. (a) If you stick with your original choice (i.e., door A), conditional on the host having opened door B, then what is your probability of winning? (Hint: First condition on the true location of the car. Then use Theorem 1.5.2.) (b) If you switch to the remaining door (i.e., door C), conditional on the host having opened door B, then what is your probability of winning? (c) Do you find the result of parts (a) and (b) surprising? How could you design a physical experiment to verify the result? (d) Suppose we change the rules so that, if you originally chose A and the car was in­ deed behind A, then the host always opens door B. How would the answers to parts (a) and (b) change in this case? (e) Suppose we change the rules so that, if you originally chose A, then the host al­ ways opens door B no matter where the car is. We then condition on the fact that door B happened not to have a car behind it. How would the answers to parts (a) and (b) change in this case? 28 Section 1.6: Continuity of P DISCUSSION TOPICS 1.5.19 Suppose two people each ip a fair coin simultaneously. Will the results of the two ips usually be independent? Under what sorts of circumstances might they not be independent? (List as many such circumstances as you can.) 1.5.20 Suppose you are able to repeat an experiment many times, and you wish to check whether or not two events are independent. How might you go about this? 1.5.21 The Monty Hall problem (Challenge 1.5.18) was originally presented by Mar­ ilyn von Savant, writing in the “Ask Marilyn” column of Parade Magazine. She gave the correct answer. However, many people (including some well­known mathemati­ cians, plus many laypeople) wrote in to complain that her answer was incorrect
. The controversy dragged on for months, with many letters and very strong language written by both sides (in the end, von Savant was vindicated). Part of the confusion lay in the assumptions being made, e.g., some people misinterpreted her question as that of the modified version of part (e) of Challenge 1.5.18. However, a lot of the confusion was simply due to mathematical errors and misunderstandings. (Source: Parade Magazine, “Ask Marilyn” column, September 9, 1990; December 2, 1990; February 17, 1991; July 7, 1991.) (a) Does it surprise you that so many people, including well­known mathematicians, made errors in solving this problem? Why or why not? (b) Does it surprise you that so many people, including many laypeople, cared so strongly about the answer to this problem? Why or why not? 1.6 Continuity of P Suppose A1 A2 another event, A. Then we might expect that the probabilities P A1 P A2 getting close to P A, i.e., that limn this? is a sequence of events that are getting “closer” (in some sense) to are P A. But can we be sure about P An Properties like this, which say that P An is close to P A whenever An is “close” to A, are called continuity properties. The above question can thus be translated, roughly, as asking whether or not probability measures P are “continuous.” It turns out that P is indeed continuous in some sense. A2 Specifically, let us write An A3 A and say that the sequence An increases to A, if A1 A. That is, the sequence of events n 1 An is an increasing sequence, and furthermore its union is equal to A. For example, if An 0 1 n n Figure 1.6.1 depicts an increasing sequence of subsets., and also then A1 n 1 An Hence, 1 n n and A2 0 A2 Similarly, let us write An A and say that the sequence An decreases to A, if A1 A. That is, the sequence of events is a decreasing sequence, and furthermore its intersection is equal to A. For 0 Hence, example, if An 1 n 1 n 0 Figure 1.6.2 depicts a decreasing sequence of subsets., and also 1
n 1 n then A1 n 1 An n 1 An and A3 A2 Chapter 1: Probability Models 29 Figure 1.6.1: An increasing sequence of subsets A1 A2 A3 Figure 1.6.2: A decreasing sequence of subsets A1 A2 A3 We will consider such sequences of sets at several points in the text. For this we need the following result. Theorem 1.6.1 Let A A1 A2 An A. Then be events, and suppose that either An A or lim n P An P A PROOF See Section 1.7 for the proof of this theorem. EXAMPLE 1.6.1 Suppose S is the set of all positive integers, with P s is P 5 6 7 8? 2 s for all s S. Then what We begin by noting that the events An 5 6 7 8 n increase to A 5 6 7 8, i.e., An A. Hence, using continuity of probabilities, we must 30 have P 5 6 7 8 Section 1.6: Continuity of P lim n lim n lim n lim 16 lim n 2 5 1 2 n 1 2 1 Alternatively, we could use countable additivity directly, to conclude that which amounts to the same thing. EXAMPLE 1.6.2 Let P be some probability measure on the space S R1. Suppose P 3 5 1 n for all n where Hence, we must have P A 0. Let An 3 5 P 3 5] as well. Note, however, that we could still have P 3 5 1 n. Then An A where A 3 5]. 0. For example, perhaps P 5, but P 3 5 0. Summary of Section 1.6 A or An If An This allows us to compute or bound various probabilities that otherwise could not be understood. A, then limn P A. P An EXERCISES 1 2 3 S. Compute P A where A is the set of all positive integers and that P s 1.6.1 Suppose that S 2 s for all s is the set of all even positive integers. Do this in two ways — by using continuity of P (together with finite additivity) and by using countable additivity. 1.6.2 Consider the uniform distribution on [0 1]. Compute (with proof) 2 4 6 P [1 4 1 e n] lim n 1.6.3 Suppose that S some probability measure on S
. Prove that we must have 1 2 3 is the set of all positive integers and that P is lim n P 1 2 n 1 1.6.4 Suppose P [0 8 4 n ] 2 e n 6 for all n 1 2 3. What must P 0 be? Chapter 1: Probability Models 31 1.6.5 Suppose P [0 1] P 0 be? 1.6.6 Suppose P [1 n 1 2] (a) Must we have P 0 1 2] (b) Must we have P [0 1 2] 1.6.7 Suppose P [0 1.6.8 Suppose P 0 1 2] 1 4. 1.6.9 Suppose P [0 1 2] 1 4? 1, but P [1 n 1] 0 for all n 1 2 3. What must 1 2 3. 1 3 for all n 1 3? 1 3? 1. Prove that there is some n such that P [0 n] 0 9. 1 3. Prove that there is some n such that P [1 n 1 2] 1 3. Must there be some n such that P [1 n 1 2] PROBLEMS 1.6.10 Let P be some probability measure on sample space S (a) Prove that we must have limn (b) Show by example that we might have limn P [0 1 n P 0 1 n 0. [0 1]. 0. CHALLENGES 1.6.11 Suppose we know that P is finitely additive, but we do not know that it is P A1 countably additive. In other words, we know that P A1 An, but we do not know P An for any finite collection of disjoint events A1 about P A1 for infinite collections of disjoint events. Suppose further that we know that P is continuous in the sense of Theorem 1.6.1. Using this, give a proof that P must be countably additive. (In effect, you are proving that continuity of P is equivalent to countable additivity of P, at least once we know that P is finitely additive.) An A2 1.7 Further Proofs (Advanced) Proof of Theorem 1.3.4 We want to prove that whenever A1 A2 events, not necessarily disjoint, then P A1 A1, and for n
Let B1 are disjoint, B1 B2 2, let Bn A2 A1 is a finite or countably infinite sequence of A2 An A1 P A1 An 1 P A2 c. Then B1 B2 and, by additivity, P A1 A2 P B1 B2 P B1 P B2 (1.7.1) Furthermore, An (1.7.1) that Bn, so by monotonicity, we have P An P Bn. It follows from P A1 A2 P B1 P B2 P A1 P A2 as claimed. 32 Section 1.7: Further Proofs (Advanced) Proof of Theorem 1.6.1 We want to prove that when A A1 A2 P An A, then limn P A. are events, and either An A or An Suppose first that An A. Then we can write A A1 A2 Ac 1 A3 Ac 2 where the union is disjoint. Hence, by additivity, P A P A1 P A2 Ac 1 P A3 Ac 2 Now, by definition, writing this infinite sum is the same thing as writing P A lim n P A1 P A2 Ac 1 P An Ac n 1. (1.7.2) However, again by additivity, we see that P A1 P A2 Ac 1 P A3 Ac 2 P An Ac n 1 P An. Substituting this information into (1.7.2), we obtain P A was to be proved. limn P An which Suppose now that An n, and let B B (why?). Hence, by what we just proved, we must have P B A. Let Bn Ac. Then Ac we see that Bn limn P Bn But then, using (1.3.1), we have 1 P A lim n 1 P An, from which it follows that P A limn P An This completes the proof. Chapter 2 Random Variables and Distributions CHAPTER OUTLINE Section 1 Section 2 Section 3 Section 4 Section 5 Section 6 Section 7 Section 8 Section 9 Section 10 Simulating Probability Distributions Section 11 Further Proofs (Advanced) Random Variables Distributions of Random Variables Discrete Distributions Continuous Distributions Cumulative Distribution Functions One­Dimensional Change of Variable Joint Distributions
Conditioning and Independence Multidimensional Change of Variable In Chapter 1, we discussed the probability model as the central object of study in the theory of probability. This required defining a probability measure P on a class of subsets of the sample space S It turns out that there are simpler ways of presenting a particular probability assignment than this — ways that are much more convenient to work with than P This chapter is concerned with the definitions of random variables, distribution functions, probability functions, density functions, and the development of the concepts necessary for carrying out calculations for a probability model using these entities. This chapter also discusses the concept of the conditional distribution of one random variable, given the values of others. Conditional distributions of random variables provide the framework for discussing what it means to say that variables are related, which is important in many applications of probability and statistics. 33 34 Section 2.1: Random Variables 2.1 Random Variables The previous chapter explained how to construct probability models, including a sam­ ple space S and a probability measure P. Once we have a probability model, we may define random variables for that probability model. Intuitively, a random variable assigns a numerical value to each possible outcome in the sample space. For example, if the sample space is rain, snow, clear, then we might define a random variable X such that X 6 if it snows, and X 2 7 if it is clear. 3 if it rains, X More formally, we have the following definition. Definition 2.1.1 A random variable is a function from the sample space S to the set R1 of all real numbers. Figure 2.1.1 provides a graphical representation of a random variable X taking a re­ sponse value s S into a real number X s R1 X S.s 1. X(s) R1 Figure 2.1.1: A random variable X as a function on the sample space S and taking values in R1 EXAMPLE 2.1.1 A Very Simple Random Variable The random variable described above could be written formally as X : clear this example below. R1 by X rain 6, and X clear 3, X snow rain, snow, 2 7. We will return to We now present several further examples. The point is, we can define random variables any way we like, as long as they are functions from the
sample space to R1. EXAMPLE 2.1.2 For the case S saying that Y Y rain 0, Y snow rain snow clear, we might define a second random variable Y by 7 8 if it is clear. That is 1 2 if it snows, and Y 0 if it rains, Y 1 2, and Y clear 7 8. EXAMPLE 2.1.3 If the sample space corresponds to ipping three different coins, then we could let X be the total number of heads showing, let Y be the total number of tails showing, let Z 0 if there is exactly one head, and otherwise Z 17, etc. EXAMPLE 2.1.4 If the sample space corresponds to rolling two fair dice, then we could let X be the square of the number showing on the first die, let Y be the square of the number show­ ing on the second die, let Z be the sum of the two numbers showing, let W be the Chapter 2: Random Variables and Distributions 35 square of the sum of the two numbers showing, let R be the sum of the squares of the two numbers showing, etc. EXAMPLE 2.1.5 Constants as Random Variables As a special case, every constant value c is also a random variable, by saying that c s S. Thus, 5 is a random variable, as is 3 or c for all s 21 6. EXAMPLE 2.1.6 Indicator Functions One special kind of random variable is worth mentioning. If A is any event, then we can define the indicator function of A, written I A, to be the random variable I A s 1 0 s s A A which is equal to 1 on A, and is equal to 0 on AC. Given random variables X and Y, we can perform the usual arithmetic operations on them. Thus, for example, etc. Also, if Z X s Y s 2 X 2 is another random variable, defined by Z s X s XY 3, then W s X s. Similarly, if W X Y, then Z s X s Y s, etc. EXAMPLE 2.1.7 Consider rolling a fair six­sided die, so that S showing, so that X s so that Y s Z 1 3. Let Z 9, etc. 5, Z 2 s for. Let X be the number S. Let Y be three
more than the number showing, 3. So Y. Then Z s X s 2 Y s s2 s We write X Y to mean that X s Y to mean that X s Y s for all s Y s for all s S, and X S. Similarly, we write Y s Y to mean that X s S. For example, we write X c to mean that X s c for all s S. X for all s EXAMPLE 2.1.8 Again consider rolling a fair six­sided die, with S X X s I 6. This means that s, and let Y 1 2 3 4 5 6. For s S, let Hence, Y s X 6. On the other hand, it is true that Y X s for 1 s X. 5. But it is not true that Y X, because Y 6 EXAMPLE 2.1.9 For the random variable of Example 2.1.1 above, it is not true that X that X X 0. However, it is true that X 2 7 and that X 10 and X 100. 0, nor is it true 6. It is also true that If S is infinite, then a random variable X can take on infinitely many different values. EXAMPLE 2.1.10 If S 1 2 3 then we always have X, with P s 2 s for all s s2, 1 But there is no largest value of X s because the value S, and if X is defined by X s 36 Section 2.1: Random Variables X s increases without bound as s unbounded random variable.. We shall call such a random variable an Finally, suppose X is a random variable. We know that different states s occur with different probabilities. It follows that X s also takes different values with different probabilities. These probabilities are called the distribution of X ; we consider them next. Summary of Section 2.1 A random variable is a function from the state space to the set of real numbers. The function could be constant, or correspond to counting some random quantity that arises, or any other sort of function. EXERCISES s2 and Y s 1 2 3 1 s for s, and let X s S. For each 2.1.1 Let S of the following quantities, determine (with explanation) whether or not it exists. If it does exist, then give its value. (a) mins S X s (
b) maxs S X s (c) mins S Y s (d) maxs S Y s 2.1.2 Let S high middle low. Define random variables X, Y, and Z by X high 12, X middle 2, X low 3, Y high 1, 4. Determine whether each of the following 0, Y middle 0, Y low Y Y Z Z 0, Z low 1 2 3 4 5. Z high 6, Z middle relations is true or false. (a) X (b) X (c) Y (d) Y Z (e) XY Z (f) XY 2.1.3 Let S (a) Define two different (i.e., nonequal) nonconstant random variables, X and Y, on S. X Y 2. Compute (b) For the random variables X and Y that you have chosen, let Z Z s for all s 2.1.4 Consider rolling a fair six­sided die, so that S and Y s 2.1.5 Let A and B be events, and let X then of what event? 2.1.6 Let S (a) Compute W 1. (b) Compute W 2. IA IB. Is X an indicator function? If yes, XY. Compute Z s for all s I 3 4. Let W X Y 1 2 3 4 5 6. Let X s I 2 3, and. Let Z s3 Z. S. S. s, Chapter 2: Random Variables and Distributions 37 c) Compute W 4. (d) Determine whether or not W Z. 2.1.7 Let S (a) Compute W 1. (b) Compute W 2. (c) Compute W 3. (d) Determine whether or not W Z. 2.1.8 Let S Z. Y X (a) Compute W 1. (b) Compute W 2. (c) Compute W 5. (d) Determine whether or not W Z. 2.1.9 Let S (a) Compute Y 1. (b) Compute Y 2. (c) Compute, and Z I 1 2. Let W X Y Z, and Y s I 2 3, and Z I 3 4 5. Let W s2 X s. PROBLEMS c c 0? 0? 2.1.10
Let X be a random variable. 0? (a) Is it necessarily true that X (b) Is it necessarily true that there is some real number c such that X (c) Suppose the sample space S is finite. Then is it necessarily true that there is some real number c such that X 2.1.11 Suppose the sample space S is finite. Is it possible to define an unbounded random variable on S? Why or why not? 2.1.12 Suppose X is a random variable that takes only the values 0 or 1. Must X be an indicator function? Explain. 2.1.13 Suppose the sample space S is finite, of size m. How many different indicator functions can be defined on S? 2.1.14 Suppose X is a random variable. Let Y Explain. X. Must Y be a random variable? DISCUSSION TOPICS 2.1.15 Mathematical probability theory was introduced to the English­speaking world largely by two American mathematicians, William Feller and Joe Doob, writing in the early 1950s. According to Professor Doob, the two of them had an argument about whether random variables should be called “random variables” or “chance variables.” They decided by ipping a coin — and “random variables” won. (Source: Statistical Science 12 (1997), No. 4, page 307.) Which name do you think would have been a better choice? 38 Section 2.2: Distributions of Random Variables 2.2 Distributions of Random Variables Because random variables are defined to be functions of the outcome s, and because the outcome s is assumed to be random (i.e., to take on different values with different probabilities), it follows that the value of a random variable will itself be random (as the name implies). Specifically, if X is a random variable, then what is the probability that X will equal x precisely when the outcome s is chosen such some particular value x? Well, X that X s x. EXAMPLE 2.2.1 Let us again consider the random variable of Example 2.1.1, where S clear, and X is defined by X rain further that the probability measure P is such that P rain and P clear 0 45. Then clearly, X it snows, and
X 6 P X 17 P X also compute that P snow 0, and in fact P X 2 7 only when it is clear. Thus, P X 0 15, and P X P x 3 only when it rains, X 2 7 0 for all x 3 P clear 6, and X clear 3, X snow 3 6 rain, snow, 2 7. Suppose 0 15, 6 only when 0 4, 0 45. Also, 2 7. We can P rain 0 4, P snow 15 0 55 45 0 85 while etc. We see from this example that, if B is any subset of the real numbers, then P X P s B S : X s the probabilities P X following definition. B. Furthermore, to understand X well requires knowing B for different subsets B. That is the motivation for the Definition 2.2.1 If X is a random variable, then the distribution of X is the collec­ tion of probabilities P X B for all subsets B of the real numbers. Strictly speaking, it is required that B be a Borel subset, which is a technical restriction from measure theory that need not concern us here. Any subset that we could ever write down is a Borel subset. In Figure 2.2.1, we provide a graphical representation of how we compute the dis­ S such B Then we B. We must do this for every subset tribution of a random variable X For a set B we must find the elements in s that X s evaluate the probability P s B B These elements are given by the set s S : X s S : X s R1 Chapter 2: Random Variables and Distributions 39 X S {s : X(s R1 Figure 2.2.1: If B X s a b a b R1 then s S : X s B is the set of elements such that EXAMPLE 2.2.2 A Very Simple Distribution Consider once again the above random variable, where S where X is defined by X rain P rain X? Well, if B is any subset of the real numbers, then P X 3 information at once by saying that 3, X snow 0 15, and P clear B, plus 0 15 if 6 B, plus 0 45 if 0 4, P snow 2 7 6, and X clear rain, snow, clear and 2 7, and 0 45. What is the distribution of B should count 0 4
if B. We can formally write all this P X B 0 4 IB 3 0 15 IB 6 0 45 IB 2 7, where again IB x 1 if x B, and IB x 0 if x B. EXAMPLE 2.2.3 An Almost­As­Simple Distribution Consider once again the above setting, with S P snow 0 15, and P clear Y rain 7, and Y clear 5, Y snow 5. What is the distribution of Y? Clearly, Y 0 15. However, here Y 0 45 P rain, clear P snow 7 P Y the real numbers, then 0 4 5 0 4, 0 45. Consider a random variable Y defined by rain, snow, clear, and P rain 7 only when it snows, so that P Y 5 if it rains or if it is clear. Hence, 0 85. Therefore, if B is any subset of P Y B 0 15 IB 7 0 85 IB 5. While the above examples show that it is possible to keep track of P X B for all subsets B of the real numbers, they also indicate that it is rather cumbersome to do so. Fortunately, there are simpler functions available to help us keep track of probability distributions, including cumulative distribution functions, probability functions, and density functions. We discuss these next. Summary of Section 2.2 The distribution of a random variable X is the collection of probabilities P X B of X belonging to various sets. The probability P X of response values s such that X s B B is determined by calculating the probability of the set B i.e., P X S : X s P s B 40 Section 2.2: Distributions of Random Variables EXERCISES.. Z. 4, and let V x for all real numbers x. y for every real number y. x for every real number x. B, for any subset B of the real numbers. B, for any subset B of the real numbers. for every real number for every real number 2.2.1 Consider ipping two independent fair coins. Let X be the number of heads that appear. Compute P X 2.2.2 Suppose we ip three fair coins, and let X be the number of heads showing. (a) Compute P X (b) Write a formula for P X 2.2.3 Suppose we roll two fair six­sided dice, and let Y be the sum of the two numbers showing. (a) Comp
ute P Y (b) Write a formula for P Y 2.2.4 Suppose we roll one fair six­sided die, and let Z be the number showing. Let W Z 3 (a) Compute P W (b) Compute P V (c) Compute P Z W x for every real number x. (d) Compute P V W y for every real number y. (e) Compute P V W r for every real number r. 2.2.5 Suppose that a bowl contains 100 chips: 30 are labelled 1, 20 are labelled 2, and 50 are labelled 3. The chips are thoroughly mixed, a chip is drawn, and the number X on the chip is noted. (a) Compute P X (b) Suppose the first chip is replaced, a second chip is drawn, and the number Y on the y for every real number y. chip noted. Compute P Y for every real number when W X (c) Compute P W 2.2.6 Suppose a standard deck of 52 playing cards is thoroughly shufed and a single card is drawn. Suppose an ace has value 1, a jack has value 11, a queen has value 12, and a king has value 13. (a) Compute P X drawn. (b) Suppose that Y Compute P Y (c) Compute P W 2.2.7 Suppose a university is composed of 55% female students and 45% male stu­ dents. A student is selected to complete a questionnaire. There are 25 questions on the questionnaire administered to a male student and 30 questions on the questionnaire administered to a female student. If X denotes the number of questions answered by a randomly selected student, then compute P X 2.2.8 Suppose that a bowl contains 10 chips, each uniquely numbered 0 through 9 The chips are thoroughly mixed, one is drawn and the number on it, X1, is noted. This chip is then replaced in the bowl. A second chip is drawn and the number on it, X2 is noted. Compute P W x for every real number x when X is the value of the card 1 2 3 or 4 when a diamond, heart, club, or spade is drawn. for every real number when W X for every real number when W X1 x for every real number x. y for every real number y. x for every real number x 10X2 Y Y Chapter 2: Random
Variables and Distributions 41 PROBLEMS 2.2.9 Suppose that a bowl contains 10 chips each uniquely numbered 0 through 9 The chips are thoroughly mixed, one is drawn and the number on it, X1 is noted. This chip is not replaced in the bowl. A second chip is drawn and the number on it, X2 is noted. Compute P W for every real number when W X1 10X2 CHALLENGES 2.2.10 Suppose Alice ips three fair coins, and let X be the number of heads showing. Suppose Barbara ips five fair coins, and let Y be the number of heads showing. Let Z z for every real number z. Y. Compute P Z X 2.3 Discrete Distributions 0 for certain x values. This For many random variables X, we have P X means there is positive probability that the variable will be equal to certain particular values. If x P X x 1 x R1 then all of the probability associated with the random variable X can be found from the probability that X will be equal to certain particular values. This prompts the following definition. Definition 2.3.1 A random variable X is discrete if P X x 1 (2.3.1) x R1 At first glance one might expect (2.3.1) to be true for any random variable. How­ ever, (2.3.1) does not hold for the uniform distribution on [0 1] or for other continuous distributions, as we shall see in the next section. Random variables satisfying (2.3.1) are simple in some sense because we can un­ derstand them completely just by understanding their probabilities of being equal to particular values x. Indeed, by simply listing out all the possible values x such that P X 0, we obtain a second, equivalent definition, as follows. x Definition 2.3.2 A random variable X is discrete if there is a finite or countable se­ quence x1 x2 of nonnegative real numbers, such that P X of distinct real numbers, and a corresponding sequence p1 p2 xi pi for all i, and 1. i pi This second definition also suggests how to keep track of discrete distributions. It prompts the following definition. 42
Section 2.3: Discrete Distributions Definition 2.3.3 For a discrete random variable X, its probability function is the function pX : R1 [0 1] defined by Hence, if x1 x2 1, then i pi pX x P X x. are the distinct values such that P X xi pi for all i with pX x pi 0 xi for some i x otherwise. Clearly, all the information about the distribution of X is contained in its probability function, but only if we know that X is a discrete random variable. Finally, we note that Theorem 1.5.1 immediately implies the following. Theorem 2.3.1 (Law of total probability, discrete random variable version) Let X be a discrete random variable, and let A be some event. Then R1 2.3.1 Important Discrete Distributions Certain particular discrete distributions are so important that we list them here. EXAMPLE 2.3.1 Degenerate Distributions Let c be some fixed real number. Then, as already discussed, c is also a random variable In this case, clearly c is discrete, with (in fact, c is a constant random variable). probability function pc satisfying that pc c c. Because c 0 for x is always equal to a particular value (namely, c) with probability 1, the distribution of c is sometimes called a point mass or point distribution or degenerate distribution. 1, and pc x EXAMPLE 2.3.2 The Bernoulli Distribution Consider ipping a coin that has probability of coming up heads and probability 1 1. Let X of coming up tails, where 0 1 the coin is tails. Then pX 1 The random variable X is said to have the Bernoulli X 0 if. distribution; we write this as 1 if the coin is heads, while X, while pX 0 Bernoulli P X P X 0 1. Bernoulli distributions arise anytime we have a response variable that takes only two possible values, and we label one of these outcomes as 1 and the other as 0. For example, 1 could correspond to success and 0 to failure of some quality test applied to an item produced in a manufacturing process. In this case, is the proportion of manu­ factured items that will pass the test. Alternatively, we could be randomly selecting an individual from a population and recording a 1 when the individual is female
and a 0 if the individual is a male. In this case, is the proportion of females in the population. Chapter 2: Random Variables and Distributions 43 EXAMPLE 2.3.3 The Binomial Distribution Consider ipping n coins, each of which has (independent) probability heads, and probability 1 number of heads showing. By (1.4.2), we see that for x of coming up tails. (Again, 0 0 1 2 n of coming up 1.) Let X be the total pX! x! n x! x 1 n x Binomial n The random variable X is said to have the Binomial n X the Binomial n Figure 2.3.1 contains the plots of several Binomial 20. The Bernoulli distribution when n distribution; we write this as distribution corresponds to the special case of. 1, namely, Bernoulli Binomial 1 probability functions. 0.2 p 0.1 0.0 0 10 x 20 Figure 2.3.1: Plot of the Binomial 20 1 2 ( probability functions. ) and the Binomial 20 1 5 ( ) The binomial distribution is applicable to any situation involving n independent performances of a random system; for each performance, we are recording whether a particular event has occurred, called a success, or has not occurred, called a failure. If P A we have that the number of we denote the event in question by A and put For example, we could successes in the n performances is distributed Binomial n be testing light bulbs produced by a manufacturer, and is the probability that a bulb works when we test it. Then the number of bulbs that work in a batch of n is distributed Binomial n of getting a hit when at bat, then the number of hits obtained in n at­bats is distributed Binomial n If a baseball player has probability There is another way of expressing the binomial distribution that is sometimes Xn are chosen independently and each has the useful. For example, if X1 X2 Bernoulli distribution, and Y distribution (see Example 3.4.10 for the details). X1 Xn, then Y will have the Binomial n EXAMPLE 2.3.4 The Geometric Distribution Consider repeatedly ipping a coin that has probability of coming up heads and prob­ 1. Let X be the number of tails ability 1 of coming up tails, where again 0 44 Section 2.3: Discrete Distributions 0, X k if and
only if the coin shows that appear before the first head. Then for k k. (In exactly k tails followed by a head. The probability of this is equal to 1 particular, the probability of getting an infinite number of tails before the first head is k, equal to 1 distri­ 0 1 2 3 for k bution; we write this as X. Figure 2.3.2 contains the plots of several Geometric. The random variable X is said to have the Geometric 0, so X is never equal to infinity.) Hence, pX k probability functions. Geometric 1 p 0.5 0.4 0.3 0.2 0.1 0.0 0 5 10 15 x Figure 2.3.2: Plot of the Geometric 1 2 ( functions at the values 0 1 15. ) and the Geometric 1 5 ( ) probability The geometric distribution applies whenever we are counting the number of failures until the first success for independent performances of a random system where the occurrence of some event is considered a success. For example, the number of light bulbs tested that work until the first bulb that does not (a working bulb is considered a “failure” for the test) and the number of at­bats without a hit until the first hit for the baseball player both follow the geometric distribution. We note that some books instead define the geometric distribution to be the number of coin ips up to and including the first head, which is simply equal to one plus the random variable defined here. of coming up heads and probability 1 EXAMPLE 2.3.5 The Negative­Binomial Distribution Generalizing the previous example, consider again repeatedly ipping a coin that has probability of coming up tails. Let r be a positive integer, and let Y be the number of tails that appear before the r th head. Then 1 heads (and k tails) on the for k first r k ­th ip. The probability of this is equal to k ips, and then shows a head on the r k if and only if the coin shows exactly r 0, Y 1 pY for k 0 1 2 3 Chapter 2: Random Variables and Distributions 45 The random variable Y is said to have the
Negative­Binomial r Negative­Binomial r distribution; we 1 cor­. Of course, the special case r distribution. So in terms of our notation, we have that. Figure 2.3.3 contains the plots of several Geometric write this as Y responds to the Geometric Negative­Binomial 1 Negative­Binomial r probability functions. p 0.25 0.20 0.15 0.10 0.05 0.00 0 10 x 20 Figure 2.3.3: Plot of the Negative­Binomial 2 1 2 ( Negative­Binomial 10 1 2 ( ) probability function at the values 0 1 20. ) probability function and the The Negative­Binomial r distribution applies whenever we are counting the number of failures until the r th success for independent performances of a random system where the occurrence of some event is considered a success. For example, the number of light bulbs tested that work until the third bulb that does not and the num­ ber of at­bats without a hit until the fifth hit for the baseball player both follow the negative­binomial distribution. EXAMPLE 2.3.6 The Poisson Distribution We say that a random variable Y has the Poisson Poisson, if y pY y P Y y e y! distribution, and write Y 0 1 2 3 for y indeed true (as it must be) that of several Poisson y 0 P Y probability functions. We note that since (from calculus) it is 1 Figure 2.3.4 contains the plots y 0 e y y! y p 0.3 0.2 0.1 0.0 0 10 x 20 Figure 2.3.4: Plot of the Poisson 2 ( the values 0 1 20. ) and the Poisson 10 ( ) probability functions at 46 Section 2.3: Discrete Distributions We motivate the Poisson distribution as follows. Suppose X Binomial n, i.e., X has the Binomial n distribution as in Example 2.3.3. Then for 0 x n If we set n for some 0, then this becomes 2.3.2) Let us now consider what happens if we let n in (2.3.2), while keeping x fixed at some nonnegative integer. In that case, n n 1 n 2 nx converges to 1 while (since from calculus 1 c n n ec for any c Substituting these limits into (
2.3.2), we see that lim n P X x x x! e for x 0 1 2 3 Intuitively, we can phrase this result as follows. If we ip a very large number of coins n, and each coin has a very small probability n of coming up heads, then the probability that the total number of heads will be x is approximately given by x e x!. Figure 2.3.5 displays the accuracy of this estimate when we are ap­ distribution where proximating the Binomial 100 1 10 distribution by the Poisson n 100 1 10 10 p 0.14 0.12 0.10 0.08 0.06 0.04 0.02 0.00 0 10 x 20 Figure 2.3.5: Plot of the Binomial 100 1 10 ( functions at the values 0 1 20. ) and the Poisson 10 ( ) probability Chapter 2: Random Variables and Distributions 47 The Poisson distribution is a good model for counting random occurrences of an event when there are many possible occurrences, but each occurrence has very small probability. Examples include the number of house fires in a city on a given day, the number of radioactive events recorded by a Geiger counter, the number of phone calls arriving at a switchboard, the number of hits on a popular World Wide Web page on a given day, etc. EXAMPLE 2.3.7 The Hypergeometric Distribution Suppose that an urn contains M white balls and N M black balls. Suppose we N balls from the urn in such a fashion that each subset of n balls has the draw n same probability of being drawn. Because there are N such subsets, this probability n is 1 N n One way of accomplishing this is to thoroughly mix the balls in the urn and then draw a first ball. Accordingly, each ball has probability 1 N of being drawn. Then, without replacing the first ball, we thoroughly mix the balls in the urn and draw a second ball. So each ball in the urn has probability 1 N 1 of being drawn. We then have that any two balls, say the ith and j th balls, have probability P ball i and j are drawn P ball i is drawn first P ball j is drawn second ball i is drawn first P ball j is drawn first P ball i is drawn second ball j is drawn first
of being drawn in the first two draws. Continuing in this fashion for n draws, we obtain that the probability of any particular set of n balls being drawn is 1 N n This type of sampling is called sampling without replacement. Given that we take a sample of n let X denote the number of white balls obtained. N M because at most N M of n n and Note that we must have X the balls could be black. Hence, X max 0 n M N. Furthermore, X X M because there are only M white balls. Hence, X min n M 0 and X So suppose max 0 n M N x min n M. What is the probability that x? To evaluate this, we x white balls are obtained? In other words, what is P X know that we need to count the number of subsets of n balls that contain x white balls. Using the combinatorial principles of Section 1.4.1, we see that this number is given by M x Therefore min n M The random variable X is said to have the for max 0 n M N Hypergeometric N M n distribution. In Figure 2.3.6, we have plotted some hyper­ geometric probability functions. The Hypergeometric 20 10 10 probability function is 0 for x 10 while the Hypergeometric 20 10 5 probability function is 0 for 5 x 48 Section 2.3: Discrete Distributions p 0.3 0.2 0.1 0.0 0 10 x 20 Figure 2.3.6: Plot of Hypergeometric 20 10 10 ( ( ) probability functions. ) and Hypergeometric 20 10 5 Obviously, the hypergeometric distribution will apply to any context wherein we are sampling without replacement from a finite set of N elements and where each el­ ement of the set either has a characteristic or does not. For example, if we randomly select people to participate in an opinion poll so that each set of n individuals in a pop­ ulation of N has the same probability of being selected, then the number of people who respond yes to a particular question is distributed Hypergeometric N M n where M is the number of people in the entire population who would respond yes. We will see the relevance of this to statistics in Section 5.4.2. Suppose in Example 2.3.7 we had instead replaced the drawn ball before draw­ ing the next ball. This is called sampling with replacement. It is then clear, from Example 2.3.
3, that the number of white balls observed in n draws is distributed Binomial n M N. Summary of Section 2.3 x A random variable X is discrete if x P X comes from being equal to particular values. A discrete random variable X takes on only a finite, or countable, number of distinct values. Important discrete distributions include the degenerate, Bernoulli, binomial, geo­ metric, negative­binomial, Poisson, and hypergeometric distributions. 1, i.e., if all its probability EXERCISES 2.3.1 Consider rolling two fair six­sided dice. Let Y be the sum of the numbers show­ ing. What is the probability function of Y? 2.3.2 Consider ipping a fair coin. Let Z coin is tails. Let W Z 2 (a) What is the probability function of Z? (b) What is the probability function of W? 1 if the coin is heads, and Z 3 if the Z. Chapter 2: Random Variables and Distributions 49 X X 8? 10.. Let Y Binomial 12. Compute P 5. Compute P Y 11 maximized? 9. is P X. For what value of. For what value of 0 5 if the second 1 if the first coin is heads, and X 1 if the first coin is heads, and X 1 if the second coin is heads, and Y 7. What is the probability function of Y? XY. What is the probability function of Z? is P W 11 maximized? 2. 0 1 if the two coins show the same thing (i.e., both heads Y, and W XY. Binomial 10 Poisson Hypergeometric 20 7 8 What is the probability that X 2.3.3 Consider ipping two fair coins. Let X if the first coin is tails. Let Y coin is tails. Let Z 2.3.4 Consider ipping two fair coins. Let X if the first coin is tails. Let Y or both tails), with Y 0 otherwise. Let Z (a) What is the probability function of Z? (b) What is the probability function of W? 2.3.5 Consider rolling two fair six­sided dice. Let W be the product of the numbers showing. What is the probability function of W? 2.3.6 Let Z Geometric
Z 2.3.7 Let X 2.3.8 Let W Poisson 2.3.9 Let Z Negative­Binomial 3 1 4. Compute P Z 2.3.10 Let X Geometric 1 5. Compute P X 2 15. 2.3.11 Let Y 2.3.12 Let X 2.3.13 Let X is the probability that X 2.3.14 Suppose that a symmetrical die is rolled 20 independent times, and each time we record whether or not the event 2 3 5 6 has occurred. (a) What is the distribution of the number of times this event occurs in 20 rolls? (b) Calculate the probability that the event occurs five times. 2.3.15 Suppose that a basketball player sinks a basket from a certain position on the court with probability 0 35. (a) What is the probability that the player sinks three baskets in 10 independent throws? (b) What is the probability that the player scores their first basket on their tenth attempt? (c) What is the probability that the player scores their second basket on their tenth attempt? 2.3.16 An urn contains 4 black balls and 5 white balls. After a thorough mixing, a ball is drawn from the urn, its color is noted, and the ball is returned to the urn. (a) What is the probability that 5 black balls are observed in 15 such draws? (b) What is the probability that 15 draws are required until the first black ball is ob­ served? (c) What is the probability that 15 draws are made with 5 black balls observed and the fifth black ball is observed on the 15th draw? 2.3.17 An urn contains 4 black balls and 5 white balls. After a thorough mixing, a ball is drawn from the urn, its color is noted, and the ball is set aside. The remaining balls are then mixed and a second ball is drawn. (a) What is the probability distribution of the number of black balls observed? (b) What is the probability distribution of the number of white balls observed? 3? What 50 Section 2.3: Discrete Distributions 2.3.18 (Poisson processes and queues) Consider a situation involving a server, e.g., a cashier at a fast­food restaurant, an automatic bank teller machine, a telephone ex­ change, etc
. Units typically arrive for service in a random fashion and form a queue when the server is busy. It is often the case that the number of arrivals at the server, for some specific unit of time t can be modeled by a Poisson t distribution and is such that the number of arrivals in nonoverlapping periods are independent. In Chapter 3, we will show that t is the average number of arrivals during a time period of length t and so is the rate of arrivals per unit of time Suppose telephone calls arrive at a help line at the rate of two per minute. A Poisson process provides a good model. (a) What is the probability that five calls arrive in the next 2 minutes? (b) What is the probability that five calls arrive in the next 2 minutes and then five more calls arrive in the following 2 minutes? (c) What is the probability that no calls will arrive during a 10­minute period? 2.3.19 Suppose an urn contains 1000 balls — one of these is black, and the other 999 are white. Suppose that 100 balls are randomly drawn from the urn with replacement. Use the appropriate Poisson distribution to approximate the probability that five black balls are observed. 2.3.20 Suppose that there is a loop in a computer program and that the test to exit the loop depends on the value of a random variable X The program exits the loop A and this occurs with probability 1/3. If the loop is executed at least whenever X once, what is the probability that the loop is executed five times before exiting? COMPUTER EXERCISES 2.3.21 Tabulate and plot the Hypergeometric 20 8 10 probability function. 2.3.22 Tabulate and plot the Binomial 30 0 3 probability function. Tabulate and plot the Binomial 30 0 7 probability function. Explain why the Binomial 30 0 3 proba­ bility function at x agrees with the Binomial 30 0 7 probability function at n x. PROBLEMS 2 x for 1. What is the distribution of Z? (Identify the distribution by name 1 2 3, with pX x X 2. What is the probability function pY of Y? X 2.3.23 Let X be a discrete random variable with probability function pX x x 0 otherwise. (a) Let Y (b) Let Z and specify all parameter values.) 2.3
.24 Let X independently. Let Z reasoning.) (Hint: See the end of Example 2.3.3.) 2.3.25 Let X Geometric dently. Let Z (Explain your reasoning.) Binomial n1 and Y X X, with X and Y chosen indepen­ Y. What will be the distribution of Z? Generalize this to r coins. Geometric and Y, with X and Y chosen Y. What will be the distribution of Z? (Explain your Binomial n2 Chapter 2: Random Variables and Distributions 51 n. P Xn 1 and Y Geometric Negative­Binomial s n. Compute limn and Y 2, with X and Y chosen in­ Y. Explain what this probability is in terms of coin Geometric 2.3.26 Let X dependently. Compute P X tossing. 2.3.27 Suppose that Xn Geometric Negative­Binomial r 2.3.28 Let X and Y chosen independently. Let Z (Explain your reasoning.) 2.3.29 (Generalized hypergeometric distribution) Suppose that a set contains N ob­ jects, M1 of which are labelled 1 M2 of which are labelled 2 and the remainder of which are labelled 3. Suppose we select a sample of n N objects from the set using sampling without replacement, as described in Example 2.3.7. Determine the proba­ bility that we obtain the counts f3 where fi is the number of objects labelled i in the sample. 2.3.30 Suppose that units arrive at a server according to a Poisson process at rate Exercise 2.3.18) Let T be the amount of time until the first call. Calculate P T, with X Y. What will be the distribution of Z? (see t f1 f2 X 2.4 Continuous Distributions In the previous section, we considered discrete random variables X for which P X x having the uniform distribution, we have P X following definition. 0 for certain values of x. However, for some random variables X, such as one 0 for all x. This prompts the x Definition 2.4.1 A random variable X is continuous if P X x 0 (2.4.1) for all x R1 EXAMPLE 2.4.1 The Uniform[0 1] Distribution Consider a random variable whose distribution is the
uniform distribution on [0 1], as presented in (1.2.2). That is, P a X b b a (2.4.2) a whenever 0 0. The random variable X is said to have the Uniform[0 1] distribution; we write this as X Uniform[0 1]. For example, 1, with Also, P X 2 3 P 2 3 In fact, for any x [0 1], 52 Section 2.4: Continuous Distributions Note that setting a 0 for every x x distribution. In fact, it is one of the most important examples! R1 Thus, the uniform distribution is an example of a continuous b x in (2.4.2), we see in particular that P X x x The Uniform[0 1] distribution is fairly easy to work with. However, in general, 0 for continuous distributions are very difficult to work with. Because P X all x, we cannot simply add up probabilities as we can for discrete random variables. Thus, how can we keep track of all the probabilities? x A possible solution is suggested by rewriting (2.4.2), as follows. For x R1, let f x 1 0 0 1 x otherwise. Then (2.4.2) can be rewritten as P a X b b a f x dx (2.4.3) (2.4.4) whenever a b One might wonder about the wisdom of converting the simple equation (2.4.2) into the complicated integral equation (2.4.4). However, the advantage of (2.4.4) is that, by modifying the function f, we can obtain many other continuous distributions besides the uniform distribution. To explore this, we make the following definitions. Definition 2.4.2 Let f f x 0 for all x : R1 R1, and R1 be a function. Then f is a density function if f x dx 1. Definition 2.4.3 A random variable X is absolutely continuous if there is a density function f, such that P a X b b a f x dx (2.4.5) whenever a b as in (2.4.4). In particular, if b then we see that a with a small positive number, and if f is continuous at a, P a X a a a f x dx f a Thus, a density function evaluated
at a may be thought of as measuring the probability of a random variable being in a small interval about a. To better understand absolutely continuous random variables, we note the following theorem. Theorem 2.4.1 Let X be an absolutely continuous random variable. Then X is a a continuous random variable, i.e., P X 0 for all a R1. Chapter 2: Random Variables and Distributions 53 PROOF other hand, setting a Hence, P X a Let a be any real number. Then P X a b in (2.4.5), we see that P a X 0 for all a, as required. P a a X a a f x dx a. On the 0 It turns out that the converse to Theorem 2.4.1 is false. That is, not all continuous distributions are absolutely continuous.1 However, most of the continuous distributions that arise in statistics are absolutely continuous. Furthermore, absolutely continuous distributions are much easier to work with than are other kinds of continuous distribu­ tions. Hence, we restrict our discussion to absolutely continuous distributions here. In fact, statisticians sometimes say that X is continuous as shorthand for saying that X is absolutely continuous. 2.4.1 Important Absolutely Continuous Distributions Certain absolutely continuous distributions are so important that we list them here. EXAMPLE 2.4.2 The Uniform[0 1] Distribution Clearly, the uniform distribution is absolutely continuous, with the density function given by (2.4.3). We will see, in Section 2.10, that the Uniform[0 1] distribution has an important relationship with every absolutely continuous distribution. EXAMPLE 2.4.3 The Uniform[L R] Distribution Let L and R be any two real numbers with L that R. Consider a random variable X such P a X b b R a L (2.4.6) a b R with P X whenever L 0. The random variable L X is said to have the Uniform[L R] distribution; we write this as X Uniform[L R]. (If L 1, then this definition coincides with the previous definition of the Uniform[0 1] distribution.) Note that X Uniform[L R] has the same probability of being in any two subintervals of [L R] that have the same length. 0 and R P X R Note that the Uniform[L R] distribution is also absolutely continuous, with density given by f
x 1 R L 0 R x L otherwise. In Figure 2.4.1 we have plotted a Uniform[2 4] density. 1For examples of this, see more advanced probability books, e.g., page 143 of A First Look at Rigorous Probability Theory, Second Edition, by J. S. Rosenthal (World Scientific Publishing, Singapore, 2006). 54 Section 2.4: Continuous Distributions 1.0 f 0.5 ­5 ­4 ­3 ­2 ­1 0 1 2 3 4 5 x Figure 2.4.1: A Uniform[2 4] density function. EXAMPLE 2.4.4 The Exponential 1 Distribution Define a function f : R1 R1 by f x e x 0 x x 0 0 Then clearly, f x 0 for all x. Also, f x dx e x dx e x 0 0 1 1 0 Hence, f is a density function. See Figure 2.4.2 for a plot of this density. Consider now a random variable X having this density function f. If 0, then dx b a e x dx e b e a e a e b The random variable X is said to have the Exponential 1 distribution, which we write as X Exponential 1. The exponential distribution has many important properties, which we will explore in the coming sections. EXAMPLE 2.4.5 The Exponential Let 0 be a fixed constant. Define a function f : R1 Distribution R1 by f x x e 0 x x 0 0 Then clearly, f x 0 for all x. Also, f x dx e x dx x e 0 0 1 1. 0 Chapter 2: Random Variables and Distributions 55 Hence, f is again a density function. (If density.) 1, then this corresponds to the Exponential 1 If X is a random variable having this density function f, then P a X b b a e x dx b e a e a e b e a. The random variable X is said to have the Exponential for 0 b distribution; we write this as X Exponential in the definition of the Exponential packages instead replace — always check this when using another book or when using software.. Note that some books and software distribution by 1 An exponential distribution can often be used to model lifelengths. For example, a certain type of light bulb produced by a manufacturer might
follow an Exponential. By this we mean that the lifelength X of a distribution for an appropriate choice of randomly selected light bulb from those produced by this manufacturer has probability P X x e z dz x e x of lasting longer than x in whatever units of time are being used. We will see in Chapter 3 that, in a specific application, the value 1 will correspond to the average lifelength of the light bulbs. As another application of this distribution, consider a situation involving a server, e.g., a cashier at a fast­food restaurant, an automatic bank teller machine, a telephone exchange, etc. Units arrive for service in a random fashion and form a queue when the server is busy. It is often the case that the number of arrivals at the server, for some specific unit of time t can be modeled by a Poisson t distribution. Now let T1 be the time until the first arrival. Then we have P T1 t P no arrivals in 0 t] t 0 0! e t t e and T1 has density given by f t d dt t f z dz d dt P T1 t t e So T1 Exponential. EXAMPLE 2.4.6 The Gamma The gamma function is defined by Distribution t 1e t dt 0 0 It turns out (see Problem 2.4.15) that and that if n is a positive integer, then 1 n n 1!, while 1 2. (2.4.7) 56 Section 2.4: Continuous Distributions We can use the gamma function to define the density of the Gamma distribu­ tion, as follows. Let 0 and 0, and define a function f by f x x 1 e x (2.4.8) 0 with f x when x not hard to verify (see Problem 2.4.17) that 0 function. 0 for x 0. Then clearly f f x dx 0. Furthermore, it is 1. Hence, f is a density A random variable X having density function f given by (2.4.8) is said to have the. Note that some books Gamma and software packages instead replace distribution — always check this when using another book or when using software. distribution; we write this as X Gamma in the definition of the Gamma by 1 The case 1 corresponds
(because tribution: Gamma 1 Gamma density functions. Exponential 1 0! dis­. In Figure 2.4.2, we have plotted several 1) to the Exponential f 0.8 0.6 0.4 0.2 0. Figure 2.4.2: Graph of an Exponential 1 (solid line) a Gamma 2 1 (dashed line), and a Gamma 3 1 (dotted line) density. A gamma distribution can also be used to model lifelengths. As Figure 2.4.2 shows, the gamma family gives a much greater variety of shapes to choose from than from the exponential family. We now define a function : R1 R1 by x e x 2 2 1 2 (2.4.9) This function a bell, as shown in Figure 2.4.3. is the famous “bell­shaped curve” because its graph is in the shape of Chapter 2: Random Variables and Distributions 57 0.4 phi 0.3 0.2 0.1 ­5 ­4 ­3 ­2 ­1 0 1 2 3 4 5 x Figure 2.4.3: Plot of the function in (2.4.9) We have the following result for. Theorem 2.4.2 The function given by (2.4.9) is a density function. PROOF See Section 2.11 for the proof of this result. This leads to the following important distributions. EXAMPLE 2.4.7 The N 0 1 Distribution Let X be a random variable having the density function, that for b a given by (2.4.9). This means P a X b b a x dx b a 1 2 e x2 2 dx. The random variable X is said to have the N 0 1 distribution (or the standard normal distribution); we write this as X N 0 1. EXAMPLE 2.4.8 The N Let R1, and let 2 Distribution 0. Let f be the function defined by If f 0 and 0. Also, letting y 1, then this corresponds with the previous example.) Clearly, x, we have f x dx 1 x dx 1 y dy y dy 1 Hence, f is a density function. Let X be a random variable having this density function f. The random variable 2. In Figure 2 distribution; we write this as X X is said to have the N N 58 Section
2.4: Continuous Distributions 2.4.4, we have plotted the N 0 1 and the N 1 1 densities. Note that changes in simply shift the density without changing its shape. In Figure 2.4.5, we have plotted the N 0 1 and the N 0 4 densities. Note that both densities are centered on 0, but 2 controls the amount of the N 0 4 density is much more spread out. The value of spread. 0.4 f 0.3 0.2 0.1 ­6 ­4 ­2 0 2 4 6 x Figure 2.4.4: Graph of the N 1 1 density (solid line) and the N 0 1 density (dashed line). 0.4 f 0.3 0.2 0.1 ­6 ­4 ­2 0 2 4 6 x Figure 2.4.5: Graph of an N 0 4 density (solid line) and an N 0 1 density (dashed line). The N 2 distribution, for some choice of and 2 arises quite often in ap­ plications. Part of the reason for this is an important result known as the central limit theorem. which we will discuss in Section 4.4. In particular, this result leads to using a normal distribution to approximate other distributions, just as we used the Poisson distribution to approximate the binomial distribution in Example 2.3.6. In a large human population, it is not uncommon for various body measurements to be normally distributed (at least to a reasonable degree of approximation). For example, let us suppose that heights (measured in feet) of students at a particular university are and 2 Then the probability that a randomly distributed N 2 for some choice of Chapter 2: Random Variables and Distributions 59 selected student has height between a and b feet, with a b is given by b a 1 2 e x 2 2 2 dx In Section 2.5, we will discuss how to evaluate such an integral. Later in this text, we and 2 and to assess whether or will discuss how to select an appropriate value for not any normal distribution is appropriate to model the distribution of a variable defined on a particular population. Given an absolutely continuous random variable X, we will write its density as f X, or as f if no confusion arises. Absolutely continuous random variables will be used extensively in later chapters of this book. Remark 2.4.1 Finally, we note that density functions are not unique. Indeed, if f is
a density function and we change its value at a finite number of points, then the value of b a f x dx will remain unchanged. Hence, the changed function will also qualify as a density corresponding to the same distribution. On the other hand, often a particular “best” choice of density function is clear. For example, if the density function can be chosen to be continuous, or even piecewise continuous, then this is preferred over some other version of the density function. To take a specific example, for the Uniform[0 1] distribution, we could replace the density f of (2.4.3) by or even by g x h x 1 0 1 17 1 0 0 1 x otherwise, x 3 4 x 0 x 3 4 otherwise. 3 4 1 Either of these new densities would again define the Uniform[0 1] distribution, be­ cause we would have b b a g x dx b a h x dx for any a a f x dx On the other hand, the densities f and g are both piecewise continuous and are therefore natural choices for the density function, whereas h is an unnecessarily com­ plicated choice. Hence, when dealing with density functions, we shall always assume that they are as continuous as possible, such as f and g, rather than having removable discontinuities such as h. This will be particularly important when discussing likeli­ hood methods in Chapter 6. b. Summary of Section 2.4 A random variable X is continuous if P X probability comes from being equal to particular values. X is absolutely continuous if there exists a density function f X with P a b b a f X x dx for all a b. x 0 for all x, i.e., if none of its X 60 Section 2.4: Continuous Distributions Important absolutely continuous distributions include the uniform, exponential, gamma, and normal. EXERCISES 9 1 3 5 9 17 9, what must W be?) 9 (Hint: If W 2 2 Exponential 4. Compute each of the following. 2.4.1 Let U Uniform[0 1]. Compute each of the following. (a) P U 0 (b) P U 1 2 (c) P U (d) P U 2 3 (e) P U 2 3 (f) P U 1 (g) P U 17 2.4.2 Let W Uniform[1 4]. Compute each of
the following. (a) P W 5 (b) P W 2 (c) P W 2 (d) P W 2 2.4.3 Let Z (a) P Z 5 (b) P Z (c) P Z 2 (d) P Z 4 2.4.4 Establish for which constants c the following functions are densities. cx on 0 1 and 0 otherwise. (a) f x cx n on 0 1 and 0 otherwise, for n a nonnegative integer. (b) f x cx 1 2 on 0 2 and 0 otherwise. (c) f x c sin x on 0 (d) f x 2.4.5 Is the function defined by f x density? Why or why not? 2.4.6 Let X X (a) P 0 X (b) P 0 X (c) P 0 X (d) P 2 X (e) P 2 (f) P X 2 cx 2 for 0 2.4.7 Let M 0, and suppose f x what value of c (depending on M) is f a density? 2.4.8 Suppose X has density f and that P 0 3 2.4.9 Suppose X has density f and Y has density g. Suppose f x x Exponential 3. Compute each of the following. 1 3 5 5 10 2 and 0 otherwise. 2. Prove that P 1 2 for 0 3 x 3 for P 1 0 2, otherwise f x 2 and 0 otherwise, a 0. For 0 4. Prove that g x for 1 Chapter 2: Random Variables and Distributions 2.4.10 Suppose X has density f and Y has density g. Is it possible that f x for all x? Explain. 2.4.11 Suppose X has density f and f x Does it follow that P 0 P 1 2.4.12 Suppose X has density f and f x Does it follow that P 0 P 1 2.4.13 Suppose X f y whenever 0 2? Explain. f y whenever 0 3? Explain. N 1 1. Prove that P X N 0 1 and 61 g x y y 2. 3. 3. PROBLEMS h for some 0. Let y h 0. Prove that P Y Exponential 2.4.14 Let Y P Y h, the y That is, conditional on knowing that Y h y Y h has the same distribution as Y did originally. This is
called random variable Y the memoryless property of the exponential distributions; it says that they immediately “forget” their past behavior. 2.4.15 Consider the gamma function (a) Prove that (b) Prove that 1 (c) Use parts (a) and (b) to show that 2.4.16 Use the fact that t. (Hint: Use integration by parts.) n to give an alternate proof that 1! if n is a positive integer. 1e t dt, for 1 2 1 (as in Theorem 2.4.2). (Hint: Make the substitution t x 2 2.) 1 1. x dx 0. n 0 distribution, as in (2.4.8). Prove that 2.4.17 Let f be the density of the Gamma 1. (Hint: Let t f x dx x.) x e x 2 for 0 2.4.18 (Logistic distribution) Consider the function given by f x e x 1 2.4.19 (Weibull f x function. 2.4.20 (Pareto x distribution) Consider, for x distribution) Consider, for 1 for 0 1e x for 0 1 x x Prove that f is a density function. 0 fixed, the function given by f x and 0 otherwise Prove that f is a density function. and 0 otherwise Prove that 0 fixed, the function given by is a density f 2.4.21 (Cauchy distribution) Consider the function given by f x 1 1 1 x 2 x for arctan x ) 2.4.22 (Laplace distribution) Consider the function given by f x Prove that f is a density function. (Hint: Recall the derivative of x and 0 otherwise Prove that f is a density function. 2.4.23 (Extreme value distribution) Consider the function given by f x for and 0 otherwise Prove that f is a density function. 2.4.24 (Beta a b distribution) The beta function is the function B : 0 given by dx e x 2 for e x exp e x 2 R1 62 Section 2.5: Cumulative Distribution Functions It can be proved (see Challenge 2.4.25) that B a b a a b b (2.4.10) (a) Prove that the function f given by f x x 1 and 0 otherwise, is
a density function. (b) Determine and plot the density when a (c) Determine and plot the density when a (d) Determine and plot the density when a (e) Determine and plot the density when for Can you name this distribution? 1 2 2 CHALLENGES 2.4.25 Prove (2.4.10). (Hint: Use x make the change of variable yb 1e x y dx dy and DISCUSSION TOPICS 2.4.26 Suppose X 2 or P Y 2? Why? (Hint: Look at Figure 2.4.5.) N 0 1 and Y N 0 4. Which do you think is larger, P X 2.5 Cumulative Distribution Functions If X is a random variable, then its distribution consists of the values of P X B for all subsets B of the real numbers. However, there are certain special subsets B that are x] for some real number x, then convenient to work with. Specifically, if B P X x. It turns out (see Theorem 2.5.1) that it is sufficient to keep track of P X x for all real numbers x. P X B This motivates the following definition. Definition 2.5.1 Given a random variable X, its cumulative distribution function (or distribution function, or cdf for short) is the function FX : R1 [0 1], defined by FX x x. (Where there is no confusion, we sometimes write F x for FX x.) P X The reason for calling FX the “distribution function” is that the full distribution of X can be determined directly from FX. We demonstrate this for some events of particular importance. First, suppose that B a b] is a left­open interval. Using (1.3.3), FX b FX a Now, suppose that B [a b] is a closed interval. Using the continuity of proba­ bility (see Theorem 1.6.1), we have P X B P a X b lim n FX b lim n FX a P a 1 n X b 1 n FX b lim n FX a 1 n Chapter 2: Random Variables and Distributions 63 We sometimes write limn FX a FX b In the special case where a b, we have FX a 1 n as FX a, so that
P X [a b] P X a FX a FX a (2.5.1) Similarly, if B a b is an open interval, then P X B P a X b lim n FX b 1 n FX a FX b FX a If B [a b is a right­open interval, then P X B P a X b lim n FX b 1 n lim n FX a 1 n FX b FX a We conclude that we can determine P X interval. B from FX whenever B is any kind of Now, if B is instead a union of intervals, then we can use additivity to again com­ pute P X B from FX. For example, if B a1 b1] a2 b2] ak bk] with a1 b1 a2 b2 ak bk, then by additivity, P X B P X FX b1 a1 b1] FX a1 P X ak bk] FX bk FX ak Hence, we can still compute P X B solely from the values of FX x. Theorem 2.5.1 Let X be any random variable, with cumulative distribution func­ tion FX. Let B be any subset of the real numbers. Then P X B can be deter­ mined solely from the values of FX x. PROOF (Outline) It turns out that all relevant subsets B can be obtained by apply­ ing limiting operations to unions of intervals. Hence, because FX determines P X B when B is a union of intervals, it follows that FX determines P X relevant subsets B. B for all 2.5.1 Properties of Distribution Functions In light of Theorem 2.5.1, we see that cumulative distribution functions FX are very useful. Thus, we note a few of their basic properties here. Theorem 2.5.2 Let FX be the cumulative distribution function of a random variable X. Then (a) 0 (b) FX x (c) limx (d) limx 1 for all x, FX y whenever x FX x FX x y (i.e., FX is increasing), FX x 1, 0. 64 Section 2.5: Cumulative Distribution Functions PROOF (a) Because FX x P X x is a probability, it is between 0 and 1. (b) Let A P A X P B. But P A x and B X FX x and P B y. Then if x y, then A B, so that FX y, so
the result follows. n. Because X must take on some value and hence X X (c) Let An sufficiently large n, we see that An increases to S, i.e., An Hence, by continuity of P (see Theorem 1.6.1), limn P An FX n, so the result follows. P X n P An n for S (see Section 1.6). 1. But P S X (d) Let Bn to the empty set, i.e., Bn P 0. But P Bn n. Because X n for sufficiently large n, Bn decreases. Hence, again by continuity of P, limn n, so the result follows. n FX P X P Bn If FX is a cumulative distribution function, then FX is also right continuous; see Prob­ lem 2.5.17. It turns out that if a function F : R1 R1 satisfies properties (a) through (d) and is right continuous, then there is a unique probability measure P on R1 such that F is the cdf of P We will not prove this result here.2 2.5.2 Cdfs of Discrete Distributions We can compute the cumulative distribution function (cdf) FX of a discrete random variable from its probability function pX, as follows. Theorem 2.5.3 Let X be a discrete random variable with probability function pX. Then its cumulative distribution function FX satisfies FX x y x pX y PROOF x P X xi Let x1 x2 xi be the possible values of X. Then FX x as claimed. y x pX y y x P X y P X x Hence, if X is a discrete random variable, then by Theorem 2.5.3, FX is piecewise constant, with a jump of size pX xi at each value xi. A plot of such a distribution looks like that depicted in Figure 2.5.1. We consider an example of a distribution function of a discrete random variable. EXAMPLE 2.5.1 Consider rolling one fair six­sided die, so that S for each s s 6 for s S. Let X be the number showing on the die divided by 6, so that X s 6x we have that S. What is FX x? Since X s x if and only if s 1
2 3 4 5 6, with P s 1 6 FX x P X x P s s S s 6x s S s 6x 1 6 1 6 s S : s 6x 2For example, see page 67 of A First Look at Rigorous Probability Theory, Second Edition, by J. S. Rosen­ thal (World Scientific Publishing, Singapore, 2006). Chapter 2: Random Variables and Distributions 65 That is, to compute FX x, we count how many elements s multiply that number by 1 6. Therefore, S satisfy s 6x and FX In Figure 2.5.1, we present a graph of the function FX and note that this is a step function. Note (see Exercise 2.5.1) that the properties of Theorem 2.5.2 are indeed satisfied by the function FX. F 1.0 0.8 0.6 0.4 0.2 0.0 0.0 0.2 0.4 0.6 0.8 1.0 1.2 x Figure 2.5.1: Graph of the cdf FX in Example 2.5.1. 2.5.3 Cdfs of Absolutely Continuous Distributions Once we know the density f X of X, then it is easy to compute the cumulative distribu­ tion function of X, as follows. Theorem 2.5.4 Let X be an absolutely continuous random variable, with density function f X. Then the cumulative distribution function FX of X satisfies x FX x f X t dt for x R1 PROOF This follows from (2.4.5), by setting b x and letting a. From the fundamental theorem of calculus, we see that it is also possible to compute a density f X once we know the cumulative distribution function FX. 66 Section 2.5: Cumulative Distribution Functions Corollary 2.5.1 Let X be an absolutely continuous random variable, with cumula­ tive distribution function FX. Let f X x d dx FX x FX x Then f X is a density function for X. We note that FX might not be differentiable everywhere, so that the function f X of the corollary might not be defined at certain isolated points. The density function may take any value at such points. Consider again the N 0 1 distribution, with density given by (2.4.9). According to Theorem 2
.5.4, the cumulative distribution function F of this distribution is given by x x F x t dt e t 2 2 dt 1 2 It turns out that it is provably impossible to evaluate this integral exactly, except for ). Nevertheless, the certain specific values of x (e.g., x cumulative distribution function of the N 0 1 distribution is so important that it is assigned a special symbol. Furthermore, this is tabulated in Table D.2 of Appendix D for certain values of x. 0, or x, x Definition 2.5.2 The symbol a standard normal distribution, defined by stands for the cumulative distribution function of x x x t dt 1 2 e t 2 2 dt (2.5.2) for x R1 EXAMPLE 2.5.2 Normal Probability Calculations N 0 1 and we want to calculate Suppose that X P 0 63 63 2, while P X Then P X 2 and 0 63. Unfortunately, 0 63 2 0 63 cannot be computed exactly, but they can be approximated us­ ing a computer to numerically calculate the integral (2.5.2). Virtually all statistical software packages will provide such approximations, but many tabulations such as 0 9772 while Table D.2, are also available. Using this table, we obtain 2 0 63 0 2643 This implies that P 0 63 X 2 0 Now suppose that X N 2 0 2 0 63 0 9772 0 2643 0 7129 and we want to calculate P a X b Letting f denote the density of X and following Example 2.4.8, we have P a X b b a f x dx a b 1 x dx Chapter 2: Random Variables and Distributions 67 Then, again following Example 2.4.8, we make the substitution y above integral to obtain x in the P a X b b a x dx b a Therefore, general normal probabilities can be computed using the function 4 We obtain Suppose now that a 1 3 and 2 0 63 b 2 0 P 0 63 X 2 0 2 0 1 3 2 0 35 0 46955 1 3 0 63 2 0 6368 0 965 0 16725 because, using Table D.2, linear interpolation between the values given by 0 35 0 6368 We approximate 0 96 0 1685 0 965 by the 0 1660 0 97 0 965 0 96 0 97 0 97 0 96
0 96 0 965 0 96 0 1685 0 1660 0 97 0 1685 0 96 0 965 0 96 0 16725 EXAMPLE 2.5.3 Let X be a random variable with cumulative distribution function given by FX x 0 x 1 2 4 16 x 2 4 2 x x 4 In Figure 2.5.2, we present a graph of FX 1.0 F 0.5 0.0 1 2 3 4 5 x Figure 2.5.2: Graph of the cdf FX in Example 2.5.3. Suppose for this random variable X we want to compute P X 3, 3 4. We can compute all these probabilities directly 3, P X P X 2 5 and P 1 2 X 68 Section 2.5: Cumulative Distribution Functions from FX. We have that FX 3 FX 3 2 4 16 3 1 16 1 n 2 4 16 1 16 3 lim n P X 1 1 2 5 FX 3 4 2 5 2 4 16 FX 1 2 1 FX 2 5 1 0 0625 16 2 4 16 3 4 0 996 0 0 2401 2.5.4 Mixture Distributions Suppose now that F1 F2 ing to various distributions. Also let p1 p2 Fk are cumulative distribution functions, correspond­ pk be positive real numbers with 1 (so these values form a probability distribution). Then we can define a k i 1 pi new function G by G x p1 F1 x p2 F2 x pk Fk x (2.5.3) It is easily verified (see Exercise 2.5.6) that the function G given by (2.5.3) will satisfy properties (a) through (d) of Theorem 2.5.2 and is right continuous. Hence, G is also a cdf. The distribution whose cdf is given by (2.5.3) is called a mixture distribution be­ Fk according to the probabil­ cause it mixes the various distributions with cdfs F1 ity distribution given by the p1 p2 pk To see how a mixture distribution arises in applications, consider a two­stage sys­ tem, as discussed in Section 1.5.1. Let Z be a random variable describing the outcome of the first stage and such that P Z k Suppose that for the second stage, we observe a random variable Y where the distribution of Y depends i In
effect, Fi is the on the outcome of the first stage, so that Y has cdf Fi when Z conditional distribution of Y given that Z i (see Section 2.8). Then, by the law of total probability (see Theorem 1.5.1), the distribution function of Y is given by pi for pi Fi y G y Therefore, the distribution function of Y is given by a mixture of the Fi Consider the following example of this. EXAMPLE 2.5.4 Suppose we have two bowls containing chips. Bowl #1 contains one chip labelled 0, two chips labelled 3, and one chip labelled 5. Bowl #2 contains one chip labelled 2, one chip labelled 4, and one chip labelled 5. Now let Xi be the random variable corresponding to randomly drawing a chip from bowl #i. Therefore, P X1 P X2 1 4, P X1 1 4, while P X2 1 2, and P X1 0 4 5 3 2 Chapter 2: Random Variables and Distributions 69 P X2 5 1 3. Then X1 has distribution function given by F1 x 0 1 4 3 4 1 and X2 has distribution function given by F2 Now suppose that we choose a bowl by randomly selecting a card from a deck of five cards where one card is labelled 1 and four cards are labelled 2. Let Z denote the value on the card obtained, so that P Z 4 5 Then, 1 5 and P Z having obtained the value Z i, we observe Y by randomly drawing a chip from bowl #i. We see immediately that the cdf of Y is given by 1 2 G x 1 5 F1 x 4 5 F2 x and this is a mixture of the cdfs F1 and F2. As the following examples illustrate, it is also possible to have infinite mixtures of distributions. EXAMPLE 2.5.5 Location and Scale Mixtures Suppose F is some cumulative distribution function. Then for any real number y, the y is also a cumulative distribution function. In function Fy defined by Fy x fact, Fy is just a “shifted” version of F. An example of this is depicted in Figure 2.5.3. F x 1.0 F 0.5 ­10 ­5 0 5 10 x Figure 2.5.3: Plot of the distribution functions F (solid line) and F2 (dashed line
) in Example R1 2.5.5, where F x 1 for x ex ex If pi 0 with i pi 1 (so the pi form a probability distribution), and y1 y2 are real numbers, then we can define a discrete location mixture by H x pi Fyi x pi F x yi i i 70 Section 2.5: Cumulative Distribution Functions Indeed, the shift Fy x location mixture, with p1 F x y itself corresponds to a special case of a discrete 1 and y1 y. Furthermore, if g is some nonnegative function with g t dt 1 (so g is a density function), then we can define H x Fy x g y dy F x y g y dy Then it is not hard to see that H is also a cumulative distribution function — one that is called a continuous location mixture of F The idea is that H corresponds to a mixture of different shifted distributions Fy, with the density g giving the distribution of the mixing coefficient y. We can also define a discrete scale mixture by K x pi F x yi i whenever yi write 0, pi 0, and i pi 1. Similarly, if 0 g t dt 1, then we can K x F x y g y dy 0 Then K is also a cumulative distribution function, called a continuous scale mixture of F. You might wonder at this point whether a mixture distribution is discrete or con­ tinuous. The answer depends on the distributions being mixed and the mixing distrib­ ution. For example, discrete location mixtures of discrete distributions are discrete and discrete location mixtures of continuous distributions are continuous. There is nothing restricting us, however, to mixing only discrete distributions or only continuous distributions. Other kinds of distribution are considered in the follow­ ing section. 2.5.5 Distributions Neither Discrete Nor Continuous (Advanced) There are some distributions that are neither discrete nor continuous, as the following example shows. EXAMPLE 2.5.6 Suppose that X1 ous with cdf F2 and Y has the mixture distribution given by FY y 4 5 F2 y Using (2.5.1), we have Poisson 3 is discrete with cdf F1, while X2 N 0 1 is continu­ 1 5 F1 y P Y y FY y FY y 1 5 F1 y 1 5 F1 y 1 5 P X1 y 4 5 F2 y F1 y
4 5 P X2 1 5 F1 y 4 5 F2 y 4 5 F2 y F2 y y Chapter 2: Random Variables and Distributions 71 Therefore, P Y y 3y y! e 3 1 5 0 y a nonnegative integer otherwise. Because P Y y continuous. On the other hand, we have 0 for nonnegative integers y the random variable Y is not P Y y y y 0 1 5 3y y! e 3 1 5 1 Hence, Y is not discrete either. In fact, Y is neither discrete nor continuous. Rather, Y is a mixture of a discrete and a continuous distribution. For the most part in this book, we shall treat discrete and continuous distributions separately. However, it is important to keep in mind that actual distributions may be neither discrete nor continuous but rather a mixture of the two.3 In most applications, however, the distributions we deal with are either continuous or discrete. Recall that a continuous distribution need not be absolutely continuous, i.e., have a density. Hence, a distribution that is a mixture of a discrete and a continuous distribu­ tion might not be a mixture of a discrete and an absolutely continuous distribution. Summary of Section 2.5 The cumulative distribution function (cdf) of X is FX x P X All probabilities associated with X can be determined from FX. As x increases from to If X is discrete, then FX x, FX x increases from 0 to 1 for the cdf of the standard normal distribution evaluated at x. If X is absolutely continuous, then FX x We write A mixture distribution has a cdf that is a linear combination of other cdfs. Two special cases are location and scale mixtures. Some mixture distributions are neither discrete nor continuous. f X t dt, and f X x FX x. EXERCISES 2.5.1 Verify explicitly that properties (a) through (d) of Theorem 2.5.2 are indeed sat­ isfied by the function FX in Example 2.5.1. 2.5.2 Consider rolling one fair six­sided die, so that S 1 6 for all s Let Y y by this function FY. S. y, for all R1. Verify explicitly that properties (a) through (d) of Theorem 2.5.2 are satisfied X 2. Compute the cumulative distribution function FY y S. Let X be the number showing on the die, so that X s 1
2 3 4 5 6, and P s s for s P Y 3In fact, there exist probability distributions that cannot be expressed even as a mixture of a discrete and a continuous distribution, but these need not concern us here. 72 Section 2.5: Cumulative Distribution Functions 2.5.3 For each of the following functions F, determine whether or not F is a valid cumulative distribution function, i.e., whether or not F satisfies properties (a) through (d) of Theorem 2.5.2. (a) F x x for all x (b) R1 (c) (d) (e) (f) (g. Compute each of the following in terms of the function of 2.5.4 Let X Definition 2.5.2 and use Table D.2 (or software) to evaluate these probabilities numer­ ically. (a) P X (b) P 2 (c) P X 3 2.5.5 Let Y N 8 4. Compute each of the following, in terms of the function of Definition 2.5.2 and use Table D.2 (or software) to evaluate these probabilities 5 X 7 numerically. (a) P Y (b) P 2 (c) P Y 3 5 Y 7 Chapter 2: Random Variables and Distributions 73 for 0 y3 for 0 1 for 1 2 1 2) 4 5) y. Compute 1 3 X X 1 2, and FY y 1. Compute each of the following. 2.5.6 Verify that the function G given by (2.5.3) satisfies properties (a) through (d) of Theorem 2.5.2. 2.5.7 Suppose FX x (a) P X (b) P 1 4 (c) P 2 5 (d) P X (e) P X (f) P X (g) P X (h) P X 2.5.8 Suppose FY y each of the following. Y (a) P 1 3 3 4 1 3 (b) P Y (c) P Y 1 2 2.5.9 Let F x x (a) Sketch a graph of F. (b) Is F a valid cumulative distribution function? Why or why not? 2.5.10 Let F x (a) Sketch a graph of F. (b)
Is F a valid cumulative distribution function? Why or why not? 2.5.11 Let F x (a) Sketch a graph of F. (b) Is F a valid cumulative distribution function? Why or why not? 2.5.12 Let X 2.5.13 Let F x x for 2 5 (a) Sketch a graph of F. (b) Prove that F is a valid cumulative distribution function. (c) If X has cumulative distribution function equal to F, then compute P X and P 1 Exponential 3. Compute the function FX. 0, with F x 1 for x 2 5 and P X 1 2 and P X 2 5, and F x 4 5, and F x 2, with F x 0, with F x 0, with F x e x for x e x for x 0 and F x x 2 for 0 1 3 for 0 0 for x 0 for x 0 for x 0 for x 4 5. 4 for 4 5. 4 5 3 4 0. 0. 2. X 1 x x e x2 1 Y 0. 0. for x 0 for x 2 and P Y 0, with G x 2.5.14 Let G x (a) Prove that G is a valid cumulative distribution function. (b) If Y has cumulative distribution function equal to G, then compute P Y P 1 2.5.15 Let F and G be as in the previous two exercises. Let H x 2 3 G x. Suppose Z has cumulative distribution function equal to H. Compute each of the following. (a) P Z (b) P (c) P Z (d and 1 2 1 74 Section 2.6: One­Dimensional Change of Variable (e) P Z (f) P Z 0 1 2 PROBLEMS [F 2n by F x limn R1, we have F x t in (2.5.2), and do not forget Theorem 2.5.2.) be as in Definition 2.5.2. Derive a formula for R1, we could define 1 n. Prove that F is right continuous, meaning that F x. (Hint: You will need to use continuity of P 2.5.16 Let F be a cumulative distribution function. Compute (with explanation) the value of limn F n ]. 2.5.17 Let F be a cumulative distribution function. For x F
x F x for each x (Theorem 1.6.1).) 2.5.18 Let X be a random variable, with cumulative distribution function FX. Prove 0 if and only if the function FX is continuous at a. (Hint: Use (2.5.1) a that P X and the previous problem.) 2.5.19 Let (Hint: Let s 2.5.20 Determine the distribution function for the logistic distribution of Problem 2.4.18. 2.5.21 Determine the distribution function for the Weibull 2.4.19. 2.5.22 Determine the distribution function for the Pareto 2.4.20. 2.5.23 Determine the distribution function for the Cauchy distribution of Problem 2.4.21. 2.5.24 Determine the distribution function for the Laplace distribution of Problem 2.4.22. 2.5.25 Determine the distribution function for the extreme value distribution of Prob­ lem 2.4.23. 2.5.26 Determine the distribution function for the beta distributions of Problem 2.4.24 for parts (b) through (e). distribution of Problem distribution of Problem x in terms of x. DISCUSSION TOPICS 2.5.27 Does it surprise you that all information about the distribution of a random variable X can be stored by a single function FX? Why or why not? What other examples can you think of where lots of different information is stored by a single function? 2.6 One­Dimensional Change of Variable Let X be a random variable with a known distribution. Suppose that Y h : R1 R1 is some function. (Recall that this really means that Y s all s S.) Then what is the distribution of Y? h X, where, for h X s Chapter 2: Random Variables and Distributions 75 2.6.1 The Discrete Case If X is a discrete random variable, this is quite straightforward. To compute the proba­ y we need to compute the probability of the set consisting of all the x bility that Y This is depicted values satisfying h x graphically in Figure 2.6.1. y, namely, compute P X x : h x y h.. x1 x2. x3 R1 1. y R1 { x : h(x) = y } = { x1, x2, x3 } Figure
2.6.1: An example where the set of x values that satisfy h x points x1 x2 and x3 y consists of three We now establish the basic result. h X, where h : R1 Theorem 2.6.1 Let X be a discrete random variable, with probability function pX. R1 is some function. Then Y is also discrete, Let Y x h 1 y pX x where h 1 y and its probability function pY satisfies pY y y. is the set of all real numbers x with h x PROOF We compute that pY as claimed. x h 1 y pX x EXAMPLE 2.6.1 Let X be the number of heads when ipping three fair coins. Let Y Y Hence where h 0 P X 1 2 3, so P Y 1 8 0 and h 1 0 0, so P Y 0. Then Y 0 if X P X P X 7 8. 3 8 1 0 1 h 2 1 if X 1, with 1. 1 8. On the other hand, P X h 3 3 2 EXAMPLE 2.6.2 Let X be the number showing on a fair six­sided die, so that P X 1 2 3 4 5 and 6. Let Y Note that h x 3X 2. Then Y 1 or x 2. Hence, h 1 0 0 if and only if x x h X where h x X 2 1 6 for x x 2 1 2 and 3x 2. P Y 0 pX 1 pX 2 1 6 1 6 1 3 2.6.2 The Continuous Case If X is continuous and Y might not be continuous at all, as the following example shows. h X, then the situation is more complicated. Indeed, Y 76 Section 2.6: One­Dimensional Change of Variable EXAMPLE 2.6.3 Let X have the uniform distribution on [0 1], i.e., X ple 2.4.2. Let Y h X, where Uniform[0 1] as in Exam if and only if X 5 if and only if X Here, Y Y discrete, with probability function pY satisfying pY 7 pY y 3 4 (which happens with probability 3 4), whereas 3 4 (which happens with probability 1 4). Hence, Y is 1 4 and 3 4 pY 5 0 when y 5 7. On the other hand, if X is absolutely continuous, and the function h
is strictly increasing, then the situation is considerably simpler, as the following theorem shows. Theorem 2.6.2 Let X be an absolutely continuous random variable, with density R1 is a function that is differen­ function f X. Let Y tiable and strictly increasing. Then Y is also absolutely continuous, and its density function fY is given by h X, where h : R1 fY 2.6.1) where h is the derivative of h, and where h 1 y is the unique number x such that h x y. PROOF See Section 2.11 for the proof of this result. EXAMPLE 2.6.4 Let X Uniform[0 1], and let Y Here, X has density f X given by f X x 3X. What is the distribution of Y? 1 if 0 h X, where h is defined by h x y, then 3x 3y, i.e., h x x 0 1, and f X x 3x. Note that h is strictly h y. Hence, we may apply otherwise. Also, Y increasing because if x Theorem 2.6.2. We note first that h x 3 and that h 1 y rem 2.6.2, Y is absolutely continuous with density y 3. Then, according to Theo­ fY otherwise otherwise. By comparison with Example 2.4.3, we see that Y Uniform[0 3], i.e., that Y has the Uniform[L R] distribution with L 0 and R 3. EXAMPLE 2.6.5 Let X N 0 1, and let Y 2X 5. What is the distribution of Y? Here, X has density f X given by f X x x 1 2 e x2 2 Chapter 2: Random Variables and Distributions 77 h X, where h is defined by h x y, then 2x 5 2y 2x 5, i.e., h x 5. Note that again, h is strictly h y. Hence, we may Also, Y increasing because if x again apply Theorem 2.6.2. We note first that h x 2 and that h 1 y y 5 2. Then, according to Theorem 2.6.2, Y is absolutely continuous with density fY By comparison with Example 2.4.8, we see that Y N 5 4, i.e., that Y has the
N 2 distribution with 5 and 2 4. If instead the function h is strictly decreasing, then a similar result holds. Theorem 2.6.3 Let X be an absolutely continuous random variable, with density R1 is a function that is differen­ function f X. Let Y tiable and strictly decreasing. Then Y is also absolutely continuous, and its density function fY may again be defined by (2.6.1). h X, where h : R1 PROOF See Section 2.11 for the proof of this result. EXAMPLE 2.6.6 Let X Uniform[0 1], and let Y ln 1 X. What is the distribution of Y? Here, X has density f X given by f X x 1 for 0 h X, where h is defined by h x otherwise. Also, Y h is strictly decreasing because if x h x y, then 1 x h y. Hence, we may apply Theorem 2.6.3. 1 x and that h 1 y We note first that h x x 0 1, and f X x ln 1 x. Note that here, ln 1 y, i.e., 1 y, so ln 1 x e y. Then, by Theorem 2.6.3, Y is absolutely continuous with density fY otherwise otherwise. By comparison with Example 2.4.4, we see that Y the Exponential 1 distribution. Exponential 1, i.e., that Y has Finally, we note the following. Theorem 2.6.4 Theorem 2.6.2 (and 2.6.3) remains true assuming only that h is strictly increasing (or decreasing) at places for which f X x 0 for an interval of x values, then it does not matter how the function h behaves in that interval (or even if it is well defined there). 0. If f X x Exponential, then f X x EXAMPLE 2.6.7 0. Therefore, it is required that h be If X x 2, strictly increasing (or decreasing) only for x x could still be used with Theorem 2.6.2, while functions h x such as h x x could still be used with The­ orem 2.6.3, even though such functions may not necessarily be strictly increasing (or decreasing) and well defined on the entire real line.
0. Thus, functions such as h x x 8, and h x x 8, and h x x 2, h x 0 for x 78 Section 2.6: One­Dimensional Change of Variable Summary of Section 2.6 h X, then P Y If X is discrete, and Y If X is absolutely continuous, and Y h h 1 y decreasing, then the density of Y is given by fY y This allows us to compute the distribution of a function of a random variable. h X with h strictly increasing or strictly : h x x. y EXERCISES cX, where c 0. Prove that Y X 3. Compute the density fY of Y. X 1 4. Compute the density fY of Y. (Hint: d, where c d]. (This generalizes Example 2.6.4.) d, where c cX cX 0. Prove that Y 0. Prove that Y d]. (In particular, if L 1 and c 1 and d 1, 0 and R X Uniform[0 1].) d, where c 0. Prove that Y N c d cR 1 cX. Let Y 2. Let Y Exponential. Let Y. Let Y Uniform[L R]. Let Y Uniform[L R]. Let Y c. Exponential Exponential 2.6.1 Let X Uniform[cL 2.6.2 Let X d cL Uniform[c R then X Uniform[0 1] and also Y 2.6.3 Let X N d c2 2. (This generalizes Example 2.6.5.) 2.6.4 Let X Exponential 2.6.5 Let X 2.6.6 Let X Use Theorem 2.6.4.) 2.6.7 Let X Uniform[0 3]. Let Y 2.6.8 Let X have a density such that f X about 2 determine the distribution of Y when X 2.6.9 Let X have density function f X x (a) Let Y (b) Let Z 2.6.10 Let X fY y for Y. 2.6.11 Let X have density function f X x f X x 2.6.12 Let X have density function f X x Let Y 2.6.13 Let X Y. Normal 0 1. Let Y Uniform[0 0. Let Y. Let Y X 2. Compute the density function fY of Y. x i.
e., it is symmetric X. Show that the density of Y is given by f X. Use this to f X x 2 N x 3 4 for 0 x X 2. Compute the density function fY y for Y. X. Compute the density function f Z z for Z. 2]. Let Y sin X. Compute the density function 2, otherwise f X x 0. x X 2. Compute the density function fY y for Y. 1 2 sin x for 0, otherwise 1 x 2 for x X 1 3. Compute the density function fY y for Y. 1, otherwise f X x 0. X 3. Compute the density function fY y for PROBLEMS X 3, and Z 2.6.14 Let X Uniform[2 7], Y in two ways. (a) Apply Theorem 2.6.2 to first obtain the density of Y, then apply Theorem 2.6.2 again to obtain the density of Z. (b) Observe that Z X 3 2, and apply Theorem 2.6.2 just once. Y. Compute the density f Z of Z, X 3 Y Chapter 2: Random Variables and Distributions 79 h X where h x c 6. According 2.6.15 Let X Uniform[L R], and let Y to Theorem 2.6.4, under what conditions on L R, and c can we apply Theorem 2.6.2 or Theorem 2.6.3 to this choice of X and Y? 2.6.16 Let X N c 2.6.17 (Log­normal has density d c2 2, just like in Exercise 2.6.3. distribution) Suppose that X 0. Prove that again Y 2 Prove that Y 2. Let Y d, where c N 0 e X cX N x f y 1 2 exp ln y 2 2 2 1 y X Log­normal 0 and where 0 is unknown. We say that Y for y 2.6.18 Suppose that X Weibull of Y 2.6.19 Suppose that X of Y 2.6.20 Suppose that X has the extreme value distribution (see Problem 2.4.23). Deter­ mine the distribution of Y (see Problem 2.4.20). Determine the distribution (see Problem 2.4.19). Determine the distribution Pareto e X X 1 1 CH
ALLENGES 2.6.21 Theorems 2.6.2 and 2.6.3 require that h be an increasing or decreasing function, at least at places where the density of X is positive (see Theorem 2.6.4). Suppose now that X 0 for all x, while N 0 1 and Y 0. Hence, Theorems 2.6.2 h is increasing only for x and 2.6.3 do not directly apply. Compute fY y anyway. (Hint: P a Y P a h X where h x 0 and decreasing only for x x 2. Then.) Y Y 0 b 2.7 Joint Distributions Suppose X and Y are two random variables. Even if we know the distributions of X and Y exactly, this still does not tell us anything about the relationship between X and Y. EXAMPLE 2.7.1 Let X Y2 well. 1 Bernoulli 1 2, so that P X X. Then we clearly have Y1 P X 0 Bernoulli 1 2 and Y2 1 1 2. Let Y1 X, and let Bernoulli 1 2 as On the other hand, the relationship between X and Y1 is very different from the re­ 1, then we also must lationship between X and Y2. For example, if we know that X have Y1 0. Hence, merely knowing that X, Y1, and Y2 all have the dis­ tribution Bernoulli 1 2 does not give us complete information about the relationships among these random variables. 1, but Y2 A formal definition of joint distribution is as follows. 80 Section 2.7: Joint Distributions Definition 2.7.1 If X and Y are random variables, then the joint distribution of X R2 of and Y is the collection of probabilities P X Y pairs of real numbers. B, for all subsets B Joint distributions, like other distributions, are so complicated that we use vari­ ous functions to describe them, including joint cumulative distribution functions, joint probability functions, and joint density functions, as we now discuss. 2.7.1 Joint Cumulative Distribution Functions Definition 2.7.2 Let X and Y be random variables. Then their joint cumulative distribution function is the function FX Y : R2 [0 1] defined by FX Y x y P X x Y y (Recall that the comma
means “and” here, so that FX Y x y is the probability that X x and Y y.) EXAMPLE 2.7.2 (Example 2.7.1 continued) Again, let X Bernoulli 1 2, Y1 X, and Y2 1 X. Then we compute that FX Y1 x y P X x Y1 y 0 1 2 1 0 min x y 0 min x y 1 min x y 1 On the other hand, FX Y2 x y P X x Y2 y 0 1 2 1 min x y 0 min x y 1 min x y 0 or max x y 1 1 max x y We thus see that FX Y1 is quite a different function from FX Y2. This reects the fact that, even though Y1 and Y2 each have the same distribution, their relationship with X is quite different. On the other hand, the functions FX Y1 and FX Y2 are rather cumbersome and awkward to work with. We see from this example that joint cumulative distribution functions (or joint cdfs) do indeed keep track of the relationship between X and Y. Indeed, joint cdfs tell us everything about the joint probabilities of X and Y, as the following theorem (an analog of Theorem 2.5.1) shows. Theorem 2.7.1 Let X and Y be any random variables, with joint cumulative dis­ tribution function FX Y. Let B be a subset of R2. Then P X Y B can be determined solely from the values of FX Y x y. We shall not give a proof of Theorem 2.7.1, although it is similar to the proof of Theorem 2.5.1. However, the following theorem indicates why Theorem 2.7.1 is true, and it also provides a useful computational fact. Chapter 2: Random Variables and Distributions 81 Theorem 2.7.2 Let X and Y be any random variables, with joint cumulative distri­ bution function FX Y. Suppose a d. Then b and c P a X b c Y d FX Y b d FX Y a d FX Y b c FX Y a c PROOF According to (1.3.3), and either X a or Y c But by the principle of inclusion–exclusion (1.3.4), P X b Y d and either X P X b Y c P X a or Combining these two equations, we see
that and from this we obtain FX Y b d FX Y a d FX Y b c FX Y a c as claimed. Joint cdfs are not easy to work with. Thus, in this section we shall also consider other functions, which are more convenient for pairs of discrete or absolutely continu­ ous random variables. 2.7.2 Marginal Distributions We have seen how a joint cumulative distribution function FX Y tells us about the rela­ tionship between X and Y. However, the function FX Y also tells us everything about each of X and Y separately, as the following theorem shows. Theorem 2.7.3 Let X and Y be two random variables, with joint cumulative distri­ bution function FX Y. Then the cumulative distribution function FX of X satisfies FX x lim y FX Y x y for all x R1 Similarly, the cumulative distribution function FY of Y satisfies FY y lim x FX Y x y for all y R1 82 Section 2.7: Joint Distributions PROOF Note that we always have Y. Hence, using continuity of P, we have as claimed. Similarly, FX x FY y P X P X lim y lim y P Y P X lim x lim x x x Y P X x Y y FX FX Y x y completing the proof. In the context of Theorem 2.7.3, FX is called the marginal cumulative distribu­ tion function of X, and the distribution of X is called the marginal distribution of X. (Similarly, FY is called the marginal cumulative distribution function of Y, and the distribution of Y is called the marginal distribution of Y.) Intuitively, if we think of FX Y as being a function of a pair x y, then FX and FY are functions of x and y, respectively, which could be written into the “margins” of a graph of FX Y. EXAMPLE 2.7.3 In Figure 2.7.1, we have plotted the joint distribution function FX Y x y 0 x y2 x y2 1 1 x 0 0 x x 0 or and y y 1 1 1 It is easy to see that for 0 x 1 and that FX x FX Y x 1 x FY y FX Y 1 y y2 y for 0 surface depicted in Figure 2.7.1. 1 The graphs of these functions are given by the outermost edges of the Chapter 2: Random Variables and Distributions 83 1
.0 F 0.5 0.0 0.0 0.0 0.5 x 1.0 0.5 y 1.0 Figure 2.7.1: Graph of the joint distribution function FX Y x y 0 1 in Example 2.7.3. y x y2 for 0 x 1 and Theorem 2.7.3 thus tells us that the joint cdf FX Y is very useful indeed. Not only does it tell us about the relationship of X to Y, but it also contains all the information about the marginal distributions of X and of Y. We will see in the next subsections that joint probability functions, and joint density functions, similarly contain information about both the relationship of X and Y and the marginal distributions of X and Y. 2.7.3 Joint Probability Functions Suppose X and Y are both discrete random variables. Then we can define a joint probability function for X and Y, as follows. Definition 2.7.3 Let X and Y be discrete random variables. Then their joint prob­ ability function, pX Y, is a function from R2 to R1, defined by pX Y x y P X x Y y Consider the following example. 84 Section 2.7: Joint Distributions EXAMPLE 2.7.4 (Examples 2.7.1 and 2.7.2 continued) Again, let X Bernoulli 1 2, Y1 X, and Y2 1 X. Then we see that pX Y1 x y P X x Y1 y On the other hand, pX Y2 x y P X x Y2 otherwise. 1 y x x 0 y otherwise. 0 1 We thus see that pX Y1 and pX Y2 are two simple functions that are easy to work with and that clearly describe the relationships between X and Y1 and between X and Y2. Hence, for pairs of discrete random variables, joint probability functions are usually the best way to describe their relationships. Once we know the joint probability function pX Y, the marginal probability func­ tions of X and Y are easily obtained. Theorem 2.7.4 Let X and Y be two discrete random variables, with joint probabil­ ity function pX Y. Then the probability function pX of X can be computed as pX x pX Y x y y Similarly, the probability function pY of Y can be computed as pY y pX Y
x y x PROOF Using additivity of P, we have that pX x P X x P X x Y y pX Y x y as claimed. Similarly, pY pX Y x y EXAMPLE 2.7.5 Suppose the joint probability function of X and Y is given by pX otherwise 0 3 4 0 4 Chapter 2: Random Variables and Distributions 85 Then while pX 5 pX Y 5 y pX Y 5 0 pX Y 5 3 pX pX 8 pX Y 8 y pX Y 8 0 pX Y 8 4 y x Similarly, pY 4 etc. pX Y x 4 pX Y 5 4 pX Note that in such a simple context it is possible to tabulate the joint probability function in a table, as illustrated below for pX Y pX and pY of this example Summing the rows and columns and placing the totals in the margins gives the marginal distributions of X and Y. 2.7.4 Joint Density Functions If X and Y are continuous random variables, then clearly pX Y x y 0 for all x and y. Hence, joint probability functions are not useful in this case. On the other hand, we shall see here that if X and Y are jointly absolutely continuous, then their relationship may be usefully described by a joint density function. Definition 2.7.4 Let f : R2 if f x y 0 for all x and y, and R1 be a function. Then f is a joint density function f x y dx dy 1. Definition 2.7.5 Let X and Y be random variables. Then X and Y are jointly ab­ solutely continuous if there is a joint density function f, such that dx dy for all a b c d 86 Section 2.7: Joint Distributions Consider the following example. EXAMPLE 2.7.6 Let X and Y be jointly absolutely continuous, with joint density function f given by f x y 2y5 4x 2 y 0 0 x otherwise. 1 0 y 1 We first verify that f is indeed a density function. Clearly, f x y 0 for all x and y. Also, f x y dx dy 1 1 4x 2 y 2y5 dx dy 2y5 dy Hence, f is a joint density function. In Figure 2.7.2, we have plotted the function f which gives a surface over the unit
square. 6 4 2 f 0 0.0 0.0 0.5 x 1.0 0.5 y 1.0 Figure 2.7.2: A plot of the density f in Example 2.7.6. Chapter 2: Random Variables and Distributions 87 We next compute. Indeed, we have 4x 2 y 2y5 dx dy 2y5 0 7 0 5 dy 147 Other probabilities can be computed similarly. Once we know a joint density f X Y, then computing the marginal densities of X and Y is very easy, as the following theorem shows. Theorem 2.7.5 Let X and Y be jointly absolutely continuous random variables, with joint density function f X Y. Then the (marginal) density f X of X satisfies f X x f X Y x y dy for all x R1 Similarly, the (marginal) density fY of Y satisfies fY y f X Y x y dx for all y R1 PROOF We need to show that, for a b a tinuity of P, we have that P a and f X Y x y dy dx Now, we always have X b P a b dx. Hence, using con lim c d f x y dx dy b d a c f x y dy d x b a f X Y x y dy d x lim c d lim c d as claimed. The result for fY follows similarly. EXAMPLE 2.7.7 (Example 2.7.6 continued) Let X and Y again have joint density f X Y x y 2y5 4x 2 y 0 0 x otherwise. 1 0 y 1 88 Section 2.7: Joint Distributions Then by Theorem 2.7.5, for dy 1, 1 0 while for x 0 or x 1, 4x 2 y 2y5 dy 2x dy 0 dy 0 Similarly, for 0 y 1, fY y f X Y x y dx 1 0 4x 2 y 2y5 dx 4 3 y 2y5 while for y 0 or y 1, fY y 0. EXAMPLE 2.7.8 Suppose X and Y are jointly absolutely continuous, with joint density f X Y x y 120x 3 y 0 0 y x otherwise. 0 x y 1 Then the region where f X Y x y 0 is a triangle, as depicted in Figure 2.7.3. y 1 1 1 x Figure 2.
7.3: Region of the plane where the density f X Y in Example 2.7.8 is positive. We check that f X Y x y dx dy 1 1 0 0 15 1 x 0 120x 3 y dy dx 1 120x 3 1 0 x 2 dx 2 60 x 3 2x 4 x 5 dx 60 1 4 2 1 5 1 6 2 12 10 1 so that f X Y is indeed a joint density function. We then compute that, for example, f X x 1 x 0 120x 3 y dy 120x 3 1 x 2 2 60 x 3 2x 4 x 5 Chapter 2: Random Variables and Distributions 89 for 0 x 1 (with f X x 0 for x 0 or x 1). EXAMPLE 2.7.9 Bivariate Normal Let and Y have joint density given by 2, and 1 1 2 1 be real numbers, with 1 2 1 2 Distribution 1 0 and 2 1. Let exp R1 y for x distribution. R1 We say that X and Y have the Bivariate Normal 1 2 1 2 It can be shown (see Problem 2.7.13) that X 2 2. Hence, X and Y are each normally distributed. The parameter measures the degree of the relationship that exists between X and Y (see Problem 3.3.17) and is called the correlation. In particular, X and Y are independent (see Section 2.8.3), and so unrelated, if and only if 0 (see Problem 2.8.21). 2 1 and Y N 1 N 2 1 2 0 0 Figure 2.7.4 is a plot of the standard bivariate normal density, given by setting 0 This is a bell­shaped surface in R3 with its peak at the point 0 0 in the x y­plane. The graph of the general Bivariate distribution is also a bell­shaped surface, but the peak is at Normal 2, and the point 2 in the x y­plane and the shape of the bell is controlled by 1 1, and 1 2 1 2 1 1 1 2 0.15 0.10 0.05 2 ­2 0.00 0 0 x 2 ­2y Figure 2.7.4: A plot of the standard bivariate normal density function. 90 Section 2.7: Joint Distributions It can be shown (see Problem 2.9.16) that, when Z1 Z2 are independent random variables, both distributed N 0 1 and we put X 1 1 Z
1 Y 2 2 Z1 1 2 1 2 Z2 (2.7.1) Bivariate Normal then X Y This relationship can be quite useful in establishing various properties of this distribution. We can also write an analogous version Y Z2 and obtain the same distributional result. 2 Z1 X 1 Z1 The bivariate normal distribution is one of the most commonly used bivariate dis­ tributions in applications. For example, if we randomly select an individual from a population and measure his weight X and height Y then a bivariate normal distribution will often provide a reasonable description of the joint distribution of these variables. Joint densities can also be used to compute probabilities of more general regions, [c d] as the following result shows. (We omit the proof. The special case B corresponds directly to the definition of f X Y.) [a b] Theorem 2.7.6 Let X and Y be jointly absolutely continuous random variables, with joint density f X Y, and let B R2 be any region. Then P X Y B f x y dx dy B The previous discussion has centered around having just two random variables, Xn. If the X and Y. More generally, we may consider n random variables X1 random variables are all discrete, then we can further define a joint probability function pX1 xn. If the random variables are jointly absolutely continuous, then we can define a joint density function f X1 [0 1] by pX 1 [0 1] so that Xn : Rn Xn : Rn Xn x1 P X1 Xn xn x1 P a1 X1 bn an b1 b1 a1 an Xn bn f X1 Xn x1 xn dx1 dxn whenever ai bi for all i. Summary of Section 2.7 It is often important to keep track of the joint probabilities of two random vari­ ables, X and Y. Their joint cumulative distribution function is given by FX Y x y x Y If X and Y are discrete, then their joint probability function is given by pX. Chapter 2: Random Variables and Distributions 91 X If X and Y are absolutely continuous, then their joint density function f X Y x y is such that P a The marginal density of X and Y can be computed from any of FX Y, or pX Y, or f X Y. An important example of a joint distribution
is the bivariate normal distribution. b a f X Y x y dx dy b c d c Y d EXERCISES 2.7.1 Let X 2.7.2 Let X 2.7.3 Suppose Bernoulli 1 3, and let Y Bernoulli 1 4, and let Y 4X 2. Compute the joint cdf FX Y. 7X. Compute the joint cdf FX Y. pX 17 y x otherwise 3 2 2 3 19 (a) Compute pX. (b) Compute pY. (c) Compute P Y (d) Compute P Y (e) Compute P XY 2.7.4 For each of the following joint density functions f X Y, find the value of C and compute f X x (a) fY y, and 2x 2 y C y5 0 0 x otherwise. 1 0 y 1 (b) (c) (d) f X Y x y x 5 y5 C x y 0 0 x otherwise y5 C x y 0 0 x otherwise. 4 0 y 10 f X Y x y C x 5 y5 0 0 x otherwise. 4 0 y 10 2.7.5 Prove that FX Y x y 2.7.6 Suppose P X x Y P X y x Y min FX x FY y 1 8 for x y 3 5 and y 1 2 4 7, otherwise 0. Compute each of the following. 92 Section 2.7: Joint Distributions R1 R1 y y R1 R1 R1 R1 c sin x y for 0 2, otherwise f X Y x y 0, for appropriate constant c (a) FX Y x y for all x y (b) pX Y x y for all x y R1 (c) pX x for all x R1 (d) pY y for all x (e) The marginal cdf FX x for all x (f) The marginal cdf FY y for all y 2.7.7 Let X and Y have joint density f X Y x y 0 be computed explicitly). In terms of c, compute each of the following. (a) The marginal density f X x for all x (b) The marginal density fY y for all y 2.7.8 Let X and Y have joint density f X Y x y 4, otherwise f X Y x y 0 (a) The marginal density f X x for all
x (b) The marginal density fY y for all y (c) P Y (d) The joint cdf FX Y x y for all x y 2.7.9 Let X and Y have joint density f X Y x y otherwise f X Y x y (a) The marginal density f X x for all x (b) The marginal density fY y for all y (c) P Y 2.7.10 Let X and Y have the Bivariate­Normal 3 5 2 4 1 2 distribution. (a) Specify the marginal distribution of X. (b) Specify the marginal distribution of Y. (c) Are X and Y independent? Why or why not? x 2 0. Compute each of the following. 0. Compute each of the following. y 4 for 0 y 36 for R1 R1 R1 R1 R1 x 2 1 2 1 x x 1 and 0 (which cannot x 1 and y 2, PROBLEMS, and let Y Exponential 2.7.11 Let X 2.7.12 Let FX Y be a joint cdf. Prove that for all y 2.7.13 Let X and Y have the Bivariate Normal Example 2.7.9. Prove that X R1, limx 1 1 2 1, by proving that N 1 2 2 X 3. Compute the joint cdf, FX Y x y. 0. FX Y x y distribution, as in f X Y x y dy 1 1 2 exp and is 0 otherwise 2.7.14 Suppose that the joint density f X Y is given by f X Y x y x (a) Determine C so that f X Y is a density. (b) Compute P 1 2 (c) Compute the marginal densities of X and Y 2.7.15 Suppose that the joint density f X Y is given by f X Y x y x 1 and is 0 otherwise 1 1 2 X Y 1 y Cye x y for 0 Cye x y for 0 Chapter 2: Random Variables and Distributions 93 1 Y 1 1 2 (a) Determine C so that f X Y is a density. (b) Compute P 1 2 X (c) Compute the marginal densities of X and Y 2.7.16 Suppose that the joint density f X Y is given by f X Y x y 0 (a) Determine C so that f X Y is a density.
(b) Compute the marginal densities of X and Y 2.7.17 (Dirichlet and is 0 otherwise y x 1 2 3 distribution) Let X1 X2 have the joint density Ce x y for f X1 X2 x1 x2 x1 x2 3 1 x2 0 x2 0 and 0 X1 1 A Dirichlet distribution is often applicable x1 X2 correspond to random proportions. for x1 when X1 X2 and 1 (a) Prove that f X1 X2 is a density. (Hint: Sketch the region where f X1 X2 is nonnegative, integrate out x1 first by making the transformation u x2 in this integral, and use (2.4.10) from Problem 2.4.24.) (b) Prove that X1 2.7.18 (Dirichlet Beta 3 and X2 1 k 1 distribution) Let X1 1 Xk have the joint density x1 1 Beta 2 1 3 2 f X1 Xk x1 1 1 xk k 1 k 1 0 i for xi (Hint: Problem 2.7.17.) 1 k and x1 k 1 1 xk x1 xk 1 Prove that f X1 Xk is a density. CHALLENGES 2.7.19 Find an example of two random variables X and Y and a function h : R1 FX Y x h x 0 for all x such that FX x R1, but limx 0 and FY x R1, 0. DISCUSSION TOPICS 2.7.20 What are examples of pairs of real­life random quantities that have interesting relationships? (List as many as you can, and describe each relationship as well as you can.) 2.8 Conditioning and Independence Let X and Y be two random variables. Suppose we know that X 5. What does that tell us about Y? Depending on the relationship between X and Y, that may tell X), or nothing about Y. Usually, the answer us everything about Y (e.g., if Y will be between these two extremes, and the knowledge that X 5 will change the probabilities for Y somewhat. 94 Section 2.8: Conditioning and Independence 2.8.1 Conditioning on Discrete Random Variables Suppose X is a discrete random variable, with P X we are interested in the conditional probability P a already know how to compute such conditional probabilities. Indeed, by
(1.5.1), 0. Let a b X b, and suppose 5. Well, we provided that P X 5 0. This prompts the following definition. Definition 2.8.1 Let X and Y be random variables, and suppose that P X 0. The conditional distribution of Y, given that X assigning probability x, is the probability distribution x P Y B X x P X x to each event Y B. In particular, it assigns probability P a Y P X b X x x to the event that a Y b. EXAMPLE 2.8.1 Suppose as in Example 2.7.5 that X and Y have joint probability function pX otherwise. 0 3 4 0 4 We compute P Y 4 X 8 as On the other hand Thus, depending on the value of X, we obtain different probabilities for Y. Generalizing from the above example, we see that if X and Y are discrete, then pX Y x y pX x pX Y x y z pX Y x z Chapter 2: Random Variables and Distributions 95 This prompts the following definition. Definition 2.8.2 Suppose X and Y are two discrete random variables. Then the conditional probability function of Y, given X, is the function pY X defined by pY X y x pX Y x y z pX Y x z pX Y x y pX x defined for all y R1 and all x with pX x 0. 2.8.2 Conditioning on Continuous Random Variables If X is continuous, then we will have P X 0. In this case, Definitions 2.8.1 and 2.8.2 cannot be used because we cannot divide by 0. So how can we condition on X x in this case? x One approach is suggested by instead conditioning on x 0 is a very small number. Even if X is continuous, we might still have P x x 0. On the other hand, if is very small and x X X x x, where, then X X must be very close to x. Indeed, suppose that X and Y are jointly absolutely continuous, with joint density function f X Y. Then dt dy f X Y t y dt dy In Figure 2.8.1, we have plotted the region for Figure 2.8.1: The sh
aded region is the set ­ | x x+ Now, if to x. If f X Y is a continuous function, then this implies that is very small, then in the above integrals we will always have t very close f X Y t y will be very 96 Section 2.8: Conditioning and Independence close to f X Y x y. We conclude that, if is very small, then dt dy f X Y x y dt dy b a 2 f X Y x y dy 2 f X Y x y dy dz dy This suggests that the quantity dz f X Y x y f X x plays the role of a density, for the conditional distribution of Y given that X prompts the following definitions. x. This Definition 2.8.3 Let X and Y be jointly absolutely continuous, with joint den­ x, is the function sity function f X Y. The conditional density of Y, given X fY X y x, defined by fY valid for all y R1, and for all x such that f X x 0. Definition 2.8.4 Let X and Y be jointly absolutely continuous, with joint density x, is defined by saying function f X Y. The conditional distribution of Y, given X that b P a Y b X x fY X y x dy a when a b, with fY X as in Definition 2.8.3, valid for all x such that f X x 0. EXAMPLE 2.8.2 Let X and Y have joint density f X Y x y 2y5 4x 2 y 0 0 x otherwise, 1 0 y 1 as in Examples 2.7.6 and 2.7.7. We know from Example 2.7.7 that while f X x fY y 1 3 2x 2 0 0 1 x otherwise, 2y5 4 3 y 0 0 1 y otherwise. Chapter 2: Random Variables and Distributions 97 Let us now compute P 0 2 Y 0 3 X 0 8. Using Definitions 2.8.4 and 2.8.3, we have fY X y 0 8 dy dy 2y5 dy 1 3 0 0398 0 2 2 2 0 8 2 By contrast, if we compute the unconditioned (i.e., usual) probability that
0 2 Y 0 3, we see that P 0 2 Y 0 3 fY y dy 2y5 dy 0 3 6 0 2 6 0 0336 We thus see that conditioning on X from about 0 0336 to about 0 0398. 0 8 increases the probability that 0 2 Y 0 3, By analogy with Theorem 1.3.1, we have the following. Theorem 2.8.1 (Law of total probability, absolutely continuous random variable version) Let X and Y be jointly absolutely continuous random variables, and let a d. Then b and fY X y x dx dy More generally, if B R2 is any region, then P X Y B f X x fY X y x dx dy B PROOF By Definition 2.8.3, f X x fY X y x f X Y x y Hence, the result follows immediately from Definition 2.7.4 and Theorem 2.7.6. 2.8.3 Independence of Random Variables Recall from Definition 1.5.2 that two events A and B are independent if P A P A P B. We wish to have a corresponding definition of independence for random variables X and Y. Intuitively, independence of X and Y means that X and Y have no B 98 Section 2.8: Conditioning and Independence inuence on each other, i.e., that the values of X make no change to the probabilities for Y (and vice versa). The idea of the formal definition is that X and Y give rise to events, of the form B ” and we want all such events involving X to be independent “a of all such events involving Y. Specifically, our definition is the following. b” or “Y X Definition 2.8.5 Let X and Y be two random variables. Then X and Y are inde­ pendent if, for all subsets B1 and B2 of the real numbers, P X B1 Y B2 P X B1 P Y B2 That is, the events “X B1” and “Y B2” are independent events. Intuitively, X and Y are independent if they have no inuence on each other, as we shall
see. Now, Definition 2.8.5 is very difficult to work with. Fortunately, there is a much simpler characterization of independence. Theorem 2.8.2 Let X and Y be two random variables. Then X and Y are indepen­ dent if and only if 2.8.1) whenever a b and c d. That is, X and Y are independent if and only if the events “a d” are independent events whenever a b and c d. X b” and “c Y We shall not prove Theorem 2.8.2 here, although it is similar in spirit to the proof of Theorem 2.5.1. However, we shall sometimes use (2.8.1) to check for the independence of X and Y. Still, even (2.8.1) is not so easy to check directly. For discrete and for absolutely continuous distributions, easier conditions are available, as follows. Theorem 2.8.3 Let X and Y be two random variables. (a) If X and Y are discrete, then X and Y are independent if and only if their joint probability function pX Y satisfies pX Y x y pX x pY y R1 for all x y (b) If X and Y are jointly absolutely continuous, then X and Y are independent if and only if their joint density function f X Y can be chosen to satisfy f X Y x y f X x fY y for all x y R1 Chapter 2: Random Variables and Distributions PROOF in (2.8.1), we see that P X pX x pY y. (a) If X and Y are independent, then setting a x Y y P X x P Y 99 y x and c b y Hence, pX Y x y d Conversely, if pX Y x y pX x pY y for all x and y, then P a X b c Y d pX Y x y pX x pY pX x pY This completes the proof of (a). (b) If f X Y x y f X x fY y for all x and y, then dy dx b d a c f X x fY y dy d x a c b a f X x dx d c fY y dy P a X b P c Y d This completes the proof of the “
if” part of (b). The proof of the “only if” part of (b) is more technical, and we do not include it here. EXAMPLE 2.8.3 Let X and Y have, as in Example 2.7.6, joint density f X Y x y 2y5 4x 2 y 0 0 x otherwise 1 0 y 1 and so, as derived in as in Example 2.7.7, marginal densities f X x and Then we compute that f X x fY y fY y 2x 2 0 1 3 2y5 2x 2 0 4 3 y 0 0 1 x otherwise 0 1 y otherwise. 1 3 4 3 y 2y5 0 x otherwise. 1 0 y 1 We therefore see that f X x fY y f X Y x y. Hence, X and Y are not independent. 100 Section 2.8: Conditioning and Independence EXAMPLE 2.8.4 Let X and Y have joint density f X Y x y 1 8080 12x y2 0 6x 4y2 2 0 x otherwise. 6 3 y 5 We compute the marginal densities as f X x f X Y x y dy 1 20 x 1 60 0 0 6 x otherwise, and fY y f X Y x y dx 3 202 0 3 101 y2 3 5 y otherwise. Then we compute that f X x fY y 1 60 0 1 20 x 3 202 3 101 y2 0 x otherwise. 6 3 y 5 Multiplying this out, we see that independent in this case. f X x fY y f X Y x y. Hence, X and Y are Combining Theorem 2.8.3 with Definitions 2.8.2 and 2.8.3, we immediately obtain the following result about independence. It says that independence of random vari­ ables is the same as saying that conditioning on one has no effect on the other, which corresponds to an intuitive notion of independence. Theorem 2.8.4 Let X and Y be two random variables. (a) If X and Y are discrete, then X and Y are independent if and only if pY X y x pY y (b) If X and Y are jointly absolutely continuous, then X and Y are independent if and only if fY X y x for every x y for every x y fY y R1. R1. While Defin
ition 2.8.5 is quite difficult to work with, it does provide the easiest way to prove one very important property of independence, as follows. Theorem 2.8.5 Let X and Y be independent random variables. Let f g : R1 R1 be any two functions. Then the random variables f X and g Y are also indepen­ dent. PROOF Using Definition 2.8.5, we compute that P f X B1 g Y B2 B1 Y g 1 B2 P Y 1 B1 B1 P g Y g 1 B2 B2 Chapter 2: Random Variables and Distributions 101 (Here f Because this is true for any B1 and B2, we see that f X and g Y are independent. B1 and g 1 B2 R1 : g y 1 B1 R1 : f x y x B2.) Suppose now that we have n random variables X1 are independent if and only if the collection of events ai whenever ai following result. Xn. The random variables bi are independent, Xi n. Generalizing Theorem 2.8.3, we have the for all i 1 2 bi Theorem 2.8.6 Let X1 (a) If X1 joint probability function pX1 Xn are discrete, then X1 Xn satisfies Xn be a collection of random variables. Xn are independent if and only if their pX1 Xn x1 xn pX 1 x1 pXn xn R1 for all x1 (b) If X1 dent if and only if their joint density function f X1 xn Xn are jointly absolutely continuous, then X1 Xn are indepen­ X n can be chosen to satisfy f X 1 Xn x y f X1 x1 f Xn xn for all x1 xn R1 A particularly common case in statistics is the following. Definition 2.8.6 A collection X1 Xn of random variables is independent and identically distributed (or i.i.d.) if the collection is independent and if, furthermore, each of the n variables has the same distribution. The i.i.d. sequence X1 Xn is also referred to as a sample from the common distribution. In particular, if a collection X1 each of the probability functions pXi is the same,
so that pX1 x pXn x for all x p x R1 Furthermore, from Theorem 2.8.6(a), it follows that Xn of random variables is i.i.d. and discrete, then pX2 x pX1 Xn x1 xn pX 1 x1 pX2 x2 pXn xn p x1 p x2 p xn for all x1 xn R1. Similarly, if a collection X1 Xn of random variables is i.i.d. and jointly ab­ solutely continuous, then each of the density functions f Xi is the same, so that f X1 x f X2 x it follows that R1 Furthermore, from Theorem 2.8.6(b), for all x f Xn x f x f X1 Xn x1 xn f X1 x1 f X2 x2 f Xn xn f x1 f x2 f xn for all x1 xn R1. We now consider an important family of discrete distributions that arise via sam­ pling. 102 Section 2.8: Conditioning and Independence EXAMPLE 2.8.5 Multinomial Distributions Suppose we have a response s that can take three possible values — for convenience, labelled 1 2 and 3 — with the probability distribution and 1 1 As a simple example, consider a bowl so that each i If of chips of which a proportion i of the chips are labelled i (for i i. we randomly draw a chip from the bowl and observe its label s then P s Alternatively, consider a population of students at a university of which a proportion 1 live on campus (denoted by s 1), a proportion 2 live off­campus with their parents (denoted by s 2), and a proportion 3 live off­campus independently (denoted by s 3). If we randomly draw a student from this population and determine s for that student, then P s 1 2 3). i i i We can also write where I j sn is the indicator function for for i is a sample from the distribution on 1 2 3 given by the i Theorem 2.8.6(a) implies that the joint probability function for the sample equals j. Therefore, if s1 P s1 k1 sn kn x1 1 x2 2 x3 3 (2.8.2) where xi n j 1 I i Now, based on the sample s1 k
j is equal to the number of i’s in k1 kn sn define the random variables Xi n j 1 I i s j 1 2 and 3 Clearly, Xi is the number of i’s observed in the sample and we n We refer to the Xi as the n and X1 0 1 X3 X2 for i always have Xi counts formed from the sample. For x1 x2 x3 satisfying xi 0 1 n and x1 x2 x3 n (2.8.2) implies that the joint probability function for X1 X2 X3 is given by p X1 X2 X 3 x1 x2 x3 P X1 C x1 x2 x3 x1 X2 x1 1 x2 X3 x3 x2 3 2 x3 where C x1 x2 x3 equals the number of samples s1 sn with x1 of its elements equal to 1 x2 of its elements equal to 2 and x3 of its elements equal to 3 To calcu­ late C x1 x2 x3 we note that there are n choices for the places of the 1’s in the x1 sample sequence, n x1 choices for the places of the 2’s in the sequence, and finally x2 n x1 x2 1 choices for the places of the 3’s in the sequence (recall the multino­ x3 mial coefficient defined in (1.4.4)). Therefore, the probability function for the counts Chapter 2: Random Variables and Distributions 103 X1 X2 X3 is equal to p X1 X 2 X3 x1 x2 x3 n x1 n x1 n x2 x2 x1 x3 x1 1 x2 2 x3 3 n x1 x2 x3 x1 1 x2 2 x3 3 We say that X1 X2 X3 Multinomial n 1 2 3 Notice that the Multinomial n distribu­ tion, as we are now counting the number of response values in three possible categories rather than two. Also, it is immediate that 3 generalizes the Binomial n 1 2 Xi Binomial n i because Xi equals the number of occurrences of i in the n independent response values, and i occurs for an individual response with probability equal to i (also see Problem 2.8.18). As a simple example, suppose that
we have an urn containing 10 red balls, 20 white balls, and 30 black balls. If we randomly draw 10 balls from the urn with replacement, what is the probability that we will obtain 3 red, 4 white, and 3 black balls? Because we are drawing with replacement, the draws are i.i.d., so the counts are distributed Multinomial 10 10 60 20 60 30 60 The required probability equals 10 3 4 3 4 10 60 3 20 60 30 60 3 3 0007 10 2 Note that if we had drawn without replacement, then the draws would not be i.i.d., the counts would thus not follow a multinomial distribution but rather a generalization of the hypergeometric distribution, as discussed in Problem 2.3.29. Now suppose we have a response s that takes k possible values — for convenience, i For k — with the probability distribution given by P s k Then, sn labelled 1 2 a sample s1 for i define the counts Xi arguing as above and recalling the development of (1.4.4), we have X1 Xk x1 xk n and x1 n xk x1 1 xk k n In this case, we write x1 xk Xk Multinomial n 1 k whenever each xi 0 X1 2.8.4 Order Statistics Suppose now that X1 Xn is a sample. In many applications of statistics, we will have n data values where the assumption that these arise as an i.i.d. sequence makes 104 Section 2.8: Conditioning and Independence sense. It is often of interest, then, to order these from smallest to largest to obtain the order statistics X 1 X n Here, X i if n 5 and is equal to the ith smallest value in the sample X1 Xn So, for example, X1 2 3 X2 4 5 X3 1 2 X4 2 2 X5 4 3 then Of considerable interest in many situations are the distributions of the order statis­ tics. Consider the following examples. EXAMPLE 2.8.6 Distribution of the Sample Maximum Suppose X1 X2 the largest­order statistic X n random variables. Xn are i.i.d. so that FX 1 x max X1 X2 FX2 x Xn FXn x Then is the maximum of these n Now X n is another random variable. What is its cumulative distribution function? We see that X n x if and only
if Xi x for all i. Hence, FX n x P X1 x x X2 P Xn x x Xn x FX1 x FX2 x FXn x x P X2 x P X n P X1 FX1 x n corresponds to an absolutely continuous distribution, then we can differentiate If FX1 this expression to obtain the density of X n EXAMPLE 2.8.7 As a special case of Example 2.8.6, suppose that X1 X2 independently distributed Uniform[0 1]. From the above, for 0 FX n x f X n of X n equals Xn are identically and 1, we have x n It then follows from Corollary 2.5.1 that the density 1, with (of course) 1. Note that, from Problem 2.4.24, we can write nx n 1 for 0 FX1 x n Beta n 1 0 and x 0 for x FX n x x x EXAMPLE 2.8.8 Distribution of the Sample Minimum Following Example 2.8.6, we can also obtain the distribution function of the sample minimum, or smallest­order statistic, X 1 Xn We have min X1 X2 FX X1 P X1 1 1 1 x x X2 x P X2 1 FX1 x FX1 x n x x FX2 x x Xn P Xn 1 x FXn x Chapter 2: Random Variables and Distributions 105 Again, if FX1 corresponds to an absolutely continuous distribution, we can differentiate this expression to obtain the density of X 1 EXAMPLE 2.8.9 Let X1 Xn be i.i.d. Uniform[0 1]. Hence, for 0 FX, 1 1 x n It then follows from Corollary 2.5.1 that the density f X 1 of X 1 satisfies f X 1 x FX 1 x 1. Note that, from Problem 2.4.24, we can write X 1 1, with (of course) f X 1 x x n 1 for 0 Beta 1 n 0 for x n 1 x x 0 and The sample median and sample quartiles are defined in terms of order statistics and used in statistical applications. These quantities, and their uses, are discussed in Section 5.5. Summary of Section 2.8 pX x. f X Y x y pX Y x y If X and Y are discrete, then the conditional probability function of Y given
X equals pY X y x If X and Y are absolutely continuous, then the conditional density function of Y given X equals fY X y x X and Y are independent if P X R1. all B1 B2 Discrete X and Y are independent if and only if pX Y x y all x y Absolutely continuous X and Y are independent if and only if f X Y x y f X x fY y for all x y A sequence X1 X2 each Xi has the same distribution. R1 or, equivalently, fY X y x Xn is i.i.d. if the random variables are independent, and R1 or, equivalently, pY X y x pX x pY y for f X x. B2 B1 P Y B2 for pY y. fY y. B1 Y P X EXERCISES 2.8.1 Suppose X and Y have joint probability function pX Y x y 1 6 1 12 1 6 1 12 13 y x x 13 y otherwise 3 5 3 5 3 5 (a) Compute pX x for all x (b) Compute pY y for all y (c) Determine whether or not X and Y are independent. R1. R1. 106 Section 2.8: Conditioning and Independence 2.8.2 Suppose X and Y have joint probability function pX Y x y 1 16 1 4 1 2 1 16 1 16 1 16 13 y x x 13 y otherwise 3 5 3 5 3 5 (a) Compute pX x for all x (b) Compute pY y for all y (c) Determine whether or not X and Y are independent. 2.8.3 Suppose X and Y have joint density function R1. R1. f X Y x y 12 49 2 0 x x y 4y2 0 x 1 0 y 1 otherwise. (a) Compute f X x for all x (b) Compute fY y for all y (c) Determine whether or not X and Y are independent. 2.8.4 Suppose X and Y have joint density function R1. R1 ex 3y 3yey yex yex y 0 0 0 x y 1 1 otherwise (a) Compute f X x for all x (b) Compute fY y for all y (c) Determine whether or not X and Y are independent. 2.8.5 Suppose X and
Y have joint probability function R1. R1. pX otherwise. 2 2 2 0 4 (a) Compute P Y (b) Compute P Y (c) Compute P Y (d) Compute P Y (e) Compute. Chapter 2: Random Variables and Distributions 107 and Y Bernoulli Geometric Y. What is the probability function of Z? 2.8.6 Let X Z X 2.8.7 For each of the following joint density functions f X Y (taken from Exercise 2.7.4), compute the conditional density fY X y x, and determine whether or not X and Y are independent. (a), with X and Y independent. Let (b) (c) (d) f X Y x y 2x 2 y C y5 0 0 x otherwise y5 C x y 0 0 x otherwise y5 C x y 0 0 x otherwise. 4 0 y 10 f X Y x y Cx 5 y5 0 0 x otherwise. 4 0 y 10 and Y 1 P Y 1 and 0 Bernoulli 1 Y Bernoulli 1 3 and Y Bernoulli 1 P Y e 3x. Compute P Y, where 0 1. Prove that X and Y must be 2.8.8 Let X and Y be jointly absolutely continuous random variables. Suppose X Exponential 2 and that P Y x 2.8.9 Give an example of two random variables X and Y, each taking values in the set 1 2 3, such that P X 1, but X and Y are not independent. 2.8.10 Let X 1. Suppose P X independent. 2.8.11 Suppose that X is a constant random variable and that Y is any random variable. Prove that X and Y must be independent. 2.8.12 Suppose X and with 2.8.13 Suppose P X P X x Y (a) Compute the conditional probability function pY X y x for all x y pX x (b) Compute the conditional probability function pX Y x y for all x y pY y (c) Are X and Y independent? Why or why not? 2.8.14 Let X and Y have joint density f X Y x y 0 (a) Compute the conditional density fY X y x for all x y (b) Compute the conditional density f X Y x y for all x y (c) Are X and Y independent
? Why or why not? 0. Compute P X x Y R1 with f X x R1 with fY y, with X and Y independent 4, otherwise f X Y x y 5. 1 8 for x 1 2 4 7, otherwise 1 Y y 3 5 and y R1 with R1 with y 36 for Poisson 1 and 0. 0. x 2 0. 0. 0. 0. 2 y x y 108 Section 2.8: Conditioning and Independence x 2 0. Compute each of the following. 2.8.15 Let X and Y have joint density f X Y x y otherwise f X Y x y (a) The conditional density fY X y x for all x y (b) The conditional density f X Y x y for all x y (c) Are X and Y independent? Why or why not? 2.8.16 Suppose we obtain the following sample of size n X3 7, and X6 9, X5 X4 R1 with f X x R1 with fY y 0 0 11. Specify the order statistics X i for 1 6: X1 12, X2 i 8, 6. y 4 for 0 x y 2, PROBLEMS 2.8.17 Let X and Y be jointly absolutely continuous random variables, having joint density of the form f X Y x y C1 2x 2 y C2 y5 0 x 0 otherwise. 1 0 y 1 0. Suppose P Y g x h y, for some functions g and h. Prove that X and Y are indepen­ Determine values of C1 and C2, such that f X Y is a valid joint density function, and X and Y are independent. 2.8.18 Let X and Y be discrete random variables. Suppose pX Y x y g x h y, for some functions g and h. Prove that X and Y are independent. (Hint: Use Theo­ rem 2.8.3(a) and Theorem 2.7.4.) 2.8.19 Let X and Y be jointly absolutely continuous random variables. Suppose f X Y x y dent. (Hint: Use Theorem 2.8.3(b) and Theorem 2.7.5.) 2.8.20 Let X and Y be discrete random variables, with P X 2 X 2 X and Y cannot be independent. 2.8.21 Let X and Y have the b
ivariate normal distribution, as in Example 2.7.9. Prove that X and Y are independent if and only if Multinomial n 2.8.22 Suppose that X1 X2 X3 the joint probability function, that X1 Binomial n 2.8.23 Suppose that X1 X2 X3 Multinomial n distribution of X2 given that X1 2.8.24 Suppose that X1 Find the densities f X 1 and f X n 2.8.25 Suppose that X1 Xn is a sample from a distribution with cdf F Prove that Xn is a sample from the Exponential 0 and P X 3 4. Prove that 3 Find the conditional Prove, by summing 3 4 and P Y distribution. 1 X 1 2 x1 0. 1 3 1 2 1 2 1 FX if and only if at least i of X1 (Hint: Note that X i to x ) 2.8.26 Suppose that X1 X5 is a sample from the Uniform[0 1] distribution. If we define the sample median to be X 3 find the density of the sample median. Can you identify this distribution? (Hint: Use Problem 2.8.25.) Xn are less than or equal Chapter 2: Random Variables and Distributions 109 2.8.27 Suppose that X Y 1 X 1 1 x is distributed N 2 result for the conditional distribution of X given Y X x and its analog for X given Y Bivariate Normal 2 x y ) 1 CHALLENGES 2 2 1 2 Prove that Y given 2 2 Establish the analogous y (Hint: Use (2.7.1) for Y given 2.8.28 Let X and Y be random variables. (a) Suppose X and Y are both discrete. Prove that X and Y are independent if and only if P Y (b) Suppose X and Y are jointly absolutely continuous. Prove that X and Y are inde­ pendent if and only if P a b for all x and y such that f X x y for all x and y such that. 0. Y Y x x x 2.9 Multidimensional Change of Variable Let X and Y be random variables with known joint distribution. Suppose that Z h1 X Y and W h2 X Y, where h1 h2 : R2 joint distribution of Z and W? R1 are two functions. What is the
This is similar to the problem considered in Section 2.6, except that we have moved from a one­dimensional to a two­dimensional setting. The two­dimensional setting is more complicated; however, the results remain essentially the same, as we shall see. 2.9.1 The Discrete Case If X and Y are discrete random variables, then the distribution of Z and W is essentially straightforward. Theorem 2.9.1 Let X and Y be discrete random variables, with joint probability R1 are function pX Y. Let Z some functions. Then Z and W are also discrete, and their joint probability function pZ W satisfies h1 X Y and W h2 X Y, where h1 h2 : R2 pZ W z pX Y x y h1 x y x y z h2 x y Here, the sum is taken over all pairs x y such that h1 x y z and h2 x y. PROOF We compute that pZ W z z h2 X Y This equals P Z z W P h1 X Y P X x Y y pX Y x y h1 x y x y z h2 x y h1 x y x y z h2 x y as claimed. As a special case, we note the following. 110 Section 2.9: Multidimensional Change of Variable Corollary 2.9.1 Suppose in the context of Theorem 2.9.1 that the joint function : R2 is one­to­ h h1 h2 one, i.e., if h1 x1 y1 x2 and y2. Then y1 R2 defined by h x y h1 x2 y2 and h2 x1 y1 h2 x2 y2, then x1 h1 x y h2 x y pZ W z pX Y h 1 z where h 1 z is the unique pair x y such that h x y z. EXAMPLE 2.9.1 Suppose X and Y have joint density function pX Y x y Y and W P X 6 Y 17 P Z 5 W Let Z P X pZ W X 2 Y 5 1 6 1 12 otherwise 6 6 11 8 3 Y X 2. Then pZ 11 17 P Z 8 W 5 12 On the other hand, 2 8 1 2 2.9.2 The Continuous Case (Advanced) If X and Y are continuous, and the function h
is one­to­one, then it is again possible to compute a formula for the joint density of Z and W, as the following theorem shows. To state it, recall from multivariable calculus that, if h : R2 R2 is a differentiable function, then its Jacobian derivative J is defined by h1 h2 h1 h2 J x y det h1 x h1 y h2 x h2 y h1 x h2 y h2 x h1 y Theorem 2.9.2 Let X and Y be jointly absolutely continuous, with joint density R1 are function f X Y. Let Z differentiable functions. Define the joint function h h1 X Y and W h2 X Y, where h1 h2 : R2 R2 by h1 h2 : R2 h x y h1 x y h2 x y Assume that h is one­to­one, at least on the region 0, i.e., if y2. h1 x2 y2 and h2 x1 y1 h1 x1 y1 Then Z and W are also jointly absolutely continuous, with joint density function f Z W given by h2 x2 y2, then x1 x y : f x y x2 and y1 where J is the Jacobian derivative of h and where h 1 z x y such that h x y z. is the unique pair Chapter 2: Random Variables and Distributions 111 PROOF See Section 2.11 for the proof of this result. EXAMPLE 2.9.2 Let X and Y be jointly absolutely continuous, with joint density function f X Y given by f X Y x y 2y5 4x 2 y 0 x 0 otherwise 1 0 y 1 as in Example 2.7.6. Let Z Z and W? X Y 2 and W X Y 2. What is the joint density of We first note that Z x y2. Hence, h2 x y h1 X Y and W h2 X Y, where h1 x y x y2 and J x y h1 x h2 y h2 x h1 y 1 2y 1 2y 4y We may invert the relationship h by solving for X and Y, to obtain that X 1 2 Z W and Y Z W 2 This means that h h1 h2 is invertible, with h 1 z 1 2 z z 2
Hence, using Theorem 2.9.2, we see that otherwise otherwise. 2 0 z 2 We have thus obtained the joint density function for Z and W. EXAMPLE 2.9.3 Let U1 and U2 be independent, each having the Uniform[0 1] distribution. (We could write this as U1 U2 are i.i.d. Uniform[0 1].) Thus, fU1 U2 u1 u2 1 0 0 u1 otherwise. 1 0 u2 1 112 Section 2.9: Multidimensional Change of Variable Then define X and Y by X 2 log 1 U1 cos 2 U2 Y 2 log 1 U1 sin 2 U2 What is the joint density of X and Y? We see that here X h1 U1 U2 and Y h2 U1 U2, where h1 u1 u2 2 log 1 u1 cos 2 u2 h2 u1 u2 2 log 1 u1 sin 2 u2 Therefore, h1 u1 u1 u2 1 2 2 log 1 u1 1 2 2u1 1 u2 1 cos 2 u2 Continuing in this way, we eventually compute (see Exercise 2.9.1) that J u1 u2 h1 u1 h2 u2 h2 u1 h1 u2 2 u1 cos2 2 u2 sin2 2 u2 2 u1 Next, we set R X 2 Y 2, so that R2 X 2 Y 2 2 log 1 U1. Then, inverting the relationship h, we compute that U1 X Y e R2 2 cos 2 U2 X Y X R sin 2 U2 X Y Y R Here U1 X Y plicitly to make 2 U2 X Y relationships. Then, by Theorem 2.9.2, for any x y [0 1] is defined directly, while U2 X Y [0 1] is defined im­ be the unique angle which satisfies the above [0 2 R2, 1 f X Y x y fU1 U2 h 1 x y fU1 U2 U1 x y U2 x y J h 1 x y 1 J U1 x y U2 x y 1 2 e R2 x y 2 1 1 2 U1 x y 2 x 2 y2 2 1 e 1 2 e x2 y2 2 We conclude that
f X Y x y e x2 2 1 2 e y2 2 1 2 We recognize this as a product of two standard normal densities. We thus conclude that X N 0 1 and that, furthermore, X and Y are independent. N 0 1 and Y Chapter 2: Random Variables and Distributions 113 2.9.3 Convolution Suppose now that X and Y are independent, with known distributions, and that Z X Y. What is the distribution of Z? In this case, the distribution of Z is called the convolution of the distributions of X and of Y. Fortunately, the convolution is often reasonably straightforward to compute. Theorem 2.9.3 Let X and Y be independent, and let Z (a) If X and Y are both discrete, with probability functions pX and pY, then Z is also discrete, with probability function pZ given by Y. X pZ z pX z pY (b) If X and Y are jointly absolutely continuous, with density functions f X and fY, then Z is also absolutely continuous, with density function f Z given by f Z z f X z fY d PROOF (a) We let W Y and consider the two­dimensional transformation from X Y to Z W Y Y. X In the discrete case, by Corollary 2.9.1, pZ W z pX Y z Theorem 2.7.4, pZ z and Y are independent, pX Y x y pZ W z pY. This proves part (a). pX Y z pX x pY y, so pX Y z Then from But because X pX z (b) In the continuous case, we must compute the Jacobian derivative J x y of the transformation from X Y to Z W Y Y. Fortunately, this is very easy, as X we obtain Hence, from Theorem 2.9.2, f Z W z from Theorem 2.7.5 and But because X and Y are independent, we may take f X Y x y fY f X Y z EXAMPLE 2.9.4 Let X X Z Binomial 4 1 5 and Y Y. Then. This proves part (b). Bernoulli 1 4, with X and Y independent. Let f X x fY y, so pZ 0576 114 Section 2.9: Multidimensional Change of Variable EXAMPLE 2.9.5 Let X X Z Uniform[
3 7] and Y Y. Then Exponential 6, with X and Y independent. Let f Z 5 f X x fY 5 x dx 5 3 1 4 6 e 6 5 x dx 12 1 4 e0 0 2499985 Note that here the limits of integration go from 3 to 5 only, because f X x 5. x 3, while fY 5 0 for x x 0 for Summary of Section 2.9 If X and Y are discrete, and Z h1 X Y and W h2 X Y, then pZ W z pX Y x y x y : h1 x y z h2 x y h1 h2 : R2 If X and Y are absolutely continuous, if Z if h f Z W z This allows us to compute the joint distribution of functions of pairs of random variables. R2 is one­to­one with Jacobian J x y, then h1 X Y and W h2 X Y, and. EXERCISES 2 X Y. u1. Y and W X Uniform[1 4], with X and Y independent. 2.9.1 Verify explicitly in Example 2.9.3 that J u1 u2 2.9.2 Let X Exponential 3 and Y Let Z (a) Write down the joint density f X Y x y of X and Y. (Be sure to consider the ranges of valid x and y values.) (b) Find a two­dimensional function h such that Z W (c) Find a two­dimensional function h 1 such that X Y (d) Compute the joint density f Z W z ranges of valid z and 2.9.3 Repeat parts (b) through (d) of Exercise 2.9.2, for the same random variables X and Y, if instead Z 2.9.4 Repeat parts (b) through (d) of Exercise 2.9.2, for the same random variables X and Y, if instead Z 2.9.5 Repeat parts (b) through (d) of Exercise 2.9.2, for the same random variables X and Y, if instead Z of Z and W. (Again, be sure to consider the Y 4 and W X 4. Y 2 and W X 2 h 1 Z W. 4 and W Y h X Y. values.) Y 2. X 2 3. X Chapter 2: Random Variables and Distributions 115 2.9.6 Suppose the joint probability function of X and Y
is given by pX otherwise, and B Y, A Y, W X Let Z (a) Compute the joint probability function pZ W z (b) Compute the joint probability function pA B a b. (c) Compute the joint probability function pZ A z a. b. (d) Compute the joint probability function pW B 2.9.7 Let X have probability function. 2X 3Y 2. pX x and let Y have probability function pY 12 3 4 0 0 x 2 x x 3 otherwise 2 y 5 y 9 y otherwise. Suppose X and Y are independent. Let Z 2.9.8 Let X Geometric 1 4, and let Y have probability function Y. Compute pZ z for all z X R1. pY y 1 6 1 12 3 4 0 2 y 5 y y 9 otherwise. Y. Suppose X and Y are independent. Compute pW Let W X 2.9.9 Suppose X and Y are discrete, with P X P X P X P X 0. Let Z (a) Compute the joint probability function pZ W z (b) Compute the marginal probability function pZ z for Z. (c) Compute the marginal probability function pW 2.9.10 Suppose X has density f X x and Y has density fY y and Y are independent, and let Z x 3 4 for 0 y Y 2 and W X 2 5y4 32 for 0 P X Y. X 1 2 Y 5Y. for all z for W. x 2, otherwise fY y P X 3 R1. 2, otherwise f X x 0, 0. Assume X for all 1 Y R1. 2 1 5, otherwise 116 Section 2.10: Simulating Probability Distributions (a) Compute the joint density f X Y x y for all x y (b) Compute the density f Z z for Z. R1. PROBLEMS x 5y4 32 for 0 X for all z 2, otherwise 0, 2, otherwise fY y 3Y. for W. independent of Y x 3 4 for 0 y Y and W 4X R1. 2.9.11 Suppose again that X has density f X x f X x 0, that Y has density fY y and that X and Y are independent. Let Z (a) Compute the joint density f Z W z (b) Compute the marginal density