Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Random variable slides

The document explains the concepts of random variables, including discrete and continuous random variables, and their associated probability distributions. It provides examples of probability mass functions and cumulative distribution functions, illustrating how to calculate probabilities for different scenarios. Additionally, it discusses probability density functions for continuous variables and their applications.

Uploaded by

Shaheer Sajid
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Random variable slides

The document explains the concepts of random variables, including discrete and continuous random variables, and their associated probability distributions. It provides examples of probability mass functions and cumulative distribution functions, illustrating how to calculate probabilities for different scenarios. Additionally, it discusses probability density functions for continuous variables and their applications.

Uploaded by

Shaheer Sajid
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

RANDOM

VARIABLE
• A random variable is a function that associates a real number with each element in
the sample space. •
• We use a capital letter such as X to denote the random variable. •
• We use the small letter such as x for one of its values.
DISCRETE RANDOM VARIABLE

 It Can take only countable no of values


1. a box containing 4 red and 2 white balls. two balls are randomly selected from a
box. Let K be no of white bulbs.
k = 0, 1 , 2
2. Let X be no of defectives bulbs in a room containing 10 bulbs.
x = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
3. Let Y be no of messages at your WhatsApp per minute.
y= 0, 1, 2, 3,…, ∞
4. Let Z be no of interviews required to get 3 persons with a pet.
Z= 3, 4, 5, 6, …, ∞
5. Let W be no of tests to pass entry exam of engineering.
w = 1,2, 3, 4, 5, … , ∞
CONTINUOUS RANDOM
VARIABLE

 It can take uncountable values. (In intervals)


1. Let Q be a time to line up of 5 persons to get a
bus.
𝑄≥0
2. Let T be height of students in a class. −∞ ≤
𝑇≤∞
PROBABILITY MASS FUNCTION

• EXAMPLE: Flipping a Coin Twice


What is the probability distribution of X,
where the random variable X is the number
of tails appearing in two tosses of a fair
coin?
• Each of the four outcomes in the sample space S is equally
likely, and so each has a probability of 1/4.

• X takes the value 0 only for the outcome HH, so the probability
that X = 0 is 1/4.
• X takes the value 1 for outcomes HT OR TH. By the addition
principle, the probability that X = 1 is 1/4 + 1/4 = 1/2.
• Finally, X takes the value 2 only for the outcome TT, so the
probability that X = 2 is 1/4.
𝑃 𝑋 = 𝑥 = 𝑓 𝑥 is known as probability mass function for
discrete random variable X.
1
𝑃 𝑋=0 =𝑓 0 =
4
2
𝑃 𝑋=1 =𝑓 1 =
4
1
𝑃 𝑋=2 =𝑓 2 =
4
Any probability distribution of a discrete random
variable must satisfy:
Chapter 3 Page 93

3.22 Three cards are drawn in succession from a deck without


replacement. Find the probability distribution for the number of spades.

Spade card = S

Non Spade card = N

X= 0, 1, 2, 3
X = no of Spades 𝑃(𝑋 = 𝑥)

1 S S S 3 1716 132600

2 S S N 2

3 S N S 2 6084/132600

4 S N N 1

5 N S S 2

6 N S N 1 19266/13260
0

7 N N S 1

8 N N N 0 54834/13260
0
𝑃 𝑋 = 3 = 13 52 × 12 51 × 11 50 = 1716 132600
𝑃 𝑋 = 2 = 13 52 × 12 51 × 39 50 = (3 × 6084) 132600
= 18252/132600
𝑃 𝑋 = 1 = 13 52 × 39 51 × 38 50
= (3 × 19266) 132600 = 57798/132600
𝑃 𝑋 = 0 = 39 52 × 38 51 × 37 50 = 54834 132600

x 0 1 2 3

𝑃(𝑋 = 𝑥) 54834 57798 18252 1716


132600
132600 132600 132600
54834 57798 18252 1716 132600
𝑃 𝑋=𝑥 = + + + = =1
132600 132600 132600 132600 132600
3.3, 3.4, 3.5, 3.8, 3.10, 3.11, 3.24,
3.25, 3.26
Suppose a random variable X had possible values of 0
through 5.

Key Words Meaning Symbols Values for X

more than 2 strictly larger X>2 3, 4, 5


than 2
no more than 2 2 or fewer X≤2 0, 1, 2

fewer than 2 strictly smaller X<2 0, 1


than 2

no less than 2 2 or more X≥2 2, 3, 4, 5

at least 2 2 or more X≥2 2, 3, 4, 5


at most 2 2 or fewer X≤2 0, 1, 2
exactly 2 2, no more or X=2 2
no less, only 2
EXAMPLE

Suppose X is a random variable with the following table.


values of X : -2 -1 0 4
𝑃(𝑋 = 𝑥) =f(x): 1/4 1/4 1/4 1/4

Find out the probabilities


𝑃 𝑋 > 0 = 𝑃(𝑋 = 4)
𝑃 𝑋 ≤ 0 = 𝑃 𝑋 = −2 + 𝑃 𝑋 = −1 + 𝑃(𝑋 = 0)
𝑃 𝑋 ≥ −1 = 𝑃 𝑋 = −1 + 𝑃 𝑋 = 0 + 𝑃(𝑋 = 4)
𝑃 𝑋 < 4 = 𝑃 𝑋 = −2 + 𝑃 𝑋 = −1 + 𝑃 𝑋 = 0

𝑃 −2 < 𝑋 < 4 = 𝑃 𝑋 = −1 + 𝑃 𝑋 = 0
𝑃 −2 < 𝑋 ≤ 0 = 𝑃 𝑋 = −1 + 𝑃 𝑋 = 0

𝑃 −2 ≤ 𝑋 ≤ 0 = 𝑃 𝑋 = −2 + 𝑃 𝑋 = −1 + 𝑃 𝑋 = 0

𝑃 −2 ≤ 𝑋 < 0 = 𝑃 𝑋 = −2 + 𝑃 𝑋 = −1
January 1, 2017 14 /26
CUMULATIVE DISTRIBUTION
FUNCTION
The cumulative distribution function F(x) of a discrete random variable X
with probability distribution f(x) is

Find the cumulative distribution function of Q 3.22


x 0 1 2 3

𝑃(𝑋 = 𝑥) 54834 57798 18252 1716


132600
132600 132600 132600
𝐹(𝑥) 54834 112632 130884 132600
132600 =1
132600 132600 132600
54834
𝐹 0 =𝑓 0 =
132600
54834 57798 112632
𝐹 1 =𝑓 0 +𝑓 1 = + =
132600 132600 132600
112632 18252 130884
𝐹 2 =𝑓 0 +𝑓 1 +𝑓 2 = + =
132600 132600 132600

130884 1716
𝐹 3 =𝑓 0 +𝑓 1 +𝑓 2 +𝑓 3 = +
132600 132600
132600
= =1
132600
CONCEPT QUESTION: CDF AND PMF
X a random variable.
values of X : 1 3 5 7
cdf F (x): 0.5 0.75 0.9 1

1. What is P ( X ≤ 3)?
(a) 0.15 (b) 0.25 (c) 0.5 (d) 0.75

2. What is P ( X = 3)
(a) 0.15 (b) 0.25 (c) 0.5 (d) 0.75
1. answer: (d) 0.75. P ( X ≤ 3) = F (3) = 0.75.
2. answer: (b) P ( X = 3) = F (3) − F (1) = 0.75 − 0.5 = 0.25.
January 1, 2017 17 /26
EXAMPLE: CHANGING
MAJORS
A random sample of graduating seniors was surveyed just before
graduation. One question that was asked is:
How many times did you change majors?
The results are displayed in a probability distribution.

x 0 1 2 3 4 5
𝑃 𝑋=𝑥 0.28 0.37 0.23 0.09 0.02 0.01
= 𝑓(𝑥)

Using this probability distribution, we can answer probability


questions such as:
Question 1: What is the probability that a randomly selected
senior has changed majors more than once?

Answer 2:
This can be written as P(X > 1).

We can find this probability by adding the appropriate individual


probabilities in the probability distribution.
𝑃 𝑋 >1 =𝑃 𝑋 =2 +𝑃 𝑋 =3 +𝑃 𝑋 =4 +𝑃 𝑋 =5
= 0.23 + 0.09 + 0.02 + 0.01
= 0.35
Question 2: Based upon cumulative distribution function, do you
think it would be unusual to change majors 2 or more times?

Answer 2:
𝑃 𝑋 ≥ 2 = 1−𝑃 𝑋 < 2
= 1 − 𝑃 𝑋 ≤ 1 = 1 − 𝐹 1 = 1 − 0.65 = 0.35

0 + 1 2 3 4 5

=1

P(X ≥ 2) = 0.35.
So, 35% of the time a student changes majors 2 or more times.
This means that it is not unusual to do so.
Question 3: What is the probability of changing majors only once given
at least one change in major.
Answer 3:
A: At least one change 𝑃(𝑋 ≥ 1)
B: only once change 𝑃 𝑋=1
𝑃(𝐴 ∩ 𝐵)
𝑃 𝐵𝐴 =
𝑃(𝐴)
[since the only outcome that satisfies both X = 1 and X ≥ 1 is X = 1]

𝑃(𝑋 = 1 ∩ 𝑋 ≥ 1) 𝑃(𝑋 = 1)
𝑃 𝑋=1 𝑋≥1 = =
𝑃(𝑋 ≥ 1) 𝑃(𝑋 ≥ 1)
 Using CDF
0.65 − 0.28 0.37
= = = 0.5139
1 − 0.28 0.72
 Using PMF
0.37 0.37
= = 0.5139
0.37 + 0.23 + 0.09 + 0.02 + 0.01 0.72
So, among students who change at least 1 major, 51% of these
students will only change majors one time.
CONTINUOUS PROBABILITY DISTRIBUTION

In dealing with continuous variables, f(x) is usually called the


probability density function, or simply the density function,
of X.
The function f(x) is a Probability Density Function for the
continuous random variable x defined over the set of real
numbers, if
𝑓 𝑥 ≥0 𝑥∈𝑅

𝑓 𝑥 =1
−∞
• The probability distribution of a continuous random variable is
represented by a probability density curve.
• The probability that X gets a value in any interval of interest is the
area above this interval and below the density curve.
3.9 The proportion of people who respond to a certain mail-
order solicitation is a continuous random variable X that has the
density function

a. Find the probability that more than 1/4 but fewer than 1/2 of the
people contacted will respond to this type of solicitation.
0.5
2 𝑥+2
𝑃 0.25 < 𝑋 < 0.5 = 𝑑𝑥
0.25 5
b. Show that the area under the curve is equal to 1.
1
2 𝑥+2
𝑑𝑥 = 1
0 5
CUMULATIVE DISTRIBUTION
FUNCTION FOR CONTINUOUS
RANDOM VARIABLE

𝑥
𝐹 𝑥 =𝑃 𝑋≤𝑥 = 𝑓 𝑥 𝑑𝑥 𝑓𝑜𝑟 − ∞ < 𝑥 < ∞
−∞
3.21 Consider the density function

(a) Evaluate k.
1
𝑘 𝑥 𝑑𝑥 = 1
0
3
𝑘=
2
(b) Find F(x) and use it to evaluate P(0.3 < X < 0.6).
𝑥
3 3
𝐹 𝑥 = 𝑥 𝑑𝑥 = 𝑥 2
0 2
3 3
𝑃 0.3 < 𝑋 < 0.6 = 𝐹 0.6 − 𝐹 0.3 = 0.62 − 0.32
𝑂𝑅
0.6
3
𝑃 0.3 < 𝑋 < 0.6 = 𝑥𝑑𝑥
0.3 2
3.6, 3.7, 3.9, 3.14, 3.17, 3.18,
3.19, 3.20, 3.27, 3.28, 3.29,
3.30, 3.31, 3.36,
EXPECTED VALUE

Let X be a random variable with probability distribution f(x). The


mean, or expected value, of X is

 Discrete Random Variable


X is a random variable takes values 𝑥1,𝑥2,𝑥3,….,𝑥𝑛 The expected
value of X is defined by
E(X ) = 𝑓 𝑥1 𝑥1 + 𝑓 𝑥2 𝑥2 + ⋯ + 𝑓 𝑥𝑛 𝑥𝑛
𝑛

𝑥 × 𝑓(𝑥)
𝑖=1
 Continuous Random Variable

E X = 𝑥 × 𝑓(𝑥)
−∞
• It is a weightedaverage.
• It is a measure of centraltendency.
MEANING OF EXPECTEDVALUE
What is the expected average of one roll of a die?
answer: Suppose we roll it 5 times and get (3, 1, 6, 1, 2). To find the average
we add up these numbers and divide by 5: ave = 2.6. With so few rolls we don’t
expect this to be representative of what would usually happen. So let’s think
about what we’d expect from a large number of rolls. To be specific, let’s
(pretend to) roll the die 600 times.
We expect that each number will come up roughly 1/6 of the time. Let’s
suppose this is exactly what happens and compute the average.
value: 1 2 3 4 5 6
expected counts: 100 100 100 100 100 100
The average of these 600 values (100 ones, 100 twos, etc.) is then
100 · 1 + 100 · 2 + 100 · 3 + 100 · 4 + 100 · 5 + 100 · 6
average = 600
= 1 · 1 + 1 · 2 + 1 · 3 + 1 · 4 + 1 · 5 + 1 · 6= 3.5.
6 6 6 6 6 6
This is the ‘expected average’. We will call it the expectedvalue January 1, 2017 29 /26
Properties of E (X )
1. E(a)=a
2. E (X + Y ) = E (X ) + E (Y )
3. E (aX + b) = aE (X ) + b
4. 𝐿𝑒𝑡 ℎ 𝑥 = 𝑥 − 2 2 = 𝑥2 + 22 − 4𝑥
𝐸 ℎ 𝑥 = 𝐸 𝑥−2 2
2
= 𝑥−2 ×𝑃 𝑋 = 𝑥

𝑂𝑅
𝐸 𝑥 + 4 − 4𝑥 = 𝐸 𝑥2 + 𝐸 4 − 4𝐸(𝑥)
2
Example 1. Find E X , 𝐸 (𝑋 2 +1)
X: 3 4 5 6
𝑃 𝑋 = 𝑥 = 𝑓(𝑥): 1/4 1/2 1/8 1/8

1 1 1 1
E (X ) = 3 × + 4 × + 5 × + 6 ×
4 2 8 8
E(X) = 3/4 + 4/2 + 5/8 + 6/8 = 33/8
To find 𝐸 (𝑋 2 +1)
𝑿𝟐 + 𝟏 (𝟑𝟐 +𝟏) = 𝟏𝟎 (𝟒𝟐 +𝟏) = 𝟏𝟕 (𝟓𝟐 +𝟏) = 𝟐𝟔 (𝟔𝟐 +𝟏) = 𝟑𝟕

𝑓(𝑥) 1 4 1 2 1 8 1 8

1 1 1 1 151
𝐸(𝑋 2 + 1) = 1 0 × + 17 × + 26 × + 37 × =
4 2 8 8 8

January 1, 2017 19 / 26
OR
To find 𝐸 (𝑋 2 +1) = 𝐸 𝑋 2 + 1

𝑿𝟐 𝟑𝟐 = 𝟗 𝟒𝟐 = 𝟏𝟔 𝟓𝟐 = 𝟐𝟓 𝟔𝟐 = 𝟑𝟔

𝑓(𝑥) 1 4 1 2 1 8 1 8

1 1 1 1 143
𝐸(𝑋 2 ) = 9 × + 16 × + 25 × + 36 × =
4 2 8 8 8

𝐸 (𝑋 2 +1) = 𝐸 𝑋 2 + 1

143 151
= +1=
8 8
QUESTION: INTERPRETING EXPECTATION

(a)Would you accept a gamble that offers a 10% chance to win $95 and a
90% chance of losing $5?

𝑥 × 𝑓 𝑥 = 95 × 0.10 + (−5 × 0.90)

= 9.5 − 4.5 = $5
In this situation your expected gain will be only $5.

4.1, 4.2, 4.4, 4.6, 4.7, 4.8, 4.18, 4.19, 4.32

January 1, 2017 33 /26


4.13 The density function of the continuous random variable X,
the total number of hours, in units of 100 hours, that a family
runs a vacuum cleaner over a period of one year is given as
follows
𝑥, 0<𝑥<1
𝑓 𝑥 = 2−𝑥 1≤𝑥 ≤2
0 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
Find the average number of hours per year that families run their
vacuum cleaners.

E X = 𝑥 × 𝑓 𝑥
−∞
1 2

𝐸 𝑋 = 𝑥(𝑥) 𝑑𝑥 + 𝑥 2 − 𝑥 𝑑𝑥
0 1
4.20 A continuous random variable X has the density function
𝑒 −𝑥 𝑥>0
𝑓 𝑥 =
0 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
2𝑥
Find the expected value of 𝑔 𝑥 = 𝑒 3


2𝑥
𝐸 𝑔(𝑥) = 𝑔 𝑥 × 𝑓 𝑥 𝑑𝑥 = 𝑒 3 × 𝑒 −𝑥 𝑑𝑥
0
∞ ∞
2𝑥−3𝑥 −𝑥 −𝑥
= 𝑒 3 𝑑𝑥 = 𝑒3 𝑑𝑥 = −3𝑒 3

0 0
Variance and Standard Deviation
Let X be a random variable with probability distribution f(x) and
mean μ. The variance of X is
𝜎 2 = 𝐸 𝑋 − 𝜇 2 = 𝑥 − 𝜇)2 𝑓(𝑥 For Discrete r.v
𝜎 2 = 𝐸 𝑋 − 𝜇 2 = 𝑥 − 𝜇)2 𝑓(𝑥 𝑑𝑥 For Continuous r.v

The positive square root of the variance, σ, is called the


standard deviation of X.

Short Method

The variance of X is 𝜎 2 = 𝐸 𝑋 2 − 𝐸(𝑋) 2


For Discrete r.v
𝐸 𝑋2 = 𝑥2𝑓 𝑥

𝐸 𝑋 =𝜇= 𝑥𝑓(𝑥)

For Continuous r.v


𝐸 𝑋2 = 𝑥)2 𝑓(𝑥 𝑑𝑥

𝐸 𝑋 = 𝑥𝑓 𝑥 𝑑𝑥
4.34 Let X be a random variable with the following probability
distribution:
X -2 3 5

f(x) 0.3 0.2 0.5

Find the standard deviation of X.

𝑿𝟐 (−𝟐)𝟐 = 𝟒 𝟑𝟐 = 𝟗 𝟓𝟐 = 𝟐𝟓

𝑓(𝑥) 0.3 0.2 0.5

𝐸(𝑋 2 ) = 4 × 0 . 3 + 9 × 0 . 2 + 2 5 × 0 . 5 =15.5
E (X ) = − 2 × 0 . 3 + 3 × 0 . 2 + 5 × 0 . 5 = 2 . 5

𝐸 𝑋2 = 15.5 𝐸 𝑋 = 2.5

𝜎2 = 𝐸 𝑋2 − 𝐸 𝑋 2

= 15.5 − 2.52 = 9.25

𝑆. 𝐷 = 𝜎 = 9.25
4.38 Find the variance of X if X has the density function
2(𝑥 + 2)
𝑓 𝑥 = 0<𝑥<1
5
0 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒

𝜎2 = 𝐸 𝑋2 − 𝐸 𝑋 2
1
2 𝑥 +2
𝐸 𝑋2 = 𝑥2 × 𝑑𝑥
5
0
1
2(𝑥 + 2)
𝐸 𝑋 = 𝑥 × 𝑑𝑥
5
0
4.20 A continuous random variable X has the density
function

Find the expected value of g(X) = e2X/3.

4.30 In Exercise 3.31 on page 94, the distribution of times


before a major repair of a washing machine was given as

What is the population mean and variance of the times


to repair?

You might also like