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

Chapter 2

This document discusses random variables and probability distributions. It defines a random variable as a function that assigns a real number to each outcome in a sample space. Random variables can be discrete, taking on countable values, or continuous, taking on uncountable interval values. The document outlines discrete and continuous probability distributions, including probability mass functions for discrete variables and probability density functions for continuous variables. It provides examples of calculating probabilities and cumulative distribution functions for different random variables.

Uploaded by

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

Chapter 2

This document discusses random variables and probability distributions. It defines a random variable as a function that assigns a real number to each outcome in a sample space. Random variables can be discrete, taking on countable values, or continuous, taking on uncountable interval values. The document outlines discrete and continuous probability distributions, including probability mass functions for discrete variables and probability density functions for continuous variables. It provides examples of calculating probabilities and cumulative distribution functions for different random variables.

Uploaded by

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

Random Variables and

Probability Distributions

Probability and Engineering Statistics – ES233

CHAPTER 2
Chapter Outline

➢ Concept of a Random Variable.

➢ Discrete Probability Distributions.

➢ Continuous Probability Distributions.

➢ Mean and Variance of a Random Variable.

1
Concept of a Random Variable

➢ In a statistical experiment, it is often very important to allocate numerical values to


the outcomes.
➢ For Example,
Experiment: testing two components.(where N denotes non-defective defective and
D denotes defective)
Sample space: S ={DD,DN,ND,NN}
▪ Let X = number of defective components when two components are tested.
▪ Assigned numerical values to the outcomes are shown
▪ Notice that, the set of all possible values of the random variable X is {0, 1, 2}.

DD S
DN
ND
NN

0 1 2
2
Concept of a Random Variable

➢ A random variable is a function that assigns a real number to each outcome in the
sample space of a random experiment.
➢ Notation: " X " denotes the random variable .
" x " denotes a value of the random variable X.
➢ Types of Random Variables:
• A discrete random variable is a random variable with a finite (or countably
infinite) range.
• A continuous random variable is a random variable with an interval (either
finite or infinite) of real numbers for its range.
➢ In most practical problems:
• A discrete random variable represents count data, such as the number of
defectives in a sample of k items.
• A continuous random variable represents measured data, such as height, weights,
temperatures, distance, or life periods. 3
Concept of a Random Variable

➢ Examples of random variables:

Experiment Random Variable Possible Values

Inspect 60 Radios # Defective 0, 1, 2, ..., 60 Discrete

Answer in a 100-MCQ test # Correct 0, 1, 2, ..., 100 Discrete

Cars passing a toll Discrete


# Cars passing 0, 1, 2, ..., ∞
both in a day

One machine is 0 if defective 0, 1


=ቊ Discrete
inspected 1 if not defective (a Bernoulli random variable)

Operate a light bulb Time until the bulb Continuous


0≤x<∞
until it burns out burns out
Measure the voltage at 118 ≤ x ≤ 122
Voltage measured Continuous
an electrical outlet

4
Discrete Probability Distributions

➢ The probability distribution of a random variable X is a description of the


probabilities associated with the possible values of X.
➢ A discrete random variable has a probability distribution that specifies the list of the
possible values of X along with the probability of each, or it can be expressed in
terms of a function or formula.
➢ A probability distribution must satisfy the following conditions.

5
Discrete Probability Distributions

➢ Example 1:
Verify that the following functions are probability mass functions, and determine the
requested probabilities:
a. P(X ≤ 2)
x -2 -1 0 1 2
b. P(X > -2) f(x)=P(X = x) 1/8 2/8 2/8 2/8 1/8
c. P(-1 ≤ X ≤ 1)

Solution:
• Each probability is between 0 and 1 - f(x ) ≥ 0
෍ 𝑓(𝑥) = 1
• The sum of the probabilities is equal 1 - 𝑥
-
a. P(X ≤ 2) = 1
b. P(X > -2) = 7/8
c. P(-1 ≤ X ≤ 1) = 6/8

6
Discrete Probability Distributions

➢ Example 2:
A shipment of 20 similar laptop computers to a retail outlet contains 3 that are
defective. If a school makes a random purchase of 2 of these computers, find the
probability distribution for the number of defectives.
Solution:
Let X be a random variable whose values x are the possible numbers of defective
computers purchased by the school. Then x can only take the numbers 0, 1, and 2
3 17 3 17
68 1 1 51
0 2 𝑓 1 =𝑃 𝑋=1 = =
𝑓 0 =𝑃 𝑋=0 = 20 = 20 190
95 2
2
3 17
2 0 3
𝑓 2 =𝑃 𝑋=2 = 20 =
190
2
The probability distribution of X can be given in the following table:

x 0 1 2
f(x)=P(X = x) 68/95 51/190 3/190
7
Discrete Probability Distributions

➢ Cumulative Distribution Function:


For any real-valued random variable X, its cumulative distribution function F(x),
often denoted as just the CDF, equals the probability that the value of X is less than
or equal to a specific value or threshold x:

➢ Example 3:
Find the cumulative distribution function (CDF) of the random variable X with the
probability function: x 0 1 2 3 4
f(x) 1/16 1/4 3/8 1/4 1/16
Solution:
F(0) = f(0) = 1/16,
F(1) = f(0) + f(1) = 5/16,
F(2) = f(0) + f(1) + f(2) = 11/16,
F(3) = f(0) + f(1) + f(2) + f(3) = 15/16,
F(4) = f(0) + f(1) + f(2) + f(3) + f(4) = 1. 8
Discrete Probability Distributions

Probability mass function plot. Probability histogram.


x 0 1 2 3 4

f(x)=P(X = x) 1/16 1/4 3/8 1/4 1/16

F(x)=P(X ≤ x) 1/16 5/16 11/16 15/16 16/16

• f(xi) = F(xi) − F(xi−1)


f(2) = F(2) − F(1)
= 11/16 − 5/16 = 3/8
Discrete cumulative distribution function 9
Continuous Probability Distributions

➢ A continuous random variable has a probability of 0 of assuming exactly any of its

values. Consequently, its probability distribution cannot be given in tabular form.

➢ Example-If we talk about The probability of selecting a person who is at least 163

centimeters but not more than 165 tall. Now we are dealing with an interval rather

than a point value of our random variable.

➢ The definition of probability in the continuous case presumes for each random

variable the existence of a function, called a probability density function (pdf), such

that areas under the curve give the probabilities associated with the corresponding

intervals along the horizontal axis.

10
Continuous Probability Distributions

➢ The probability that X assumes a value between a and b is equal to the shaded area
under the density function between the ordinates at x = a and x = b, and from integral
calculus is given by

𝑃 𝑎<𝑋<𝑏
𝑏
𝑃 𝑎 < 𝑋 < 𝑏 = ‫𝑥𝑑 𝑥 𝑓 𝑎׬‬.

➢ If X is a continuous random variable, for any a and b ,


P(a ≤ X ≤ b) = P(a ≤ X < b) = P(a < X ≤ b) = P(a < X < b) 11
Continuous Probability Distributions

➢ Example 4:
𝑥2
, −1 < 𝑥 < 2,
Suppose that 𝑓 𝑥 = ቐ3
0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒.

a. Verify that f(x) is a density function.


b. find P(0 < X ≤ 1).
Solution:
a. f x ≥ 0 because f x is a quadratic function.

∞ −1 2 ∞
න 𝑓(𝑥) 𝑑𝑥 = න 𝑓(𝑥) 𝑑𝑥 + න 𝑓(𝑥) 𝑑𝑥 + න 𝑓(𝑥) 𝑑𝑥
−∞ −∞ −1 2

2
2
𝑥2 𝑥3 (2)3 −1 3
8 1
න 𝑑𝑥 = = − = + =1
−1 3 9 9 9 9 9
-1
1 𝑥2 𝑥3 1 1 3 0 3 1 0 1
b. P (0 < X ≤ 1) = ‫׬‬0 3 𝑑𝑥 = = − = + =9
9 9 9 9 9
0 12
Continuous Probability Distributions

➢ Example 5:
The pdf of the random variable X is given by

𝑓 𝑥 = ቊ𝐶/ 𝑥, 0<𝑥<4
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Find:
a. the value of C,
b. P (X < 0.25) and (X > 1).
Solution:
∞ 0 4 ∞
a. ‫׬‬−∞ 𝑓(𝑥) 𝑑𝑥 = ‫׬‬−∞ 𝑓(𝑥) 𝑑𝑥 + ‫׬‬0 𝑓(𝑥) 𝑑𝑥 + ‫׬‬4 𝑓(𝑥) 𝑑𝑥
1
− 2 +1 4 4
𝑥
1 1
4 𝑐 4 −2 − +1
= ‫׬‬0 𝑑𝑥 = ‫׬‬0 𝑐𝑥 𝑑𝑥 = 𝑐 2 0 = 2c 𝑥 0 = 4c =1
𝑥

and it follows that c =1/4


13
Continuous Probability Distributions

b) P (X < 0.25)
0.25
0.25 0.25 1 1 1 1
= ‫׬‬−∞ 𝑓(𝑥) 𝑑𝑥 = ‫׬‬0 𝑑𝑥 = 42 𝑥 = ( 0.25 -0) = 4
4 𝑥 0 2

P (X > 1)
∞ 4 ∞ 4 1
= ‫׬‬1 𝑓(𝑥) 𝑑𝑥 =‫׬‬1 𝑓(𝑥) 𝑑𝑥 + ‫׬‬4 𝑓(𝑥) 𝑑𝑥= ‫׬‬1 𝑑𝑥 =
4 𝑥

4
1 1 1
= 2 𝑥 = (2 -1) = 2
4 2
1

14
Continuous Probability Distributions

➢ Cumulative Distribution Functions:


Definition: the cumulative distribution function (CDF), F(x), of a continuous random
variable X with probability density function f(x) is given by:

➢ Result:
• P(a ≤ X ≤ b) = P(X ≤ b) − P(X ≤ a)= F (b) − F(a)
𝑑𝐹(𝑥)
• 𝑓 𝑥 = , if the derivative exists.
𝑑𝑥

15
Continuous Probability Distributions

➢ Example 6:
For the density function of Example 4 , find F(x). Use it to evaluate P(0 < X ≤ 1).
Solution:
x
𝑥 𝑥 𝑡2 𝑡3 𝑥 3 +1
F(x) = ‫׬‬−∞ 𝑓 𝑡 𝑑𝑡 = ‫׬‬−1 3 𝑑𝑡 =
9 -1
=
9
.

0, 𝑥 < −1,
𝑥3 + 1
𝐹 𝑥 = , −1 ≤ 𝑥 < 2,
9
1, 𝑥≥2
Using the CDF,
2 1 1
P(0 < X ≤ 1) = F(1) – F(0) = 9 − =9
9

16
Mean and Variance of a Random Variable

➢ Two numbers are often used to summarize a probability distribution for a random
variable X.
➢ The mean is a measure of the center or middle of the probability distribution, and is a
weighted average of the values of the random variable.
➢ The variance is a measure of the dispersion, or variability in distribution.
➢ Mean of a Random Variable:

• where x = the value of the random variable and f(x) = the probability corresponding
to a particular x value. 17
Mean and Variance of a Random Variable

➢ Example 7 :
A lot containing 7 components is sampled by a quality inspector; the lot contains 4 good
components and 3 defective components. A sample of 3 is taken by the inspector.Find
the expected value of the number of good components in this sample.
Solution
Let X represent the number of good components in the sample. The probability
distribution of X isThe probability distribution of X is
4 3
𝑥 3−𝑥
𝑓 𝑥 = 7 , 𝑥 = 0,1,2,3
3
Simple calculations yield f(0) = 1/35, f(1) = 12/35, f(2) = 18/35, and f(3) = 4/35.
Therefore,
1 12 18 4 12
μ=𝐸 𝑥 = 0 + 1 + 2 + 3 = = 1.7.
35 35 35 35 7

Thus, if a sample of size 3 is selected at random over and over again from a lot of 4 good
components and 3 defective components, it will contain, on average, 1.7 good components. 18
Mean and Variance of a Random Variable

➢ Example 8 :
Let X be the random variable that denotes the life in hours of a certain electronic
device. The probability density function is
20,000
𝑓 𝑥 = ቐ 𝑥3 , 𝑥 > 100,
0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒.
Find the expected life of this type of device.

Solution:
∞ ∞ 20,000 ∞ 1
μ = E(𝑋) = ‫׬‬−∞ 𝑥 𝑓(𝑥) 𝑑𝑥 = ‫׬‬100 𝑥 𝑑𝑥 = 20,000 ‫׬‬100 𝑑𝑥 =
𝑥3 𝑥2

1
20,000[- ] = 200 (hours).
𝑥
100

Therefore, we can expect this type of device to last, on average, 200 hours.

19
Mean and Variance of a Random Variable

➢ Variance of a Random Variable:

σ = 𝜎2

20
Mean and Variance of a Random Variable

➢ Example 9:
Let X be a discrete random variable with the following probability distribution. Find
Var(X)
x 0 1 2 3
f(x) 0.51 0.38 0.10 0.01

Solution:
μ = σ3𝑥=0 𝑥 𝑓 𝑥 = (0)(0.51) + (1)(0.38) + (2)(0.10) + (3)(0.01) = 0.61.
𝜎 2 = E(X2 ) - μ2

= ෍ 𝑥 2 𝑓 𝑥 − 𝜇2
𝑥

E(X2 ) = σ𝑥 𝑥 2 𝑓 𝑥 = 0 0.51 + 1 0.38 + 4 0.10 + 9 0.01 = 0.87

𝜎 2 = 0.87 − (0.61)2 = 0.4979.

Standard Deviation (σ) = 𝝈𝟐 = 0.7056 21


Mean and Variance of a Random Variable

➢ Example 10 :
Let X be a continuous random variable with the following pdf, Find the mean and the
variance of X.

2(𝑥 − 1), 1 < 𝑥 < 2,


𝑓 𝑥 =ቊ
0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒.
Solution

𝜎 2 = E(X2 ) - μ2
2 5
μ = E(𝑋) = 2 ‫׬‬1 𝑥 𝑥 − 1 𝑑𝑥 =
3

2 17
E(𝑋 2 ) = 2 ‫׬‬1 𝑥 2 𝑥 − 1 𝑑𝑥 =
6
2
17 5 1
𝑉 𝑋 = 𝜎 2= 𝐸 𝑋 2 − 𝜇2 = − =
6 3 18

22
Mean and Variance of a Random Variable

➢ Example 10 :
Let X be a continuous random variable with the following pdf, Find the mean and the
variance of X.

2(𝑥 − 1), 1 < 𝑥 < 2,


𝑓 𝑥 =ቊ
0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒.
Solution

𝜎 2 = E(X2 ) - μ2
2 5
μ = E(𝑋) = 2 ‫׬‬1 𝑥 𝑥 − 1 𝑑𝑥 =
3

2 17
E(𝑋 2 ) = 2 ‫׬‬1 𝑥 2 𝑥 − 1 𝑑𝑥 =
6
2
17 5 1
𝑉 𝑋 = 𝜎 2= 𝐸 𝑋 2 − 𝜇2 = − =
6 3 18

22

You might also like