Random Variables

Download Report

Transcript Random Variables

Random Variables
Probability Continued
Chapter 7
Random Variables
A numerical variable whose value
depends on the outcome of a
chance experiment is called a
random variable.
discrete versus continuous
Discrete Random Variables:
A random variable X has a countable
number of possible outcomes.
Exact number of outcomes…no
decimals.
Discrete versus Continuous
Probability Distributions
Properties: Discrete
For every possible x value, 0 < p(x) < 1.
 Sum of all possible outcome probabilities add
to 1.

Properties: Continuous
Often represented by a graph or function.
 Area of domain is 1.

Discrete vs. Continuous
The number of desks in a classroom.
The fuel efficiency (mpg) of an
automobile.
The distance that a person throws a
baseball.
The number of questions asked during a
statistics final exam.
Random Variables
Ex 1. Suppose that each of three randomly selected
customers purchasing a hot tub at a certain store
chooses either an electric (E) or a gas (G) model.
Assume that these customers make their choices
independently of one another and that 40% of all
customers select an electric model. The number
among the three customers who purchase an
electric hot tub is a random variable. What is the
probability distribution?
Random Variable Example 1
X = number of people who purchase electric hot tub
X 0
1
2
3
P(X) .216 .432 .288 .064
GGG
(.6)(.6)(.6)
EGG
GEG
GGE
(.4)(.6)(.6)
(.6)(.4)(.6)
(.6)(.6)(.4)
EEG
GEE
EGE
(.4)(.4)(.6)
(.6)(.4)(.4)
(.4)(.6)(.4)
EEE
(.4)(.4)(.4)
Ex 2. Getting Good Grades
The instructor of a large class gives 15% of each A’s
and D’s, 30% of each B’s and C’s, and 10% of F’s.
Choose a student at random from this class. The
student’s grade on a four-point scale is a random
variable X.
-------------------------------------------------------------------
Grade (X)
Probability
0
.10
1
.15
2
.30
3
.30
4
.15
------------------------------------------------------------------What is the probability that the student chosen at random gets a grade of
C or better?
Probability Histogram:
Compares the probability model for
outcomes of random digits.
The “y” represents the probability.
The “x” represents the possible
outcomes.
Ex 3. What is the probability distribution of the
discrete random variable X that counts the number
of heads in four tosses of a coin?
Assumptions (must be stated every time):
1. The
coin is balanced, each toss being equally
likely T or H.
2. The
coin has no memory, so tosses are
independent.
Ex 3. What is the probability distribution of the
discrete random variable X that counts the number of
heads in four tosses of a coin?
Display the possible outcomes in the chart
below.
-----------------------------------------------------------------X=0
X=1
X=2
X=3
X=4
a.
X
-----------------------------------------------------------------------------------------------------------------------------
P(X)
Ex 3. Continued
b.
What is the P(THHT)?
c.
What is the P(X = 2)?
d.
What is the P(X > 2)?
e.
What is the P(X ≤ 3)?
f.
What is the P(X < 1.5)?
g.
Create a probability histogram to display the
probability distribution from part a.
Means and Variances
The mean value of a random variable X
(written mx ) describes where the probability
distribution of X is centered.
We often find the mean is not a possible
value of X, so it can also be referred to as
the “expected value.”
The standard deviation of a random
variable X (written sx )describes variability
in the probability distribution.
Formulas
Mean of a Random Variable
m X   xi pi
Variance of a Random Variable
s X2   ( xi  m X )2 pi
Mean of a Random Variable Example
Below is a distribution for number of
visits to a dentist in one year. X = # of
visits to the dentist.
X
0 1 2 3
4
P( X ) .1 .3 .4 .15 .05
Determine the expected value,
variance and standard deviation.
Mean of a Random Variable Example
X
0 1 2 3
4
P( X ) .1 .3 .4 .15 .05
m X   xi pi
E(X) = 0(.1) + 1(.3) + 2(.4) + 3(.15) + 4(.05)
= 1.75 visits to the dentist
Variance and Standard Deviation of a
Random Variable Example
X
0 1 2 3
4
P( X ) .1 .3 .4 .15 .05
s   ( xi  m X ) pi
2
X
2
Var(X) = (0 – 1.75)2(.1) + (1 – 1.75)2(.3) +
(2 – 1.75)2(.4) + (3 – 1.75)2(.15) +
= .9875
(4 – 1.75)2(.05)
s X  .9875  .9937 visits
Developing Transformation Rules
Consider the following distribution for
the random variable X:
X
1 2
P( X ) .2 .8
af af
1  18
. faf
.2  a
2  18
. faf
.8  .16
Var(X) = a
E( X)  1 .2  2 .8  18
.
2
2
X+1
What is the probability
distribution for X+1?
X
1
2
P( X )
.2
.8
X 1
2 3
P ( X  1)
.2 .8
af
2  2.8faf
.2  a
3  2.8faf
.8  .16
Var(X +1) = a
E(X +1) = 2 .2  3(.8)  2.8
2
2
Original mean and var.
E(X) = 1.8 Var(X) =.16
2X
What is the probability
distribution for 2X?
X
1
2
P( X )
.2
.8
2X
2 4
P (2 X ) .2
.8
E(2X) = 2(.2)  4(.8)  3.6
Var(2X) =  2  3.6  .2    4  3.6  .8   .64
2
2
Original mean and var.
E(X) = 1.8 Var(X) =.16
Consider
Suppose that E(X) = 2.5, Var(X) = 0.2
What is E(X+5) = ?, Var(X+5) = ?

E(X+5) = 7.5, Var(X+5) = 0.2
What is E(X – 2.2) = ?, Var(X – 2.2) = ?

E(X – 2.2) = 0.3, Var(X – 2.2) = 0.2
What is E(3X) = ?, Var(3X) = ?

E(3X) = 7.5, Var(3X) = 1.8
What is E(2X – 1) = ?, Var(2X – 1) = ?

E(2X – 1) = 4, Var(2X – 1) = 0.8
Rule 1
Rule 1: If X is a random variable and a
and b are fixed numbers, then
ma + bX = a + bmX
Rule 1: If X is a random variable and a
and b are fixed numbers, then
s2a + bX =b2s2X
X
1
2
P( X )
.2
.8
X+X
X+X
What is the probability
distribution for X+X?
.2
.8
1
P( X  X )
2
3
4
.04 .32 .64
.2
1
.8
2
.2
1
2
.8
2
E(X) = 1.8 Var(X) =.16
X+X
X+X
2
3
X
1
2
P( X )
.2
.8
4
P( X  X ) .04 .32 .64
af
E(X + X) = 2 .04  3(.32)  4(.64)  3.6
Var(X + X) =
2  3.6 .04  3  3.6 .32  4  3.6 .64 .32
2
2
2
X
1
2
P( X )
.2
.8
X–X
XX
P( X  X )
What is the probability
distribution for X–X ?
.2
.8
1
1
.2
.8
2
.2
1
.8
1
.16 .68 .16
1
2
0
2
E(X) = 1.8 Var(X) =.16
X–X
X X
1
0
1
P( X  X ) .16 .68 .16
E(X  X) = 1(.16)  0(.68)  1(.16)  0
Var(X  X) =
2
1  0 .16  0  0
a fa f a fa.68f a1  0fa.16f .32
2
2
Consider
Suppose that E(X) = 2.5, Var(X) = .16,
E(Y) = 1.2, Var(Y) = .36
What is E(X+Y) = ?, Var(X+Y) = ?

E(X+Y) = 3.7, Var(X+Y) = .52
E(X – Y) = ?, Var(X – Y) = ?

E(X – Y) = 1.3, Var(X – Y) = .52
What is s(X) = ?, s(Y) = ?, s(X+Y) = ?

s(X) = .4, s(Y) = .6, s(X+Y) = .7211
Rule 2
Rule 2: If X and Y are random variables,
then
mX + Y = mX + mY
mX – Y = mX – mY
Rule 2: If X and Y are independent
random variables, then
s2X + Y = s2X + s2Y
s2X  Y = s2X + s2Y
Note: cannot combine standard deviation
directly...you must first combine using
variance and then square root.