STAT 111 Chapter6 Jointly Distributed Random Variables 1 In many experiments it is necessary to consider the properties of two or more random variables simultaneously. In the following, we shall be concerned with the bivariate case, that is, with situations where we are interested at the same time in a pair of random variables. Later, we shall extend this discussion to the multivariate case, covering any finite number of random variables, If X and Y are two discrete random variables, the probability distribution for their simultaneous occurrence can be represented by a function with values f (x, y) for any pair of values (x, y) within the range of the random variables X and Y. It is common to refer to this function as the joint probability distribution of X and Y, and it is defined as f (x, y) = P(X = x, Y = y) 2 Definition x The function f (x, y) is a joint probability distribution (or joint probability mass function) of the discrete random variables X and Y if and only if its values satisfy the conditions; 1. f ( x, y ) 0 for all (x, y) 2. ∑ ∑ f (x ,y ) = 1, where the double summation extends over all x y Based on this definition , the joint cumulative distribution function is the joint probably that X ≤ x and Y ≤ y ,given by F (x , y ) = p (X ≤ x ,Y≤ y)= ∑ xi ≤ x for - ∞ < x<∞ , ∑ ƒ ( xi , yi) yi ≤ y - ∞< y <∞ 3 Example Let X denote the number of heads and Y the number of heads minus the number of tails when coins are tossed. Find the joint probability distribution of X and Y. Possible values (0,-3) ,(1,-1), (2,1), (3,3) P(X=0, Y= -3) = 1 , 8 P(X=1 , Y=-1)= 3 , ….. 8 These probabilities can most easily be expressed in tabular from as in this table Y/X -3 -1 1 3 Sum 0 1/8 0 0 0 1/8 1 0 3/8 0 0 3/8 2 0 0 3/8 0 3/8 3 0 0 0 1/8 1/8 Sum 1/8 3/8 3/8 1/8 1 4 Example Suppose that 3 balls are randomly selected from an urn containing 3 red, 4 white and 5 blue balls. Let X denotes the number of red balls chosen. Let Y denotes the number of white balls chosen. Find the joint probability function of X and Y, P(X + Y ≤ 2), P(X = 1, Y = 2), p(X = 0, 0 ≤ Y≤ 2) , and P(X > Y). X = # R , Y= #W f (0,0) P( X 0, Y 0) C35 / C312 1. X + Y ≤ 2 for the following values of X and Y X/Y {(0. 0), (1, 0), (2, 0), (0, 1),(1, 1), (0,2)}therefore, P(X+Y≤2)= 10 + 40 + 30 + 30 + 60 + 15 220 220 220 220 220 220 2. P (X= 1,Y=2) =f (1,2) = 18/220 3R 5B 4W 0 1 3 2 3 0 10/220 40/220 30/220 4/220 1 30/220 60/220 18/220 0 2 15/220 12/220 0 0 3 1/220 0 0 0 3. P(X = 0, 0 ≤ Y≤ 2) = ƒ (0, 0) + ƒ(0,1) + ƒ(0, 2 ) = 10 + 40 + 30 220 220 220 5 Example Let the joint probability mass function of X and Y is given in the following table Y X 0 1 2 0 1 2 1/16 1/16 1/8 1/8 1/8 1/4 1/8 1/16 1/16 Find 1. P(X= 1, Y≤ 0) = ƒ(1,0) =1/8 2. P(X = 2,Y ≤ 0) =ƒ(2, 0) = 1/8 3. P(X = 2,X + Y = 4) = ƒ(2,2) = 1/16 4. P(l ≤ X<3, Y≥ 1) = ƒ(1, l)+ƒ(l,2) + ƒ(2, l) + ƒ(2,2) = 5.P(X ≤ 2) = 1 - P(X > 2) = 1 - 0 = 1 1 + 1 + 1+ 1 8 4 16 16 6. F(l, 1) = (P(X≤1,Y≤1) = f (1,0)+ f (1, l)+f (0,0)+f (0,1) = 6 1 + 1 + 1 + 1 8 8 16 16 Example Determine the value of c so that the following functions represent joint probability distributions of the random variables X and Y; 1. ƒ(x,y) = c x y, for x = 1,2,3. y=1,2,3. ∑ ƒ(x+ y) = c [1+2+3+2+4+6+3+6+9] = 1 c = 1/36 2. ƒ(x , y) = c│ x-y │, for x= -2 ,0 ,2 y =1,2,3. ∑ ƒ(x , y) = c[3+4+5+1+2+3+1+0+1]=1 c = 1/20 7 All the preceding definitions concerning two random variables can be generalized to the multivariate case, where there are n random variables. The values of the joint probability distribution of the discrete random variables X1,X2 , …, Xn, defined over the same sample space S, are given by f(x1,x2, ...,xn) = P(X1=X 1,X2, ..., Xn = xn) for all n-tuple (x1, x2, ..., xn) within the range of the random variables. Also the values of their joint cumulative distribution function are given by F ( x1 , x2 ,… , xn ) = P ( X1 ≤ x1 , X2 ≤ x2, …Xn ≤ xn) 8 Example Considering n flips of a balanced coin, let X 1 be the number of heads (0 or 1) obtained on the first flip, X2 the number of heads obtained on the second flip, ..., and Xn the number of heads obtained on the nth flip. find the joint probability distribution of these n random variables. f(x1 , x2 , …,xn)= P(X1 = x1 , X2 = x2 ,..,Xn=xn) = 1 x 1 x 1 x…x 1 = 1 2 2 2 2 2n Where each X: can take on the value 0 or 1 9 Marginal Distributions If X and Y are discrete random variables and f(x, y) is the value of their joint probability distribution at (x, y), the function given by f x (x) =∑ ƒ(x,y) y for each x within the range of X, is called the marginal distribution of X Similarly , the function given by f y(y) =∑ ƒ(x,y) x for each y within the range of y , is called the marginal distribution of y note that , because the probabilities are obtained from the margins , we call them marginal distribution 10 Example Assume that the random variable X and Y have the following joint prob. Mass function. Find the marginal distribution of X and Y. X\Y 0 1 2 3 sum 0 10/220 30/220 15/220 1/220 56/220 1 40/220 60/220 12/220 0 112/220 2 30/220 1 8/220 0 0 4 8 /220 3 4/220 0 0 0 4/220 Sum 84/220 1 08/220 27/220 1/220 1 Marginal of x X ƒ(x) 0 2 1 84/220 108/220 3 27/220 Sum 1/220 1 Marginal of y Y ƒ(y) 0 1 56/220 112/220 2 48/220 3 4/220 11 Example Assume that the random variables X and Y have the joint probability mass function given as f(x ,y)= λx+y e -2λ x!y! x = 0 , 1 , 2 ,.. y=0,1,2,…… Find the marginal distribution of X ƒ(x)= ∑ λx+y e-2λ = x! y! = λxe-2λ x! ∞ Y x -2λ λ λ λ ∑ = e e Y=0 Y! X! λx e -λ x! [Using e λ = ∞ ∑ λt ] t =0 t! 12 Example Let the joint distribution of X and Y be given as f(x , y) = x + y x = 0,l,2,3 y = 0,1,2, 30 Find the marginal distribution function of X and Y. marginal of X 2 2 y 0 y 0 f ( x) f ( x, y) x y 1 1 x 1 [( x 0) ( x 1) ( x 2)] [3x 3] 30 30 30 10 Similarly, f(y) = (3+2x)/15 Or , since the joint is y x 0 1 2 0 0 1/30 1/15 1 1/30 1/15 1/10 2 1/15 1/10 2/15 1/10 1/5 3/10 the marginal of x 3 1/10 2/15 1/6 2/5 x f(x) 0 1 2 3 1/10 1/5 of 3/10 the marginal y 2/5 Y 0 1 2 f(y) 1/5 1/3 7/15 13 Conditional Distribution: Recall that for any two events A and B, the conditional probability of A given B is defined as; P( A\ B) = P (A ∩ B) P (B) Provided P(B) ≠ 0. Suppose now that A and B are the events X = x and Y = y. So that we can write P(X = x\ Y = y)= P (X=x ,Y=y) (1) P (Y = y) Provided P(Y = y) = fY(y) ± 0, where P(X = x, Y = y) = f(x, y) is the value of the joint probability distribution of X and Y at (x, y) and fy (y) is the value of the marginal distribution of Y at y. Denoting the probability in equation 1 by f(x\y) to indicate that x is a variable and y is fixed, then we have the following definition. 14 Definition: If f(x, y) is the value of the joint probability' distribution of the discrete random variable X and Y at (x, y) and fy (y) is the value of the marginal distribution of Y at y, the function given by ƒ(x\y) = P(X = x\ Y = y) = ƒ (x , y) ƒY (y) for each x within the range of X, is called the conditional distribution of X given Y = y. Similarly, if fx(x) is the value of the marginal distribution of X at x f(y/x) = P ( Y = y / X = x ) = ƒ (x , y) ƒx (y) For each y within the range of Y , is called the conditional distribution of Y given X = x 15 Example 1 The joint probability mass function of X and Y is given by Marginal of Y f(1,1) = 1 f(1,2) = 1 f(2,1)= 1 8 4 8 f(2,2)= 2 1.Compute the conditional mass function of X given Y = i, i =1,2 2.Compute P(XY ≤ 3) = f(1, 1) + f(1, 2) + f(2, 1) = 1/2 3. P(X/Y> l) = f(2, 1)= 1/8 Y x 1 2 1/8 1/8 1 2 1/4 1/2 sum 3/8 5/8 Marginal of y y f(y) 1 2/8 2 6/8 x f(x\y=1) The conditional mass f n of X/Y =1 y The conditional of X/Y=2 f(x\y=2) 1 1/3 2 2/3 Sum 1 1 Sum 2/8 6/8 1 1 1/2 2 1/2 16 Independent Random Variables: In chapter 3 we stated that two events are independent if and only if P(A ∩ B) = P(A) P(B) that is, their joint probability is equal to the product of their marginal probabilities. In the following the notion of independence of random variables is presented. 17 Definition The random variables X and Y are said to be independent if and only if ƒ(x, y) = ƒx(x) fY(y) for all possible values of X and Y. In terms of the Joint cumulative distribution function, X and Y are independent if and only if F(x, y) = Fx(x) FY(y) For all possible values of X and Y Or P(X є A, Y є B) = P(X Є A) P(Y ЄB) for every A, B. 18 Thus, loosely speaking, X and Y are independent if knowing the value of one does not change the distribution of the other. Random variables that are not independent are said to be dependent. checking for Independence of discrete random variables requires a very thorough investigation since it is possible to have the product of the Marginal distributions equal to the joint probability distribution for some but not all combinations of ( x,y) . If one can find any point ( x , y ) for which ƒ(x , y) ≠ ƒx (x) . ƒy(y) ; then the discrete variable X and Y are not independent 19 If X is independent of Y, then the conditional mass function is the same as the unconditional ones. This follows because if X is independent of Y, then ƒ(x\y) = P(X = x\Y = y) = P(X = x,Y = y) P(Y = y) = P(X = x)P(Y = y) P( Y = y) = P(X = x) 20 Definition Let X1, X2, ..., Xn, be n discrete random variable having densities ƒ1, f2, ..., fn respectively. These random variables are said to be independent if their joint density function f is given by ƒ(x1,x2,..„xn)=ƒX1(xl)ƒX2(x2)...ƒXn(xn) for all (x1, x2, ..., xn) within their range. 21 Example Show that the random variables of Example 1 are not independent, f (1,1) = 1 8 f(1,2)= 1 4 f (2,1)= f (2,2)= 1 2 1 8 f x (1) = 3 8 , fx (2)= 5 , fy (1)= 2 , 8 8 fy (2)=3 4 f(1,1)= 1 ≠ 6 = fx (1) . fy (1) X and Y are not independent 8 64 22 Example The random variables X and Y are specified by P(X=1)= 2 P(X=0)= 1 3 3 P(Y= 1)= 1 P( Y= -1) = 3 4 4 Construct the joint distribution of X and Y assuming that X and Y are independent 0 1 -1 1/4 ½ 1 1/12 2/12 Y X 23