5 Discrete RV

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 44

Discrete Random

Variables

McGraw-Hill/Irwin Copyright © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
4-1 of 21
Discrete Random Variables
4.1 Two Types of Random Variables
4.2 Discrete Probability Distributions
4.3 The Binomial Distribution
4.4 The Poisson Distribution

4-2 of 21
4.1 Random Variables
A random variable is a variable that assumes numerical
values that are determined by the outcome of an
experiment.
Random variable Values of the RV Description
X 0,1,2 No. of heads in 2 tosses
of a coin
Y 0,1,2,3 Poss Sale of newspaper
Z 0,1,2,3,4 No. of children in a
family
W 3.1,2.9,3,2.6 Wt of a newborn baby
X can take values 0, 1, and 2.
• We can also calculate the probability of X = 0 or X
= 1 or X = 2 and write down the probability
distribution.
4-3 of 21
Random Variables
• Discrete Random Variable
• Continuous Random Variable

Discrete random variable: If the RV is allowed to take on


only limited no. of values, it is called discrete.
They produce outcomes that come from a counting process
(e.g. number of classes you are taking).

Continuous random variable: If it is allowed to assume


any value within a given range, it is continuous. They are
usually measurements. For ex height, weight, content of
sugar in any food item, time, distance etc.

4-4 of 21
Probability Distributions
A probability distribution is a table, formula, or graph that
describes the values of a random variable and the probability
associated with these values.
Since we’re describing a random variable (which can be
discrete or continuous) we have two types of probability
distributions:
 Discrete Probability Distribution
 Continuous Probability Distribution

4-5 of 21
4.2 Discrete Probability Distributions

The probability distribution of a discrete random


variable is a table, graph, or formula that gives the listing
of the probabilities associated with each possible value
that the variable can assume such that:

4-6 of 21
Describing Probability Distributions:
Mean
The population mean is the weighted average of all of its
values. The weights are the probabilities.
This parameter is also called the expected value of X
and is represented by E(X).

4-7 of 21
Example
Number of Radios Sold at Sound City in a Week

x, Radios p(x), Probability


0 p(0) = 0.03
1 p(1) = 0.20
2 p(2) = 0.50
3 p(3) = 0.20
4 p(4) = 0.05
5 p(5) = 0.02

Find the expected no of radios sold in a week.

4-8 of 21
Expected Value of a Discrete Random
Variable

The mean or expected value of a discrete random variable is:

 X   xp( x )
All x

Example 4.4: Expected Number of Radios Sold in a Week


x, Radios p(x), Probability x p(x)
0 p(0) = 0.03 0(0.03) = 0.00
1 p(1) = 0.20 1(0.20) = 0.20
2 p(2) = 0.50 2(0.50) = 1.00
3 p(3) = 0.20 3(0.20) = 0.60
4 p(4) = 0.05 4(0.05) = 0.20
5 p(5) = 0.02 5(0.02) = 0.10
1.00 2.10

4-9 of 21
Variance and Standard Deviation

The variance of a discrete random variable is:

The standard deviation is the square root of the variance.

 X   X2

4-10 of 21
Example: Variance and Standard
Deviation
Example 4.7: Variance and Standard Deviation of the Number
of Radios Sold in a Week
x, Radios p(x), Probability (x - X)2 p(x)
0 p(0) = 0.03 (0 – 2.1)2 (0.03) =
0.1323
1 p(1) = 0.20 (1 – 2.1)2 (0.20) =
0.2420
2 p(2) = 0.50 (2 – 2.1)2 (0.50) =
0.0050
3 p(3) = 0.20 (3 – 2.1)2 (0.20) =
0.1620
4 Variance Standard deviation(4 – 2.1)2 (0.05) =
p(4) = 0.05
0.1805
2
X  0 . 89  X  0 . 89  0 . 9434 2
5 p(5) = 0.02 (5 – 2.1) (0.02) =
0.1682
1.00 4-11 of 21
Interpretation
A bar graph of the probability
function, with the mean and standard
deviation is shown.

Expected number of radios sold at


sound city in a week are 2.1 units

The SD of the number of radios sold at


sound city in a week is 0.94 units ie it
is approximately 0.94 away from mean
(2.1)

4-12 of 21
Example

4-13 of 21
4.3 The Binomial Distribution
Results from a bernoulli process
Tossing of a coin fixed no. of times is a Bernoulli Process
Outcome of such tosses is represented by Binomial Dis
The Binomial Experiment
1. A fixed number of trials, n
2. Each trial has 2 mutually exclusive outcomes: “success” or “failure”,
H or T, Yes or No
3. Probability of success, p, is constant from trial to trial
4. Trials are independent

If x = the total number of successes in n trials of a


binomial experiment, then x a binomial random
variable and the probability of x successes in n trials
is: n!
p(x) = p x q n -x
x! (n - x)!
4-14 of 21
Binomial Distribution: Example

• For example a coin flip will result in either heads or tails. If


we define “heads” as success then necessarily “tails” is
considered a failure (there is no value judgment implied).

• Flip a fair coin 10 times


1. Fixed number of trials: n=10
2. Each trial has two possible outcomes: {heads (success),
tails (failure)}
3. P(success) = 0.50; P(failure) = 1- 0.50 = 0.50.
4. The trials are independent (i.e. the outcome of heads on the
first flip will have no impact on subsequent coin flips).

• Hence flipping a coin ten times is a binomial experiment


since all conditions were met.

4-15 of 21
Example: Binomial Probabilities
Let x be the number of patients who will experience
nausea following treatment with Phe-Mycin. There are 4
patients and probability of success is 0.1. Find the
probability that 2 of the 4 patients treated will experience
nausea.

n = 4 , p = 0.1 , 1 – p = 1 - 0.1 = 0.9

4!
p(2)  P(x=2)= (0.1) 2 (0.9) 4-2 =6(0.1) 2 (0.9) 2 =0.0486
2!(4-2)!

4-16 of 21
Binomial Probability Formula

In a binomial experiment, the probability of exactly x


successes in n trials is
n!
P (x )  nC x p xq n  x  p xq n  x .
(n  x )!x !
Example:
A bag contains 10 chips. 3 of the chips are red, 5 of the chips are
white, and 2 of the chips are blue. Three chips are selected, with
replacement. Find the probability that you select exactly one red chip.
3
p = the probability of selecting a red chip  0.3
10
q = 1 – p = 0.7 P (1) 3C 1(0.3)1(0.7)2
n=3 3(0.3)(0.49)
x=1 0.441
Using Excel

Example: Binomial Distribution, n = 4, p = 0.1, x=2

1. In excel only less than probability can be calculated


2. =BINOM.DIST(number_s ,trials ,probability_s ,cumulative)

Number_s - The number of successes in trials.


Trials - The number of independent trials.
Probability_s - The probability of success on each trial.
Cumulative - A logical value that determines the form of the
Function….. True = cumulative probability
False = exact probability

=BINOM.DIST(2,4,0.1,FALSE) = 0.04860
4-18 of 21
Example: Binomial Distribution,
n = 4, p = 0.1

Using R
dbinom(x=2, size=4, prob= 0.1) = 0.0486

4-19 of 21
Binomial Probability Table
p = 0.1
Table 4.7(a) for n = 4 trials
values of p (.05 to .50)
x 0.05 0.1 0.15 … 0.50
0 0.8145 0.6561 0.5220 … 0.0625 4
1 0.1715 0.2916 0.3685 … 0.2500 3
2 0.0135 0.0486 0.0975 … 0.3750 2
3 0.0005 0.0036 0.0115 … 0.2500 1
4 0.0000 0.0001 0.0005 … 0.0625 0
0.95 0.9 0.85 … 0.50 x
values of p (.95 to .50)
P(x = 2)=.0486
4-20 of 21
Several Binomial Distributions
This distribution depends upon the values of p and n which are its
parameters. Regardless of the value of n, the distribution is
symmetrical when p=0.5
When p is small say 0.1 or 0.2, then it is skewed to the right ie
positively skewed.
When p is larger than 0.5 it is negatively skewed.

4-21 of 21
Mean and Variance of a Binomial
Random Variable

If x is a binomial random variable with parameters n and p,


then

Mean  X = np

2
Variance  x = npq , q 1 - p

Standard deviation  x =  x2

4-22 of 21
Example 1 : What is the probability of one success in
five observations if the probability of an event of
interest is 0.1?

Example 2 : Suppose the probability of purchasing a


defective computer is 0.02. What is the probability of
purchasing 2 defective computers in a group of 10? Find
the mean and variance of purchasing defective computers.

4-23 of 21
Examples
= BINOM.DIST(1,4,0.75,TRUE) 0.05078125
Poisson distribution
The Poisson distribution is based on the Poisson process.

1. The occurrences of the events are independent in an interval.

2. An infinite number of occurrences of the event are possible in


the interval.

3. The probability of a single event in the interval is proportional


to the length of the interval.
Poisson distribution
4. In an infinitely small portion of the interval, the probability of
more than one occurrence of the event is negligible.
Parameter of Poisson dis.
Note: A Poisson random variable can take on any positive integer value. In contrast,
the Binomial distribution always has a finite upper limit.
Several Poisson Distributions
Poisson distribution is defined by the parameter λ
and is positively skewed.

4-31 of 21
We observe that the Poisson distributions

1 are unimodal;
2 exhibit positive skew (that decreases as λ increases);
3 are centred roughly on λ;
4 have variance (spread) that increases as λ increases.

4-32 of 21
Example: Poisson Probabilities

Example
x = number of Cleveland air traffic control errors
during one week
= 0.4 (expected number of errors per week)
Find the probability that 3 errors will occur in a week.

e -0.4 ( 0 .4 ) 3
p(3)  P(x = 3) = = .0072
3!

4-33 of 21
Using Excel

Example: Poisson Distribution, Mean = 0.4/week, x=3

1. In excel only less than probability can be calculated


2. =POISSON.DIST(x, mean, cumulative)

X - The number of events.


Mean - The expected numeric value.
Cumulative - A logical value that determines the form of the
Function….. True = cumulative probability
False = exact probability

=POISSON.DIST(3,0.4,FALSE)= 0.00715

4-34 of 21
Poisson Probability Table
m=0.4
Table 4.9
m, Mean number of Occurrences
x 0.1 0.2 … 0.4 … 1.00
0 0.9048 0.8187 … 0.6703 … 0.3679
1 0.0905 0.1637 … 0.2681 … 0.3679
2 0.0045 0.0164 … 0.0536 … 0.1839
3 0.0002 0.0011 … 0.0072 … 0.0613
4 0.0000 0.0001 … 0.0007 … 0.0153
5 0.0000 0.0000 … 0.0001 … 0.0031

e -0.4 ( 0 .4 ) 3
p(3)  P(x = 3) = = 0.0072
3!
4-35 of 21
Poisson Distribution, λ = 0.4

4-36 of 21
Mean and Variance of a Poisson
Random Variable

If x is a Poisson random variable with parameter λ, then


Mean = λ
Variance = λ
Standard Deviation = λ

4-37 of 21
4-38 of 21
4-39 of 21
4-40 of 21
4-41 of 21
4-42 of 21
4-43 of 21
Discrete Random Variables
Summary:
4.1 Two Types of Random Variables
4.2 Discrete Probability Distributions
4.3 The Binomial Distribution
4.4 The Poisson Distribution

4-44 of 21

You might also like