Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Unit 2 P&S

Download as pdf or txt
Download as pdf or txt
You are on page 1of 82

Probability & Statistics

E5, Section -1

Unit -2
Random Variables
Random Variables

• Events give us more flexibility in designing experiments compared to just focusing on the outcomes themselves. An event can
be anything, like "drawing a spade" or something numerical, like "the outcome is 3.”
• Now , we introduce a new concept that will allow events to be defined in a more consistent way, i.e. they will be numerical
always.
• In tossing dice, often interested in the sum of the two dice and are not really concerned about the values of the individual dice.
i.e. interested in knowing that the sum is 7 and not be concerned over whether the actual outcome was
(1, 6) or (2, 5) or (3, 4) or (4, 3) or (5, 2) or (6, 1).
• A civil engineer may not be directly concerned with the daily risings and declines of the water level of a reservoir (which we
can take as the experimental result) but may only care about the level at the end of a rainy season.
• These quantities of interest that are determined by the result of the experiment are known as random variables.
• We define a real random variable as a real function of the elements of a sample space S.
• Value of a random variable is determined by outcome of experiment
• Assign probabilities of its possible values.
Conditions for a Function to be a Random Variable

• First, the set (X ≤ x) shall be an event for any real number x.


The probability of this event, denoted by P(X ≤ x), is equal to the
sum of the probabilities of all the elementary events corresponding to (X ≤ x).

• The second condition we require is that the probabilities of the event (X=∞) and
(X = -∞) be 0:
P{X= -∞} =0 P{X= ∞ }=0
Random Variables and Distribution Functions

• Set of possible values can be written either as a finite sequence x1, . . . , xn, or as an infinite
sequence x1, . . . are said to be discrete.
• E.g. a random variable whose set of possible values is the set of nonnegative integers is a
discrete random variable.
• Random variables may take on a continuum of possible values continuous random variables.
• It is uncountable. E.g., random variable denoting the lifetime of a car, when the car’s lifetime is
assumed to take on any value in some interval (a, b).
• Cumulative distribution function, or distribution function, F of random
variable X for any real number x
F (x) = P{X ≤ x}
• F (x) is the probability that the random variable X takes on a value that is
less than or equal to x.
• The distribution function has some specific properties derived from the fact
that F(x) is a probability.
• F(- ∞ )= 0
• F(∞) = 1
• 0≤F(x)≤1
• F(x1) ≤ F(x2) if x1< x2
• P{x1≤ X ≤ x2} = F(x2) – F(x1)
• Suppose the random variable X has distribution function

• What is the probability that X exceeds 1?


• The desired probability is computed as follows:
P{X > 1} = 1 − P{X ≤ 1}
= 1 − F (1)
= e−1
= .368
Discrete Random Variable
• For a discrete random variable X , probability mass function p(a) of
X by f
p(a) = P{X = a}
• p(a) is positive for at most a countable number of values of a.
• If X must assume one of the values x1, x2, . . . , then p(xi) > 0, i = 1,
2, . . .
• p(x) = 0, all other values of x
• Since X must take on one of the values xi , we have
∑$!"# 𝑝(𝑥𝑖)=1
Cumulative Distribution Function

• Cumulative distribution function F in terms of p(x) by


• 𝐹 𝑥 = ∑%&& '(% 𝑝(𝑥)
• X a discrete random variable, set of possible values are x1, x2, x3, . . .,
where x1 < x2 < x3 <・ ・, then its distribution function F is a step
function.
• Value of F is constant in the intervals [xi−1, xi) and then takes a step (or
jump) of size p(xi) at xi.
Probability Density Function
• The probability density function, denoted by f(x), is defined as the derivative of the
distribution function.
• Random variables whose set of possible values is an interval - continuous random
variable
• X is a continuous random variable if there exists a nonnegative function f (x), defined
for all real x ∈ (−∞,∞), having the property that for any set B of real numbers.
• P {X ∈ B}=∫! 𝑓 𝑥 𝑑𝑥
• f (x) - probability density function X.
• Probability that X will be in B may be obtained by integrating the probability density
function over the set B.
Relationship between CDF and PDF

• The relationship is expressed:

• Differentiating both sides yields:


"
F a = f(a)
"$

• Probability density function is the derivative of the cumulative distribution function.


• Suppose that X is a continuous random variable whose probability density function is
given by
(a) What is the value of C?
(b) Find P{X > 1}.
Sol: (a) Since f is a probability density function
Special Random Variables
Binomial Random Variable
• A trial, or an experiment, whose outcome can be classified as either a “success” or as a “failure” is
performed.
• Let X = 1 when the outcome is a success and X = 0 when it is a failure,
• Probability mass function of X is given by
P{X = 0} = 1 − p
P{X = 1} = p
• n independent trials, each of which results in a “success” with probability p and in a “failure” with
probability 1 − p, are to be performed.
• If X represents the number of successes that occur in the n trials, then X is said to be a binomial
random variable with parameters (n, p).
• The probability mass function of a binomial random variable with parameters n and p is given by
Binomial Distribution
• The validity may be verified by first noting that the probability of any particular sequence of the n
outcomes containing i successes and n − i failures is, by the assumed independence of trials,
pi(1 − p)n−i

• There are nCi different sequences of the n outcomes leading to i successes and n − i failures
• By the binomial theorem, the probabilities sum to 1, that is,

• Since a binomial random variable X, with parameters n and p, represents the number of successes in n
independent trials, each having success probability p, we can represent X as follows:
Example 1

• It is known that disks produced by a certain company will be defective with


probability .01 independently of each other.The company sells the disks in
packages of 10 and offers a money-back guarantee that at most 1 of the
10 disks is defective.
• What proportion of packages is returned?
• If someone buys three packages, what is the probability that exactly one of
them will be returned?
Example 2
• The color of one’s eyes is determined by a single pair of genes, with the gene for
brown eyes being dominant over the one for blue eyes.
• This means that an individual having two blue-eyed genes will have blue eyes,
while one having either two brown-eyed genes or one brown-eyed and one blue-
eyed gene will have brown eyes.
• When two people mate, the resulting offspring receives one randomly chosen gene
from each of its parents’gene pair.
• If the eldest child of a pair of brown-eyed parents has blue eyes, what is the
probability that exactly two of the four other children (none of whom is a twin) of
this couple also have blue eyes?
Example 3

• A communications system consists of n components, each of which


will, independently, function with probability p.
• The total system will be able to operate effectively if at least one-half
of its components function.
(a) For what values of p is a 5-component system more likely to operate
effectively than a 3-component system?
(b) In general, when is a 2k + 1 component system better than a 2k − 1
component system?
Poisson Random Variable
• A random variable X, taking on one of the values 0, 1, 2, . . . , is said to be a
Poisson random variable with parameter λ, λ > 0, if its probability mass
function is given by,

!
)* *
𝑃 𝑋=𝑖 = 𝑒 !! , 𝑖 = 0,1, …
• Probability mass function
$ $
!
𝜆
0 𝑝 𝑖 = 𝑒 )* 0 = 𝑒 )* 𝑒 * = 1
𝑖!
!"- !"-

• A graph of this mass function when λ = 4


Poisson Distribution
• If n independent trials, each of which results in a “success” with probability p, are
performed, then when n is large and p small, the number of successes occurring is
approximately a Poisson random variable with mean λ = np.
• Some examples of random variables that usually obey, to a good approximation, the
Poisson probability law are:
• 1. The number of misprints on a page (or a group of pages) of a book.
• 2. The number of people in a community living to 100 years of age.
• 3. The number of wrong telephone numbers that are dialed in a day.
• 4. The number of transistors that fail on their first day of use.
• 5. The number of customers entering a post office on a given day.
• 6. The number of α-particles discharged in a fixed period of time from some
radioactive particle.
Example:
• Suppose that the average number of accidents occurring weekly on a
particular stretch of a highway equals 3. Calculate the probability that
there is at least one accident this week
Solution:
• Let X denote the number of accidents occurring on the stretch of highway in
question during this week.
• It is reasonable to suppose that there are a large number of cars passing along that
stretch, each having a small probability of being involved in an accident, the
number of such accidents should be approximately Poisson distributed.
• Hence,
• 𝑃 𝑋 ≥1 =1−𝑃 𝑋 =0
"
). .
=1− 𝑒
-!
).
=1 − 𝑒 ≈ 0.9502
Example:
• Suppose the probability that an item produced by a certain
machine will be defective is .1.Find the probability that a sample
of 10 items will contain at most one defective item.
• Assume that the quality of successive items is independent.
Solution:
Example:
• If the average number of claims handled daily by an insurance
company is 5, what proportion of days have less than 3 claims?
• What is the probability that there will be 4 claims in exactly 3 of the
next 5 days? Assume that the number of claims on different days is
independent.
Solution
• Probability that 3 of the next 5 days will have 4 claims is equal to

5
(0.1755)3(0.8245)2 ≈ 0.0367
3
Poisson Distribution
• Suppose that n independent trials are to be performed, with the ith trial resulting in a
success with probability pi , i = 1, . . . , n.
• Then it can be shown that if n is large and each pi is small, then the number of
successful trials is approximately Poisson distributed with mean equal to
Ni =1 /pi .
• In fact, this result will sometimes remain true even when the trials are not
independent, provided that their dependence is “weak.”
• The Poisson distribution possesses the reproductive property that the sum of
independent Poisson random variables is also a Poisson random variable.
• Let, X1 and X2 are independent Poisson random variables having respective means
λ1 and λ2. Then the moment generating function of X1 + X2 is as follows:
Example:
• It has been established that the number of defective stereos produced
daily at a certain plant is Poisson distributed with mean 4.
• Over a 2-day span, what is the probability that the number of defective
stereos does not exceed 3?
Solution:
• Assuming that X1, the number of defectives produced during the first day, is
independent of X2, the number produced during the second day, then X1 +X2 is
Poisson with mean 8. Hence,
Poisson Distribution Function

• If X is Poisson with mean λ, then


Gaussian Random Variable/Normal Random Variable
Example:
Solution:
Example:
• Given a random variable X having a normal distribution with μ =
50 and σ = 10, find the probability that X assumes a value
between 45 and 62.
Solution:
• The z values corresponding to x1 = 45 and x2 = 62 are

• P(45 <X< 62) = P(−0.5 <Z< 1.2). P(−0.5 <Z< 1.2)


This area may be found by subtracting the area to the left of the ordinate
z = −0.5 from the entire area to the left of z = 1.2.
• Using Table A.3, we have P(45 <X< 62) = P(−0.5 <Z< 1.2)
= P(Z < 1.2) − P(Z <−0.5)
= 0.8849 − 0.3085 = 0.5764.
Example:
• Given that X has a normal distribution with μ = 300 and σ = 50,
find the probability that X assumes a value greater than 362.
Solution:
Area under the Normal curve
• According to Chebyshev’s theorem, the probability that a random
variable assumes a value within 2 standard deviations of the mean is at
least 3/4.
• If the random variable has a normal distribution, the z values
corresponding to x1 = μ − 2σ and x2 =μ + 2σ are easily computed to
be

• Hence,
P(μ − 2σ < X < μ + 2σ) = P(-2 < Z < 2)
= P(Z < 2) − P(Z < −2)
= 0.9772 − 0.0228 = 0.9544
Example:
• Given a normal distribution with μ = 40 and σ = 6, find the value of x
that has
• (a) 45% of the area to the left and
• (b) 14% of the area to the right.
Solution:
• An area of 0.45 to the left of the desired x value is shaded in Figure (a).
• We require a z value that leaves an area of 0.45 to the left.
• From Table A.3 we find P(Z <−0.13) = 0.45, so the desired z value is−0.13.
• Hence, x = (6)(−0.13) + 40 = 39.22.
• In Figure (b), we shade an area equal to 0.14 to the right of the desired x
value.
• This time we require a z value that leaves 0.14 of the area to the right and
hence an area of 0.86 to the left.
• Again, from Table A.3, we find P(Z < 1.08) = 0.86, so the desired z value is
1.08 and x = (6)(1.08)+ 40 = 46.48.
Example:
• A certain type of storage battery lasts, on average, 3.0 years with a
standard deviation of 0.5 year. Assuming that battery life is normally
distributed, find the probability that a given battery will last less than
2.3 years.
Solution:
Example:
• A certain machine makes electrical resistors having a mean resistance
of 40 ohms and a standard deviation of 2 ohms.
• Assuming that the resistance follows a normal distribution and can be
measured to any degree of accuracy, what percentage of resistors will
have a resistance exceeding 43 ohms?
Solution:
Normal Approximation to the Binomial
• If X is a binomial random variable with mean μ= np and variance σ2 = npq,
then the limiting form of the distribution of
/)01
𝑍=
012

• as n→∞, is the standard normal distribution n(z; 0, 1).


• Normal distribution with μ= np and σ2 = np(1− p) provides a very accurate
approximation to the binomial distribution when
• n is large and p is not extremely close to 0 or 1
• provides a fairly good approximation even when n is small and p is
reasonably close to 1/2.
Example:
Example continued:

The exact probability that X assumes the value 4


Do it yourself
1. The probability that a patient recovers from a rare blood disease is
0.4. If 100 people are known to have contracted this disease, what is
the probability that fewer than 30 survive?

2. A multiple-choice quiz has 200 questions, each with 4 possible


answers of which only 1 is correct. What is the probability that sheer
guesswork yields from 25 to 30 correct answers for the 80 of the 200
problems about which the student has no knowledge?
Continuous Uniform Distribution
• characterized by a density function that is “flat,” and thus the probability is
uniform in a closed interval, say [A, B].
• The density function of the continuous uniform random variable X on the
interval [A, B] is

• The density function forms a rectangle with base B−A and constant height
1/𝐵−𝐴
• Also called the rectangular distribution
• interval may not always be closed: [A,B]. It can be (A,B) as well
Uniform Distribution – Mean and Variance

• The mean and variance of the uniform distribution are

3
𝐴+𝐵 3
𝐵−𝐴
𝜇= 𝑎𝑛𝑑 𝜎 =
2 12
Exponential Distribution
• A continuous random variable whose probability density function is given, for some λ >
0, by
𝜆𝑒 !"# , 𝑖𝑓 𝑥 ≥ 0
𝑓 𝑥 =%
0 , 𝑖𝑓 𝑥 < 0
• is said to be an exponential random variable (or, more simply, is said to be exponentially
distributed) with parameter λ. The cumulative distribution function F (x) of an
exponential random variable is given by
• 𝐹 𝑥 =𝑃 𝑋≤𝑥
"
=∫! 𝜆𝑒 #$% 𝑑𝑦
= 1 − 𝑒 !"# ,
• The exponential distribution often arises, in practice, as being the distribution of the amount of
time until some specific event occurs. For instance, the amount of time (starting from now) until an
earthquake occurs, or until a new war breaks out, or until a telephone call you receive turns out to
be a wrong number are all random variables that tend in practice to have exponential distributions
Example:
• Suppose that a number of miles that a car can run before its battery
wears out is exponentially distributed with an average value of 10,000
miles.If a person desires to take a 5,000-mile trip, what is the
probability that she will be able to complete her trip without having to
replace her car battery?
• What can be said when the distribution is not exponential?
Solution:
• It follows, by the memoryless property of the exponential distribution, that the
remaining lifetime (in thousands of miles) of the battery is exponential with
parameter λ = 1/10. Hence the desired probability is

• However, if the lifetime distribution F is not exponential, then the relevant


probability is

• where t is the number of miles that the battery had been in use prior to the start of
the trip. Therefore, if the distribution is not exponential, additional information is
needed (namely, t ) before the desired probability can be calculated.
Conditional Distribution and Density Function
• We know that for two events A and B where P(B)≠ 0,the conditional probability of A
given B had occurred was
4 5∩7
•𝑃 𝐴𝐵 = 4 7

• Conditional Distribution
• Let A be identified as the event {X ≤ x} for the random variable X. The resulting probability
P(X ≤ x | B) is defined as the conditional distribution function of X, which we denote Fx(x | B).
Thus,
Fx(x | B) = P(X ≤ x | B) =P(X ≤ x ∩ B)/P(B)
where we use the notation {X ≤ x ∩ B} to imply the joint event {X ≤ x} ∩ B. This joint event
consists of all outcomes s such that:
X(s) ≤ x and s ∈ B.
• The conditional distribution applies to discrete, continuous, or mixed random variables.
Properties of Conditional Distribution.
• All properties of Ordinary distribution implies to this as well
Conditional Density
• Conditional Density function of random variable X is defined as the
derivative of the conditional distribution function.
• We denote this density by fx(x|B) then

dFx(x|B)
fx(x|B)=
𝒅𝒙
Properties of Conditional Density
It satisfies the same properties as ordinary density function

You might also like