Lecture_4 Random Variables and Probability Distributions
Lecture_4 Random Variables and Probability Distributions
Dr Emmanuel
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions 1 / 28
Outline
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions 2 / 28
Random Variables and Distributions Functions Random Variables
Random Variables
Definition
A random variable (RV) is a function that assigns a real number X (s) to
every element s ∈ S, where S is the sample space corresponding to a
random experiment E .
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions 3 / 28
Random Variables and Distributions Functions Random Variables
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions 4 / 28
Random Variables and Distributions Functions Random Variables
Probability Function
X = xi x1 x2 ··· xr ···
P(X = xi ) p1 p2 ··· pr ···
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions 5 / 28
Random Variables and Distributions Functions Random Variables
Example
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions 6 / 28
Random Variables and Distributions Functions Random Variables
Example: Ardhi Computer store sells a particular laptop, but has only
four in stock. The manager wonders what today’s demand for this
particular laptop will be. She learns from the marketing depart- ment that
the probability distribution for x, the daily demand for the laptop, is as
shown in the table. Find the mean, variance, and standard deviation of x.
x 0 1 2 3 4 5
P(x) 0.10 0.40 0.20 0.15 0.10 0.05
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions 7 / 28
Random Variables and Distributions Functions Random Variables
Solution:
P(X = x1 ) = p1 = (1 + 3x)/4; p2 = (1 − x)/4; p3 = (1 + 2x)/4;
p4 = (1 − 4x)/4
But p1 ≥ 1, if x ≥ − 13 ; p2 ≥ 0 if x ≤ 1; p3 ≥ 0, if x ≥ − 21 and p4 ≥ 0, if
x ≤ 14 .
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions 8 / 28
Random Variables and Distributions Functions Random Variables
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions 9 / 28
Random Variables and Distributions Functions Random Variables
Rb
3 P(a ≤ X ≤ b) = P(a < X < b) = a f (x)dx.
Note: When X is a continuous RV
Z a
P(X = a) = P(a ≤ X ≤ a) = f (x)dx = 0
a
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions10 / 28
Random Variables and Distributions Functions Cumulative Distribution Function (CDF)
and P(X = xi ) = F (xi ) − F (xi−1 ) where x1 < x2 < · · · < xi−1 < xi < · · · .
For continuous RV X ,
ZX
F (x) = P(−∞ < X ≤ x) = f (x)dx
−∞
d
and f (x) = dx F (x) at all points where F (x) is differentiable.
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions11 / 28
Random Variables and Distributions Functions Cumulative Distribution Function (CDF)
Z Z5
27
f (x)dx = 1 =⇒ k(1 + x)dx = 1 =⇒ k = 1 =⇒ k = 2/27.
2
R 2
Therefore,
Z4
2 16
P(X < 4) = P(2 < X < 4) = (1 + x)dx = .
27 27
2
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions12 / 28
Random Variables and Distributions Functions Special Probability distributions
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions13 / 28
Random Variables and Distributions Functions Special Probability distributions
1. Bernoulli Distribution
Consider an experiment that can result in one of two outcomes. One
outcome is labeled success and the other outcome is labeled failure.
Examples
1 A coin has probability 0.5 of landing heads when tossed. Let X = 1 if
the coin comes up heads, and X = 0 if the coin comes up tails. What
is the distribution of X ?
Solution
Since X = 1 when heads comes up, heads is the success outcome.
The success probability,P(X = 1), is equal to 0.5. Therefore
X ∼ Bernouli(0.5).
2 Ten percent of the components manufactured by a certain process are
2. Binomial Distribution
Let A be some event associated with a random experiment E , such that
P(A) = p and P(Ā) = 1 − p = q.
Example
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions17 / 28
Random Variables and Distributions Functions Special Probability distributions
Example: Out of 160 families with 4 children each, how many families
would be expected to have at least one boy?
Solution
Consider each child as a trial, n = 4, assume that birth of a boy is a
success, p = 12 and q = 12 . Let X denote the number of successes, then
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions18 / 28
Random Variables and Distributions Functions Special Probability distributions
3. Poisson Distribution
If X is a discrete RV that can assume the values 0, 1, 2, · · · , such that its
probability mass function is given by
e −λ λr
P(X = r ) = ; r = 0, 1, 2, · · · ; λ > 0,
r!
then X follows a Poisson probability distribution with parameter λ
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions19 / 28
Random Variables and Distributions Functions Special Probability distributions
Note:
1. The number of trials n is indefinitely large, i.e. n → ∞.
2. The constant probability of success n in each trial is small, i.e. p → 0.
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions20 / 28
Random Variables and Distributions Functions Special Probability distributions
Solution
Given p = 1/500, n = 10, x denotes the number of defective component
in one packet. λ = np = 0.02
e −λ λx e −0.02 (0.02)x
P(X = x) = =
x! x!
e −0.02 (0.02)0
P(X = 0) = = 0.9802.
0!
Hence the number of packets free from defective is
0.9802 × 10000 = 9802.
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions21 / 28
Random Variables and Distributions Functions Special Probability distributions
4. Geometric Distribution
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions22 / 28
Random Variables and Distributions Functions Special Probability distributions
Example
If the probability that an applicant for a driving license will pass the road
test on any given trial is 0.8, what is the probability that s/he will finally
pass the test on the fourth trial?
Solution
Let X denote the number of trials required to achieve the first success.
Then X follows a geometric distribution given by
P(X = r ) = q r −1 p; r = 1, 2, 3, · · · , ∞.
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions23 / 28
Random Variables and Distributions Functions Special Probability distributions
5. Uniform distribution
A continuous RV X is said to follow a uniform distribution in any finite
interval, if the probability density function is constant in that interval.
That is
1
f (x) = , where a < x < b.
b−a
Mean and variance of a uniform distribution U(a, b) are given by
1 1
E (X ) = (b + a) and var(X ) = (b − a)2 respectively.
2 12
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions24 / 28
Random Variables and Distributions Functions Special Probability distributions
Example
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions25 / 28
Random Variables and Distributions Functions Special Probability distributions
6. Exponential distribution
A continuous RV X is said to follow an exponential distribution with
parameter λ > 0, if its probability density function is given by
(
λe −λx x ≥0
f (x) =
0 otherwise.
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions27 / 28
Random Variables and Distributions Functions Special Probability distributions
Example
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions28 / 28