RV and Distributions
RV and Distributions
(basics)
Random Variables
• Period of a pendulum
.2 0.22
.1
the probability of any
single value = 0
0.00
interested in the
-5 5
probability assoc. w/
0
intervals
Independent events
• one event has no influence on the outcome
of another event
• if events A & B are independent
then P(A&B) = P(A)*P(B)
• if P(A&B) = P(A)*P(B)
then events A & B are independent
• coin flipping
if P(H) = P(T) = .5 then
P(HTHTH) = P(HHHHH) =
.5*.5*.5*.5*.5 = .55 = .03
Mutually Exclusive Events
• P(A|B)=Prob of A, given B
Bayes Theorem
P ( A B )
P( A | B)
P (B )
P (B A )
P (B | A )
P ( A)
P ( A | B )P (B ) P (B | A )P ( A )
P (B | A)P ( A)
P( A | B)
P (B )
Bayes Theorem
P (B | A)P ( A)
P( A | B)
P (B )
Since P ( B ) P ( B Ai ) P ( B | Ai ) P ( Ai )
i i
P (B | A)P ( A)
P( A | B)
P (B | Ai )P ( Ai )
i
Bayes’ Theorem
An email message can pass through one of the two server routes
Probability of Error
1 30 0.01 0.015
2 70 0.02 0.003
Ans-1
P(R1) = 0.30; P(R2) = 0.70; Calculate P(Er/R1) = (0.01+0.015) = 0.025------(1)
P(Error) = (0.
30* 0.025)+( 0.70* 0.023) = 0.0236 =>
Ans-2
P(Error/R1) = [P(R1) * P (Error/R1)]/ P(Error) = [(0.030* 0.025)/ 00236] = 0.6822
Assignment
The probability of the presence of an error in coding is
0.05.
•
NB
PDF/ PMF
PDF/ PMF
• Probability that an event occurs
– probability density function - continuous random variables or
– probability mass function - discrete random variables.
Definition
Probability Distributions and
Probability Density Functions
Definition
Cumulative Distribution Functions
Example
Cumulative Distribution Functions
• To find the probability of having four or less correct answers by random attempts, find with x = 0,…,4.
• (0, size=12, prob=0.2) +
(1, size=12, prob=0.2) +
(2, size=12, prob=0.2) +
(3, size=12, prob=0.2) +
(4, size=12, prob=0.2)
sum(np.random.binomial(12, 0.2, 20000) <= 4)/20000. # four or less correct
• 0.9274
The probability of four or less questions answered correctly by random in a twelve question multiple choice
quiz is 92.7%.
Poisson Distribution
Ex Problem
• If there are twelve cars crossing a bridge per minute on average, find the probability of having seventeen or
more cars crossing the bridge in a particular minute.
Solution
• The probability of having sixteen or less cars crossing the bridge in a particular minute is
0.89871
• Hence the probability of having seventeen or more cars crossing the bridge in a minute is in the upper tail of
the probability density function.
0.10129
Answer
• If there are twelve cars crossing a bridge per minute on average, the probability of having seventeen or more
cars crossing the bridge in a particular minute is 10.1%.
Expectation
• The mean or EV of a RV is defined using the PDF/PMF.
• A measure of central tendency of the distribution. If we observe many
values of the RV and take the average => expect that value to be close to
the mean.
• VARIANCE - DISCRETE RV
If a RV has a large variance, then an observed value of the RV is more likely to be far
from the mean μ.
or
Show that
Moments of a RV
• Other expected values of interest in statistics - moments of a RV.
• The expectation of powers of the RV.
Skewness
• The uniform and the normal distribution are examples of
symmetric distributions.
• The gamma and the exponential are examples of skewed or
asymmetric distributions.
• The 3rd central moment - a measure of asymmetry or
skewness in the distribution.
coefficient of skewness,
However, a coefficient of skewness equal to zero does not mean that the distribution must be
symmetric.
Symmetric vs. Skewed Data
• Median, mean and mode of symmetric, positively and negatively
skewed data
Definition
1/ (b-a), a≤x ≤b
f(x) =
0, otherwise
Continuous Uniform Random Variable
Example
Continuous Uniform Random Variable
The continuous random variable has the Normal distribution if the pdf is:
Normal Distribution
Appendix Table II
Example
Normal Distribution
Example (continued)
Normal Distribution
Example (continued)
1- exp(-λx), x≥0
F(x) =
0, elsewhere
Cdf
Exponential Distribution
• => the probability that the object will operate for time s+t, given it
has already operated for time s, is simply the probability that it
operates for time t.
Our starting point for observing the system does not matter.
Because we have already been waiting for 15 minutes, we feel that we are
“due.” …ie, we expect the probability of a vehicle arriving in the next 10
secs should be greater than 0.57.
Exponential Distribution
Example
Exponential Distribution
Example (continued)
Assignment
• Assume that the test scores of a college entrance exam fits a normal
distribution. Furthermore, the mean test score is 72, and the standard
deviation is 15.2. What is the percentage of students scoring 84 or
more in the exam? (0.21492)