Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

Chapter 2

Random Variables and Probability


Distributions
2.1 Random Variables
A variable X is a random variable if the value that it assumes corresponding
to the outcome of an experiment, is a chance or random event: X : S ® Â+
So, X(s) = x means that x is the value associated with the outcome s by
the
random variable X.

Two types of random variables:


Discrete – The possible values of the random variable is finite or
countable.
Example:
X = # of game ND university will win in a football season.
X = # of defective parts in inspecting a random sample of 10 parts.
X = # of school violence per month in USA
Continuous – The possible values are in a real interval.
Example:
X = adult height,
2.2 Discrete Random Variable and Probability Distribution
The probability distribution for a discrete random variable is a formula, table, or
graph that provides p(x), the probability associated with each of the values of x.

p(x) = P(X = x) = P ( all s Î S : X(s) = x )


Requirements for a Discrete Probability Distribution
0  p( x )  1 AND  p(x ) = 1
A typical tabular form of a discrete distribution is
X x1 x2 ……… xn

P(X) P(x1) P(x2) ……… P(xn)

A simple example of a discrete random variable: # of heads


occur when tossing two fair coins together:
X: # of Heads 0 1 2
P(X) 1/4 1/2 1/4
3
To construct the probability distribution of a discrete
random variable X
Step 1: Determine all possible values of X (all simple events).
Step 2: Find probability of each value in step 1.
Step 3: Complete the table for probability distribution
Graphical presentation of a discrete probability distribution is :
Probability Bar Chart, with P(x) on Y-axis and X-values on X-axis.

NOTE: Shapes of the distribution can be skewed-to-right,


symmetric, and skewed-to-left.

4
Example: Construct the probability distribution of X where X is
the number of boys in a family of 3 children.
* The Cumulative Distribution Function
The Cumulative Distribution Function F(x) is the probability
that the observed value of X will be at most x.
That is F(x) = P (X ≤ x);

Example: Find cdf in example 1.

6
Activity for Discrete Distribution
Insurance companies decide their premium based on the # of accidents and the type of accidents
occurred in the previous years in a large area. The following is an example about # of car
accidents per day in a large city area:
X : # of Accidents: 0 1 2 3 4 5 6
Probability .05 ? .3 .2 .1 .08 .02
Q1: Determine P(X =1 )
Q2: What is the probability of having exactly 3 accidents in a given day?
Q3: What is the probability of having at most 2 accidents in a given day?
Q4: What is the probability of having at least 3 accidents in a given day?

7
Expected Value

In order determine the premium, the insurance company would ask:

1) What is the expected average # of accidents?


2) Is the # of accidents the same from day to day? Or it varies from day to day?
3) If it varies from day to day, then, what is the variance and standard deviation of
the # of accidents?
4) What does the distribution of the # of accidents look like?

Expected average # of accidents is similar to the average we learned in Chapter 2.


Is the following a right way to find the expected average # of accidents
= (0+1+2+3+4+5+6)/7 = 0 * (1/7) + 1*(1/7) + ….. + 6*(1/7) ?

8
How to describe a discrete distribution?
The distribution has the center value (or called mean, or expected value) and
the variation of the distribution can be described by a numerical value,
called variance or by standard deviation.

The Center: The mean or expected value of the variable X : m = E(X) = SxP(x)

NOTE: The Expected Value m, the population mean. For a given population,
there is ONLY one Expected value, m.
DO NOT mix up with the Sample Mean, X . We can take many different
samples from the same population. Sample means are different from sample to
sample. BUT, there is only one population mean. You can not compute
population mean from a random sample that is not the entire population.
The Variation: The variance and standard deviation of X:
Let x be a discrete random variable with probability distribution p(x) and mean m.
The variance of x is
s 2 = E[(x - m ) 2 ]= S(x - m ) 2 p(x) =  x 2 P( x) - m 2

The standard deviation s of a random variable X : s = s2


NOTE: s 2 and s are population parameters. DO NOT mix up with Sample
variance, s2 , and sample s.d., s.
Example (Insurance Activity)

X: # of accidents 0 1 2 3 4 5 6
P(x) .05 .25 .3 .2 .1 .08 .02

Q6: What would the expected average number of accidents in a given day?
Q7: What would the variance of the number of accidents in a given day?
Q8: What is the standard deviation of the number of accidents in a given day?
2.3 Probability Density Functions
Continuous Random Variables
Probability density function
EXAMPLE Illustrating the Uniform Distribution

Suppose that United Parcel Service is supposed to deliver a


package to your front door and the arrival time is somewhere
between 10 am and 11 am. Let the random variable X
represent the time from 10 am when the delivery is supposed
to take place. The delivery could be at 10 am (x = 0) or at 11
am (x = 60) with all 1-minute interval of times between x = 0
and x = 60 equally likely. That is to say your package is just as
likely to arrive between 10:15 and 10:16 as it is to arrive
between 10:40 and 10:41. The random variable X can be any
value in the interval from 0 to 60, that is, 0 < X < 60. Because
any two intervals of equal length between 0 and 60, inclusive,
are equally likely, the random variable X is said to follow a
uniform probability distribution.
The graph below illustrates the properties for the “time”
example. Notice the area of the rectangle is one and the graph
is greater than or equal to zero for all x between 0 and 60,
inclusive.

Because the area of a


rectangle is height
times width, and the
width of the rectangle
is 60, the height must
be 1/60.
Values of the random variable X less than 0 or greater than
60 are impossible, thus the equation must be zero for X
less than 0 or greater than 60.
A continuous random variable X is said to have a uniform distribution
on the interval [A, B] if the pdf of X is:

f (x; A,B) = 1/(B - A) if A ≤ x ≤ B


and f (x; A,B) = 0 otherwise;

The area under the graph of the density function over an


interval represents the probability of observing a value of the
random variable in that interval.

Example:
Assume the waiting time at a bus stop is uniformly distributed on the interval [0,5].
What is the probability that it is between 1 and 3 minutes?
A continuous random variable X is said to have a uniform distribution
on the interval [A, B] if the pdf of X is:

f (x; A,B) = 1/(B - A) if A ≤ x ≤ B


and f (x; A,B) = 0 otherwise;

The area under the graph of the density function over an


interval represents the probability of observing a value of the
random variable in that interval.

Example:
Assume the waiting time at a bus stop is uniformly distributed on the interval [0,5].
What is the probability that it is between 1 and 3 minutes? (0.4)
EXAMPLE Area as a Probability

The probability of choosing a time that is between 15 and 30


seconds after the minute is the area under the uniform density
function.

Area
= P(15 < x < 30)
= 15/60
= 0.25

15 30
The cumulative distribution
function
Computing probabilities using
the cdf
Percentiles of a continuous
distribution
Mean of a continuous random
variable
Expected value of a function of a
rv
Variance of a continuous rv
A shortcut formula for Variance:
V(X) = E(X ) -[E(X)]
2 2
Joint Probability Mass Function
Example: Consider the Joint Probability
Distribution in the following table. Find the
marginal probability for X and Y?

  
     Y
    1 2 3 4
X

❍1❍ 16/136 3/136 2/136 13/136
2 5/136 10/136 11/136 8/136
3 9/136 6/136 7/136 12/136
4 4/136 15/136 14/136 1/136
Joint Probability Density
Function
Example: Find the marginal density functions
when the joint density function is:
ì12
ï xy(1+ y) if 0 £ x £ 1 and 0 £ y £1
f (x, y) = í 5
ïî0 otherwise
Independent Random Variables
Example: Consider the independence of X
and Y ?
  
     Y
a.     1 2 3 4
X

❍1❍ 16/136 3/136 2/136 13/136
2 5/136 10/136 11/136 8/136
3 9/136 6/136 7/136 12/136
4 4/136 15/136 14/136 1/136
b. ì12
ï xy(1+ y) if 0 £ x £ 1 and 0 £ y £1
f (x, y) = í 5
ïî0 otherwise
Conditional distributions
Example:
a. Construct the probability table for the rv (Y|X=1)
in example 1?
b. Find FX(x|y) and P(X<1/2 | Y=1/2) in example 2?
Expected value
Example: Find E(XY), Var (X+Y), Var (X-
Y) and Cov(X,Y)?
  
     Y
a.     1 2 3 4
X

❍1❍ 16/136 3/136 2/136 13/136
2 5/136 10/136 11/136 8/136
3 9/136 6/136 7/136 12/136
4 4/136 15/136 14/136 1/136
b. ì12
ï xy(1+ y) if 0 £ x £ 1 and 0 £ y £1
f (x, y) = í 5
ïî0 otherwise

You might also like