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

Lecture_4 Random Variables and Probability Distributions

The document provides an overview of random variables and probability distributions, including definitions and examples of discrete and continuous random variables. It discusses probability functions, cumulative distribution functions, and special probability distributions such as Bernoulli, Binomial, and Poisson distributions. The document also includes examples and calculations related to these concepts.

Uploaded by

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

Lecture_4 Random Variables and Probability Distributions

The document provides an overview of random variables and probability distributions, including definitions and examples of discrete and continuous random variables. It discusses probability functions, cumulative distribution functions, and special probability distributions such as Bernoulli, Binomial, and Poisson distributions. The document also includes examples and calculations related to these concepts.

Uploaded by

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

IS141: Probability and Statistics

Random Variables and Probability Distributions

Dr Emmanuel

Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions 1 / 28
Outline

1 Random Variables and Distributions Functions


Random Variables
Cumulative Distribution Function (CDF)
Special Probability distributions

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 .

Examples of random variables are:-


Number of defects on a randomly selected piece of furniture
Errors in experiments
Test score for a randomly selected college students
Number of traffic accidents
Number of customers arriving at a shop in per hour

Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions 3 / 28
Random Variables and Distributions Functions Random Variables

Discrete Random variable

If X is the random variable (RV) which can take a finite number or


countably infinite number of values, X is called a discrete RV. When the
RV is discrete, the possible values of X may be assumed as
x1 , x2 , · · · , xn , · · · .
In the finite case, the list of values terminates and in the countably infinite
case, the list goes up to infinity.

Remember that a set A is countable if either


A is a finite set such as 1,2,3,4 or
It can be put in one-to-one correspondence with natural numbers (in
this case the set is said to be countably infinite).

Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions 4 / 28
Random Variables and Distributions Functions Random Variables

Probability Function

If X is a discrete RV which can take values x1 , x2 , · · · , such that


P(X = x) = pi , then pi is called the probability function or probability
mass function provided that pi satisfies the following conditions
(i) pi ≥ 0 for all i
P
(ii) pi = 1
i
The collection of pairs {xi , pi }, i = 1, 2, 3, · · · is called the probability
distribution of RV X , which can sometimes be given in form of a table as

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

A piece of electronic equipment contains 6 computer chips, two of which


are defective. Three chips are randomly selected and inspected, and x, the
number of defective chips in the selection is recorded. Construct the
probability distribution for the RV x.

The mean/expected value and variance of the discrete random variable x


are given by
Xn
E (x) = µ = xi p(xi )
i=1
n
 X
2 2
(xi − µ)2 p(xi )

σ = E (x − µ) =
i=1

Note: The standard deviation σ of a random variable x is equal to the


positive square root of its variance.

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

Example: A random variable X may take 4 values with probabilities


(1 + 3x)/4, (1 − x)/4, (1 + 2x)/4 and (1 − 4x)/4. Find the condition on
x so that these values represent the probability function of X ?

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

If the given probabilities represent a probability function, each pi ≥ 0 and


P
pi = 1.
i

That means p1 + p2 + p3 + p4 = 1 for any x.

But p1 ≥ 1, if x ≥ − 13 ; p2 ≥ 0 if x ≤ 1; p3 ≥ 0, if x ≥ − 21 and p4 ≥ 0, if
x ≤ 14 .

Therefore, values of x on which probability function is defined lies in the


range −1/3 ≤ x ≤ 1/4.

Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions 8 / 28
Random Variables and Distributions Functions Random Variables

Continuous Random Variable

If a RV X takes all values (i.e. infinite number of values in an interval),


then X is called a continuous RV. For example
1 The height of people in a population
2 The speed of a bus
3 The concentration of a chemical in water sample
4 The measurement errors.

Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions 9 / 28
Random Variables and Distributions Functions Random Variables

Probability density function

If X is a continuous random variable then f (x) is called the probability


density function, provided that
1 f (x) ≥ 0
R∞
−∞ f (x)dx = 1
2

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)

Cumulative Distribution (CDF)

If X is a RV, discrete or continuous, then P(X ≤ x) is called the


cumulative distribution function denoted by F (x). For discrete RV X ,
X
F (x) = pi for Xi ≤ x
i

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)

Example: A continuous random variable X that can assume any value


between x = 2 and x = 5 has a density function given by
f (x) = K (1 + x). Find P(x ≤ 4).
Solution
By using property of pdf,

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

Special Probability Distributions

While constructing probabilistic models for observable phenomena, certain


probability distributions arise more frequently. We shall discuss both
discrete and continuous distributions.

Discrete probability distributions include Bernoulli, Binomial, Negative


binomial, Poisson, Geometric and Hypergeometric.

Continuous probability distributions include Uniform, Exponential, General


gamma, Weibull, Cauchy, student’s t and Normal/Gaussian.

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.

The probability of success is denoted by p. The probability of failure is


therefore 1 − p. Such a trial is called a Bernoulli trial with success
probability p.
Examples of a Bernoulli trials:
the selection of a component from a population of components, some
of which are defective. If we define “success” as a defective
component, then p is the proportion of defective components in the
population.
how many girls are born each day, so a girl birth is a success and a
boy birth is a failure.
The random variable X is said to have the Bernoulli distribution with
parameter p. The notation is X ∼ Bernoulli(p).
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions14 / 28
Random Variables and Distributions Functions Special Probability distributions

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

defective. A component is chosen at random. Let X = 1 if the


component is defective, and X = 0 otherwise. What is the
distribution of X ?
Solution
The success probability is p = P(X = 1) = 0.1. Therefore
X ∼ Bernoulli(0.1).
Mean and Variance of Bernoulli Random Variable
If X ∼ Bernoulli(p), then µX = p and σX2 = p(1 − p)
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions15 / 28
Random Variables and Distributions Functions Special Probability distributions

2. Binomial Distribution
Let A be some event associated with a random experiment E , such that
P(A) = p and P(Ā) = 1 − p = q.

Assuming that p remains the same for repetitions, if we consider n


independent repetitions (or trials) of E , and if the RV X , denotes the
number of times the event A has occurred, then X is called a binomial
random variable with parameters n and p.

The notation is X ∼ Bin(n, p), where X is a discrete random variable, and


its possible values are 0, 1, . . . , n.

The probability mass function of a binomial RV is given by


P(X = r ) = nCr p r q n−r ; r = 0, 1, 2, · · · , n where p + q = 1.
Binomial distribution is a legitimate probability distribution since
n
X n
X
P(X = r ) = nCr p r q n−r = (p + q)n = 1.
r =0 r =0
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions16 / 28
Random Variables and Distributions Functions Special Probability distributions

Example

A lot contains several thousand components, 10% of which are defective.


Seven components are sampled from the lot. Let X represent the number
of defective components in the sample. What is the distribution of X ?
Solution
Since the sample size is small compared to the population (i.e., less than
5%), the number of successes in the sample approximately follows a
binomial distribution. Therefore we model X with the Bin(7, 0.1)
distribution.

Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions17 / 28
Random Variables and Distributions Functions Special Probability distributions

The mean and variance of a binomial probability distribution are

E (X ) = np Var(X ) = npq respectively.

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

P(atleast one boy) = P(X ≥ 1) = P(X = 1) + P(X = 2) + P(X = 3) + P(X = 4)


 0  4
1 1
= 1 − P(X = 0) = 1 − 4C0 × ×
2 2
1 15
=1− = .
16 16
15
∴ Number of families having at least one boy = 160 × 16 = 150

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 λ

Poisson distribution is a legitimate probability distribution, since


∞ ∞
X X e −λ λr
P(X = r ) = = e −λ e λ = 1.
r!
r =0 r =0

The mean and variance of a Poisson distribution are

E (X ) = λ and Var(X ) = λ respectively.

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.

Example: In a component manufacturing industry, the probability for any


component to be defective is 1/500. The components are supplied in
packets of 10. Calculate the approximate number of packets containing no
defective in a consignment of 10000 packets.

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.

Some examples of Poisson distribution are:-


1 The number of defective screws per box of 100 screws
2 The number cars passing through a certain street in a time t
3 The emission of radioactive particles, etc

Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions21 / 28
Random Variables and Distributions Functions Special Probability distributions

4. Geometric Distribution

Let the RV X denote the number of trials of a random experiment


required to obtain the first success (occurrence of an event A). Obviously,
X can take values 1, 2, · · ·

Now X = r , if and only if the first (r − 1) trials result in failure (occurrence


in Ā) and the r th trial results in success (occurrence of A). Therefore,

P(X = r ) = q r −1 p; r = 1, 2, 3, · · · , ∞ with P(A) = p and P(Ā) = q.

The mean and variance of a geometric distribution are given by


1 q
E (X ) = var(X ) = respectively.
p p2

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, · · · , ∞.

Here p = 0.8 and q = 0.2. Thus,

P(X = 4) = 0.8 × (0.2)4−1 = 0.0064.

Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions23 / 28
Random Variables and Distributions Functions Special Probability distributions

Continuous Probability distribution

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

Example: If a string, 1m long is cut into two pieces at random point


along its length, what is the probability that the longer piece is at least
twice the length of the shorter piece?
Solution
Let C be the point of cut on AB such that AC = X . Since all positions of
C are equally likely, X is uniformly distributed over (0, 1),
∴ f (x) = 1.
If X represents the length of the longer piece, then C lies in MB.
P{longer piece length ≥ 2 × shorter piece length}
Z 1
= P{X ≥ 2(1 − X )} = P{X ≥ 2/3} = 1dx = 1/3.
2/3
If X represents the length of the shorter piece, then C lies in AM.
Therefore,
Z 1/3
P{(1 − X ) ≥ 2X } = P{X ≤ 1/3} = 1dx = 1/3.
0
Hence the required probability is 1/3.
Dr Emmanuel IS141: Probability and Statistics Random Variables and Probability Distributions26 / 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.

Mean and variance of the exponential distribution are given by


1 1
E (X ) = and var(X ) = .
λ λ2

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

You might also like