Chapter Four Random Variables and Their Probability Distributions STAT 111 Chapter Four Random Variables and Their Probability Distributions
Random Variables In the previous chapter, we introduced properties of a set function P defined on a sample space (S,F).In this chapter, we define random variables and discuss some of its properties. Definition A random variable is a function whose domain is a sample space and whose range is a set of real numbers. Random variables will be represented by capital letters X, Y, Z, etc., whereas, x,y,z will denote particular values a random variable may assume. Mathematically, a random variable X is a mapping X: S → R where the domain S is a sample space and R is the set of real numbers. It should be noted that the fundamental difference between a random variable and a real-valued function of a real variable is the associated notion of a probability distribution. Also, the name R.V(random variable) and not a function because the R.V is developed long before the term function is introduced.
Example 1 Suppose that a coin is tossed twice, let X represent the number of heads which can come up. Find the possible values of X. Solution X= number of heads Possible values x=0,1,2 (the values in the range, ordered, no repetition). (H,H) (H,T) (T,H) (T,T) 1 2
Note Random variables may be given by describing the quantity of interest, for example, in the case of X in the preceding example, we let X represent the number of heads which can come up. From this the functional relationship between sample space elements and real numbers may be determined. It should be noted that many other random variables could also be defined on this sample space, for example the square of the number of heads, the number of heads minus the number of tails, etc.
Discrete Distributions Recall that a set of elements is Countably infinite if the elements of the set can be put into one-to-one Correspondence with the positive integers Discrete Distributions It is said that a random variable X has a discrete distribution if X can take only a finite number n of different values x1,...,xn or, countably infinite number of different values x1, x2,…. Examples of discrete random variables are; the number of bacteria per unit area in the study of drug control on bacterial growth, the number of defective television sets in a shipment of 100.Indeed, discrete random variables most often represent counts associated with real phenomena. If X can take an infinite number of possibilities equal to the number of points on a line segment, then X has a continuous distribution. Definition: If a random variable X has a discrete distribution, the probability mass function (abbreviated p.m.f.) of X is defined as the function f such that for any real number x, f(x) = P(X = x) and f(x)=0, for any point x which is not one of the possible values of X. The expression (X= x) can be read, the set of all points in S assigned the value x by the random variable X, and P(X=x) is defined to be the sum of the probabilities of all sample points in S that are assigned the value x.
Probability mass function (p.m.f.) Properties of p.m.f. f(x) is a probability mass function iff It is often instructive to present the probability mass function in graphical format by plotting f(x) on the y-axis against X; on the x-axis. Before presenting several examples of p.m.f, we would like to point out that the p.m.f. of X is often called by a variety of other names. Among these are the following: 1. Distribution of the random variable X 2. Probability function 3. Discrete density function.
Example 2 Determine whether the following can be probability mass function and explain your answers. 1. ƒ (x) =1/5 , x = 0,1,2,3,4,5
Example 3 (H,H) (H,T) (T,H) (T,T) -2 2 Suppose that a pair of fair coins is tossed and let the random variable X denote the number of heads minus the number of tails. 1. Obtain the probability distribution for X X=number of H - number of T, S= {HH,HT,TH,TT} The probability distribution for X sum 2 -2 x 1 1/4 1/2 f(x)
Continued Example 3 2. Construct a graph for this probability distribution sum 2 -2 x 1 1/4 1/2 f(x) -2
Continued Example 3 3. Find P(X=1), f(-2), P(X ≤ 2),P(-2≤X<2),P(X<0) P(X=1)=f(1)=0 f(-2)=1/4 P(X≤ 2)=P(X= - 2)+P(X=0)+P(X=2)=1/4+1/2+1/4=1 P(-2≤X<2)=P(X= -2)+P(X=0)=1/4+1/2=3/4 P(X<0)=P(X= -2)=1/4 sum 2 -2 x 1 1/4 1/2 f(x)
Example 4 Find the value of k if Solution 0.2+k+0.5=1 k=0.3 1 -1 x 0.5 -1 x 0.5 k 0.2 f(x) 0.2+k+0.5=1 k=0.3
Example 5 A shipment of 7 television sets contains 2 defectives. A hotel makes a random purchase of 3 of the sets. If X is the number of defective sets purchased by the hotel. Find the probability distribution for X. Solution: X ≡ number of defective possible values of x=0,1,2 1 x 1/7 4/7 2/7 f(x)
Cumulative Distribution Functions The cumulative distribution function (abbreviated c.d.f.), or more simply the distribution function F of the random variable X, is defined for all real numbers x, -∞ <x < ∞ as F (x)= P( X ≤ x) In words, F(x) denotes the probability that the random variable X takes on a value that is less than or equal to x. Some properties of the c.d.f F are 0≤F(x)≤1 F is nondecreasing function; that is, if x < y , then F (x) ≤ F ( y) lim x → -∞ F ( x ) = 0 i.e. F(x) = 0 for every x that is less than the smallest value in S limx → ∞ F ( x ) = 1 i.e. F(x)= 1 for every x that is grater than the largest x values in S. F is right continuous. That is, for any x and any decreasing sequence xn ,n ≥ 1, that converges to x, limx → ∞ F (xn) = F( x ) Note: For a discrete random variable X, the graph of F(x) will have a jump at every possible value of X and will be flat between possible values. Such a graph is called a step function.
Example The probability mass function of the random variable X is given as Find the distribution function F(x) and graph this distribution function. Solution: 3 2 1 x 1/6 1/3 1/2 f(x) Graph of F(x) (step function)
Cumulative distribution function All probability questions about X can be answered in terms of the c.d.f. For example, P(X≤ a)=F (a) P(X=a)=P( X≤ a) -P (X< a) =P(X≤ a )-P(X≤ a-1) =1- F(a) - F (a-1) P(X>a)=1- P(X≤ a)=1 - F(a) P(X≥ a)=1- P(X<a)=1- P(X≤ a -1)= 1-F(a-1) P(X<a)=P(X≤ a - 1)=F (a -1) P(a <X ≤ b)=F(b)-F(a)
All probabilities in term of F(a) In summary, all probabilities in term of F(a) 1. P(a<X≤b) = F (b) – F (a ) 2. P(a≤ X≤ b) = P(a-1<X ≤ b) = F(b) –F (a-1) 3. P(a < X < b) = P(a < X≤ b-1)= F (b-1) – F (a ) 4. P(a≤ X< b) = P(a-1<X ≤ b-1) =F (b-1) – F (a-1 ) 5. P(X = a) = F(a) – F (a-1) 6. P(X ≤ a ) = F (a ) 7. P (X < a ) = P (X ≤ a – 1 ) = F ( a – 1 ) 8. P (X > a ) = 1 –P (X ≤ a ) = 1 – F ( a ) 9. P (X ≥ a ) = 1 – P (X < a ) = 1 – P ( X ≤ a – 1 ) = 1 F ( a – 1 )
Example 1. Determine the p .m .f. The probability mass function is The distribution function of the random variable X is given by 1. Determine the p .m .f. The probability mass function is 2. Compute P(X< 0) =0 P (X = 2 ) =F(2)-F(1)=0.92-0.75=0.17 P( X ≤ 5) =F(5)=1 P (1/2 < X ≤ 4) =F(4)-F(1/2)=1-0.25=0.75 Sum 3 2 1 x 0.08 0.17 0.5 0.25 f(x) Or simply f(2)=0.17