reviewch3 discrete random variables
TRANSCRIPT
1
241-460 Introduction to QueueingNetworks : Engineering Approach
Chapter 3 Discrete RandomChapter 3 Discrete Random Variables
Assoc. Prof. Thossaporn Kamolphiwong
Centre for Network Research (CNR)
Department of Computer Engineering, Faculty of Engineering
Prince of Songkla University ThailandPrince of Songkla University, ThailandEmail : [email protected]
Outline
• Random variables• Types of Random variables• Types of Random variablesDiscrete Random variablesContinuous Random variables
• Probability Mass function (PMF)
Chapter 3 : Discrete Random Variables
2
Random Variables
• Outcome of random experiment need not be a numbernumber
• However, interested in measurement numerical attribute of outcome.Total number of headsExecution time of job
• Outcome are random measurement will be• Outcome are random measurement will be random (random variable)
Chapter 3 : Discrete Random Variables
Definitions
Random variable X is a function that assigns a real
number X() to each outcome in the samplenumber ,X(), to each outcome in the sample
space of a random experiment.
Outcomes
Random VariableX()= x = 2
S
Chapter 3 : Discrete Random Variables
0 1 2-1-2
SX
Sx = {-2, -1,0, 1,2}
3
Name of random variable
Name of random variable :uses Capital letter,X
X can be a set of possible valuesSX : range of random variable XSY : range of random variable Y
Chapter 3 : Discrete Random Variables
Example
Coin is tossed three times and the sequence of heads and tails is noted.
Let X : the number of heads in three coin tosses.
S = {HHH, HHT, HTH, HTT, THH, THT, TTH, TTT}.
: HHH, HHT, HTH, HTT, THH, THT, TTH, TTT , , , , , , ,X() : 3 2 2 1 2 1 1 0
Sx = {0, 1, 2, 3}
Chapter 3 : Discrete Random Variables
4
Types of Random Variables
Two types of Random Variables• Discrete random variableX is a discrete random variable if the range of X is
countableSX = {x0, x1, x2,…}
X is a finite random variable if all values with nonzero probability are in the finite setp y
SX = {x0, x1, x2,…,xn}
• Continuous random variable
Chapter 3 : Discrete Random Variables
Probability Mass Function
• Probability mass function (PMF) is a function that gives the probability that a discretefunction that gives the probability that a discreterandom variable is exactly equal to some value.
Chapter 3 : Discrete Random Variables
5
Probability Mass Function
• DefinitionThe probability mass function (PMF) of theThe probability mass function (PMF) of the
discrete random variable X is
Random variable X
fX (x) = P[ X() = x ]
Chapter 3 : Discrete Random Variables
Event of all outcome in S
PMF of random variable X
PMF Example
Observe three calls at a telephone switch where voice call (v) and data calls (d) are equally likely.voice call (v) and data calls (d) are equally likely. Let X denote the number of voice calls, Y the number of data calls and the corresponding values of the random variables X, Y
ddd ddv dvd dvv vdd vdv vvd vvv
1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8
Outcomes()
P[]
Chapter 3 : Discrete Random Variables
1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8
0 1 1 2 1 2 2 3
P[]
X
3 2 2 1 2 1 1 0Y
6
(Continue)
ddd ddv dvd dvv vdd vdv vvd vvvOutcomes()
1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8P[]
• Find PMF of random variable X
1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8P[]
0 1 1 2 1 2 2 3X
SX = { 0, 1, 2, 3 }
fX(x) = P[X() = x ] = ??
Chapter 3 : Discrete Random Variables
(Continue)
ddd ddv dvd dvv vdd vdv vvd vvvOutcomes()
1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8P[]
f (1) = P[X() = 1]
1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8P[]
0 1 1 2 1 2 2 3X
X denote the number of voice calls,
Chapter 3 : Discrete Random Variables
fX(1) P[X() 1]
7
(Continue)
ddd ddv dvd dvv vdd vdv vvd vvvOutcomes()
P[] 1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8
fX(0) = P[X(ddd) = 0] = P[X = 0] = 1/8
fX(1) = P[X(ddv) = 1] + P[X(dvd) = 1] + P[X(vdd) = 1]
= P[X = 1] = 1/8 + 1/8 + 1/8 =3/8
P[]
X
1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8
0 1 1 2 1 2 2 3
fX(2) = P[X(dvv) = 2] + P[X(vdv) = 2] + P[X(vvd) = 2]
= P[X = 2] = 1/8 + 1/8 + 1/8 =3/8
fX(3) = P[X(vvv) = 3] = P[X = 3] = 1/8
Chapter 3 : Discrete Random Variables
(Continue)
• PMF of random variable X
x
x
x
x
xfX
3
2
1
0
8/1
8/3
8/3
8/1
Chapter 3 : Discrete Random Variables
otherwise0
8
(Continue)
• Find PMF of Y
P[Y=0] = P[{vvv}] = 1/8[ ] [{ }]
P[Y=1] = P[{dvv}]+P[{vdv}]+P[vvd}] = 1/8 + 1/8 + 1/8 = 3/8
P[Y=2] = P[{ddv}]+P[{dvd}]+P[{vdd}]= 1/8 + 1/8 + 1/8 = 3/8
P[Y=3] = P[{ddd}] = 1/8
Probability Mass Function
0.4
Y PY(y)
0 1/8
Chapter 3 : Discrete Random Variables
0
0.1
0.2
0.3
0 1 2 3
f Y(y
)
y
1 3/8
2 3/8
3 1/8
Properties of PMF
• For any x, fX(x) > 0
• xSx fX(x) = 1
• For any event B SX, the probability that X is
in the set B is Probability Mass Function
0 4
P[B] = fX(x)
Chapter 3 : Discrete Random Variables
00.10.20.30.4
0 1 2 3
f X(x
)
XxB
9
Cumulative distribution function
• Definition
Cumulative distribution function (CDF) of a randomCumulative distribution function (CDF) of a random variable X is defined as the probability of the event {X < x}:
FX(x) = P[X < x]
Probability Mass Function
0.10.20.30.4
f X(x
)
Chapter 3 : Discrete Random Variables
X( ) [ ]0
0 1 2 3X
FX(2) = P[X < 2]
Example
Find CDF of Y
ddd ddv dvd dvv vdd vdv vvd vvvOutcomes()
P[]
Y
1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8
3 2 2 1 2 1 1 0
Y PY(y)
0 1/8
Probability Mass Function
0.4
Chapter 3 : Discrete Random Variables
1 3/8
2 3/8
3 1/80
0.1
0.2
0.3
0 1 2 3
f Y(y
)
y
10
(Continue)
F[Y=0] = fY(0) = 1/8
F[Y=1] = f (0) + f (1) = 1/8 + 3/8 =4/8 = 1/2
Y PY(y)
0 1/8
1 3/8
2 3/8
3 1/8F[Y=1] = fY(0) + fY(1) = 1/8 + 3/8 =4/8 = 1/2
F[Y=2] = fY(0) + fY(1) + fY(2) = 1/8 + 3/8 + 3/8 = 7/8
F[Y=3] = fY(0)+fY(1)+fY(2)+fY(3)=1/8+3/8+3/8 +1/8 = 1
Cumulative Distribution Function
0 75
1Y FY(y)
0 1/8
Chapter 3 : Discrete Random Variables
0
0.25
0.5
0.75
0 1 2 3No. of data calls
FY(y
)
y
0 1/8
1 1/2
2 7/8
3 1
Compare : PMF & CDF
• Probability Mass Function• Cumulative Distribution FunctionDistribution FunctionCumulative Distribution Function
0
0.25
0.5
0.75
1
0 1 2 3No. of data calls
FY(y
)
y
Probability Mass Function
0
0.1
0.2
0.3
0.4
0 1 2 3No. of data calls
f Y(y
)
y
Chapter 3 : Discrete Random Variables
y 0 1 2 3
fY(y) 1/8 3/8 3/8 1/8
y 0 1 2 3
FY(y) 1/8 1/2 7/8 1
11
Properties of CDF
• 0 < FX (x) < 1
•
•
0)()(lim XX
xFxF
1)(lim XX
xFxF
Chapter 3 : Discrete Random Variables
Properties of CDF (2)
• FX(x) is a nondecreasing function of x, that is, if a < b, then FX (a) < FX (b)b, then FX (a) FX (b)
Let
a = 1,
b = 3
Cumulative Distribution Function
0
0.25
0.5
0.75
1
0 1 2 3
FX(x
)
x
FX (1) < FX (3)
Chapter 3 : Discrete Random Variables
No. of data calls
12
Properties of CDF (3)
• For all a < b, then FX (b) - FX (a) = P[a < X < b]
Cumulative Distribution Function
0
0.25
0.5
0.75
1
0 1 2 3No. of voice calls
FX(x
)
x
Probability Mass Function
0
0.1
0.2
0.3
0.4
0 1 2 3No. of voice calls
f X(x
)
x
Let a = 1, b = 3
FX (3) - FX (1) = P[1 < X < 3]
Chapter 3 : Discrete Random Variables
Properties of CDF (3)
• P[X > x] = 1 - FX(x)
Cumulative Distribution Function
0
0.25
0.5
0.75
1
0 1 2 3
FX(x
)
x
Probability Mass Function
0
0.1
0.2
0.3
0.4
0 1 2 3No. of voice calls
f X(x
)
x
Chapter 3 : Discrete Random Variables
No. of voice calls
FX(2) = 7/8
13
Example
Consider choosing a child family at random and looking at the sexes of the children from firstlooking at the sexes of the children from first born to last born. They will stop when they have a child of each sex, or stop when they have 3 children. Let X denote the number of girls.
• Find the PMF of XFind the PMF of X
• Find the CDF of X
Chapter 3 : Discrete Random Variables
Solution
S = {GGG, GGB, GB, BG, BBG, BBB}
S = {3 2 1 0}SX = {3, 2, 1, 0}
• Probabilities of OutcomesA three child family
S = {GGG,GGB,GBG,BGG,GBB,BGB,BBG,BBB}S {GGG,GGB,GBG,BGG,GBB,BGB,BBG,BBB}
P{} =1/8A two child family
S = {GG, GB, BG, BB} P{} =1/4
Chapter 3 : Discrete Random Variables
14
(Continue)
P[{GGG}] = P[{BBB}] = 1/8
P[{BBG}] = P[{GGB}] = 1/8P[{BBG}] = P[{GGB}] = 1/8
P[{GB}] = P[{BG}] = ¼
Find PMF of X
P[X = 0] = P[{BBB}] = 1/8
P[X = 1] = P[{BBG}] +P[{GB}] + P[{BG}]
= 1/8 + ¼ + ¼ = 5/8
P[X = 2] = P[{GGB}] = 1/8
P[X = 3] = P[{GGG}] = 1/8
Chapter 3 : Discrete Random Variables
(Continue)
• Find CDF of X
P[X < 0] = P[X = 0] = 1/8
P[X < 1] = P[X = 0] + P[X = 1]
= 1/8 + 5/8 = 6/8 = 3/4
P[X < 2] = P[X = 0] + P[X = 1] + P[X = 2]
= 1/8 + 5/8 + 1/8 = 7/8
P[X < 3] = P[X = 0] + P[X = 1] + P[X = 2] + P[X = 3]
= 1/8 + 5/8 + 1/8 + 1/8 = 1
Chapter 3 : Discrete Random Variables
15
(Continue)
PMF f X CDF f X
2
1
0
8/1
8/5
8/1
x
x
x
xf X
2
1
0
8/7
4/3
8/1
x
x
x
xFX
PMF of X CDF of X
Chapter 3 : Discrete Random Variables
38/1 x 31 x
(Continue)
Cumulative DistributionFunction
Probability Mass FunctionFunction
0
0.25
0.5
0.75
1
0 1 2 3No. of data calls
FX(x
)
x00 1 2 3
No. of data calls
f X(x
)
x
0.25
0.5
0.75
1
Chapter 3 : Discrete Random Variables
x 0 1 2 3
fX(x) 1/8 5/8 1/8 1/8
x 0 1 2 3
FX(x) 1/8 3/4 7/8 1
16
Some important Discrete Random Variable
Discrete Random Variables• Bernoulli Random Variable• Bernoulli Random Variable• Binomial Random Variable• Pascal Random Variable• Geometric Random Variable• Poisson Random Variable
Chapter 3 : Discrete Random Variables
Bernoulli Random Variable
• Definition
A : an event relate to outcomes of random experimentA : an event relate to outcomes of random experiment
XA : Random variable,
XA is called Bernoulli random variable if
success in if
fail in not if
1
0
A
AX A
SX = {0, 1}
Chapter 3 : Discrete Random Variables
otherwise0
1
01
p
p
PX
where 0 < p <1P[A] = p : probability of
“success”
17
Bernoulli RV Example
Suppose you test one circuit. With probability p, the circuit is rejected. Let X be the number ofthe circuit is rejected. Let X be the number of rejected circuits in one test. What is PX(x)?
Sol There are two outcomes,X = 1 with probability p andX = 0 with probability 1-p
Chapter 3 : Discrete Random Variables
otherwise0
1
01
xp
xp
xf X
Bernoulli Random Variable
• If there is a 0.2 probability of a reject, then 080 x
otherwise0
12.0
08.0
x
x
xXPxf X
PMF of Bernoulli RV
1
x)
Chapter 3 : Discrete Random Variables
f X(x
)
0
0.5
0 1x
f X(x
18
Binomial Random variable
Binomial Experiment
Th i t i t f f• The experiment consists of a sequence of ntrials, where n is fixed in advance of the experiment.
• The trials are identical, and each trial can result in one of the same two possible outcomes,
hi h d t d b (S) f il (F)which are denoted by success (S) or failure (F).• The trials are independent.• The probability of success is constant from trial
to trial: denoted by p.Chapter 3 : Discrete Random Variables
Binomial Random variable
Binomial random variable
Gi bi i l i t i ti f• Given a binomial experiment consisting of ntrials
• Let X = the number of S’s among n trials
SX = {0,1,2,…, n}X is binomial rv if the PMF of X has the formX is binomial rv if the PMF of X has the form
Chapter 3 : Discrete Random Variables
nkppk
nkXP knk ..., 0,for 1
19
Binomial RV Example
Suppose you test 24 circuits and you find k rejects. With probability p = 0.2, the circuit is rejected.With probability p 0.2, the circuit is rejected.
Let X be the number of rejected circuits in one test. What is PMF of X?
Sx = {0, 1, 2, …, 24}
Chapter 3 : Discrete Random Variables
24 ..., 0,for 8.02.024 24
k
kkXP kk
PMF of Binomial RV
0.15
0.2
n = 24 p = 0 2Probability mass
0.15
0.2
n = 24, p = 0.5
0
0.05
0.1
1 3 5 7 9 11 13 15 17 19 21 23 25
n 24, p 0.2
function of binomial random variable
P[X k] is maximum at
Chapter 3 : Discrete Random Variables
0
0.05
0.1
1 3 5 7 9 11 13 15 17 19 21 23 25
P[X=k] is maximum at kmax = (n+1)p
20
Example
Transmitting binary digits through a communication channel, the number of digitscommunication channel, the number of digits received correctly, Cn, out of n transmitted digits. Find
The probability of exactly i errors Pe[i]
The probability of an error-free transmission
Chapter 3 : Discrete Random Variables
Solution
p : probability of success to transmit binary digitE : # of digits received erroneouslyE : # of digits received erroneously
The probability of exactly i errors Pe[i]
Th b bilit f f t i i
nippi
niEP iin
e ..., 0,for 1
The probability of an error-free transmission
Chapter 3 : Discrete Random Variables
nne pp
nEP
00
21
Example
• Suppose that student guesses on each question of a multiple-choice quiz. If each question hasof a multiple choice quiz. If each question has four different choices, find the probability that student gets one or more correct answers on a 10-item quiz.
Chapter 3 : Discrete Random Variables
Solution
• Let X = the correct number of answers
• each question has four different choices then p• each question has four different choices, then p= 0.25
• PMF of X is
10
where x = 0, 1, 2, …, 10
Chapter 3 : Discrete Random Variables
xx
xxXP
1025.0125.0
10
22
(Continue)
• The probability of at least one correct answer is
P(X ≥ 1) = 1 - P(X=0)
056.075.025.00
100 100
XP
P(X ≥ 1) = 1 - 0.056 = .944
Chapter 3 : Discrete Random Variables
Example
• Suppose that student guesses on each question of a multiple-choice quiz. If the quiz consists ofof a multiple choice quiz. If the quiz consists of three questions, question 1 has 3 possible answers, question two has 4 possible answers, and question 3 has 5 possible answers, find the probability that student gets one or more correct answers.
Chapter 3 : Discrete Random Variables
23
Solution
• Let X = the correct number of answersX is not binomial !X is not binomial !Xi is the number of correct answers on question i
X = X1 + X2 +X3
(note that the only possible values for Xi are 0 and 1, with 0 representing an incorrect answer and 1representing a correct answer)
Chapter 3 : Discrete Random Variables
(Continue)
• Since each Xi are independent, the probability of at least one correct answer isat least one correct answer is
P(X ≥ 1) = 1 - P(X=0)
= 1 – [P(X1 = 0)P(X2 = 0)P(X3 = 0)]
= 1 – (⅔)(3/4)(4/5)
Chapter 3 : Discrete Random Variables
24
Pascal Random Variable
• The experiment consists of a sequence of independent trials.independent trials.
• Each trial can result in a success (S) or a failure (F).
• The experiment continues until a total of ksuccesses have been observed, where k is a specified positive integerspecified positive integer.
• The probability of success is constant from trial to trial: denoted by p.
Chapter 3 : Discrete Random Variables
Pascal Random Variable
The PMF of the Pascal r.v. X = number of trials until we observe the kth success, withuntil we observe the k success, withparameters k = number of successes, is
kxk ppk
xxXP
11
1
where x = k, k + 1, k + 2,…
Chapter 3 : Discrete Random Variables
25
Binomial & Pascal
Pascal : test circuit until find k successes.
Binomial : test n circuit, find k successes.
Chapter 3 : Discrete Random Variables
Pascal RV Example
• If there is a 0.2 probability of a reject and we seek four detective circuits, the random variableseek four detective circuits, the random variable L is the number of tests necessary to find the four circuits.
44 8.02.03
1][
ll
lLP
PMF of Pascal RV
0 04
0.06
Chapter 3 : Discrete Random Variables
3
][
0
0.02
0.04
0 10 20 30 40l
f L(l
)
l = 4, 5, …
26
Geometric Random Variable
• The experiment consists of a sequence of independent trials.independent trials.
• Each trial can result in a success (S) or a failure (F).
• The experiment continues until first success.• Probability of success, p, is the same for each
bobservation
Chapter 3 : Discrete Random Variables
Geometric Random Variable
X : the number of independent Bernoulli trials
until the first occurrence of a successuntil the first occurrence of a successX is called geometric random variable if the PMF of
X has form
xpp x 211 1
fail
Chapter 3 : Discrete Random Variables
otherwise
xppxXP
,...2,1
0
1][
27
PMF of Geometric RV
0.3
0.4
0.5
0
0.1
0.2
0.3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
p = 0.5
0.4
Probability mass function of thegeometric random variable
Chapter 3 : Discrete Random Variables
0
0.1
0.2
0.3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
p = 0.3
CDF of Geometric RV
• The CDF of X evaluated at integer values can be shown i j 1shown
k
j
jpqkXP1
1
1
0
k
i
iqp
i = j -1
k k
i qq
1
1
1
,Where q = 1 - p
Chapter 3 : Discrete Random Variables
kk
qpkXP
11
1
i q
q0 1
28
Modified Geometric RV
• Interested X' = X -1, the number of failure before a success occurssuccess occurs
• Modified geometric rv : Defined as total no. of failed trials before first success., X= X' + 1. Then X' is a modified geometric random variable with PMF:
P[X' = k] = P[X - 1 = k] = P[X = k + 1]
= (1-p)kp ,k = 0,1,2,…
Chapter 3 : Discrete Random Variables
Geometric Random Variable
• Geometric distribution is the only discrete
distribution that satisfies MEMORYLESS
property.
• Future outcomes are independent of the past
eventsevents.
Chapter 3 : Discrete Random Variables
29
Memoryless property
• LetX : # of trials up to the first successp j : # of all failures k : additional trials up to the first success,
X = j + k
F il i lX
Chapter 3 : Discrete Random Variables
First successkj
Fail trial
Memoryless property
“Memoryless property:”
• If a success has not occurred in the first j trials, then the probability of having to perform at least k more trials is the same as the probability of initially having
1, allfor | kjkXPjXjkXP
to perform at least k trials
• Thus, each time a failure, the system “forgets” and begin a new as if it were performing the first trial
Chapter 3 : Discrete Random Variables
30
Example
In a test of integrated circuits there is a probability p = 0.2 that each circuit is rejected. Let Y equalp 0.2 that each circuit is rejected. Let Y equal the number of tests up to and including the first test that discovers a reject.
What is the PMF of Y?
Chapter 3 : Discrete Random Variables
Solution
Let a : accepted circuit, r : reject circuitY = 1r r rY = 2 Y = 3
P[Y=1] = p,
p
a1- p
p
a1- p a1- p
p
P[Y=2] = p(1-p),
P[Y=3] = p(1-p)2
Chapter 3 : Discrete Random Variables
31
(Continue)
• p = 0.2
yy 218020 1
otherwise
yppyYP
y ,...2,1
0
1][
1
Chapter 3 : Discrete Random Variables
otherwise
yyYP
y ,...2,1
0
8.02.0][
PMF of Geometric RV
otherwise0
,...2,18.02.0 1 yyf
y
Y
PMF of Geometric RV
0 1
0.2
Y(y
)
otherwise0
Chapter 3 : Discrete Random Variables
0
0.1
0 10 20Y
f Y
32
Geometric and Pascal Distributions
• Let X1, X2, … Xn, … (independent and identically distributed)distributed)
1 2 3 4 5 6 7 8 9 10 11 12
X1 X2 X3
X = X1 + X2 + X3
Trials
• Pascal random variable represented as a sum of geometric random variables.
Chapter 3 : Discrete Random Variables
: Indicates a trial that results in a “success”
Poisson Random Variable
• Interested in counting the number of occurrences (N) of an event in a certain timeoccurrences (N) of an event in a certain time period or in a certain region in space
• The PMF for Poisson random variable is given by
...,2,1,0 !
kek
kNPk
where is the average number of event occurrences in a specified time interval
Chapter 3 : Discrete Random Variables
33
PMF of Poisson RV
Probability mass function of Poisson0.3
0.4
0.5
= 0.75 function of Poisson random variable
0
0.1
0.2
1 3 5 7 9 11 13 15 17 19 21 23
0 15
0.2
0.25
3
0.1
0.15 = 9
Chapter 3 : Discrete Random Variables
0
0.05
0.1
0.15
1 2 3 4 5 6 7 8 9 1011 12 131415 1617 181920 212223 24
= 3
0
0.05
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
Poisson RV in physical situations
• Sequence of Bernoulli trials take place in time• Condition hold• Condition holdOne event can occur in subintervalOutcome in different subintervals are
independentProbability of an event occurrence in subinterval
is p = /n is average number of eventsis p /n, is average number of events observed in T –second interval
Chapter 3 : Discrete Random Variables
34
(Continue)
t
Event occurrences in n subintervals of [0,T]
M : # of trials until the occurrences of an event is a geometric random variable with p = /n
0 Tt
Chapter 3 : Discrete Random Variables
0 Tt
MT/n
Poisson RV Example
Requests for telephone connections arrive at a telephone switching office at a rate of calls per second. It is known that the number of requests in a time period is a Poisson random variable.
Find the probability that there are no call requests in t second.
Fi d th b bilit th t thFind the probability that there are n or more requests.
Chapter 3 : Discrete Random Variables
35
Solution
• The average number of call requests in a t-second period is = t.second period is t.
• N(t) : the number of requests in t second a Poisson random variable with = t.
• PMF of Poisson random variable is given by
k
Chapter 3 : Discrete Random Variables
ek
ktNP!
Solution
• Probability that there are no call requests in tsecondsseconds
• Probability that there are n or more requests
tt eet
tNP !0
00
P[N(t) > n]
Chapter 3 : Discrete Random Variables
1
0 !1
n
k
tk
ek
t
= 1 - P[N(t) < n]
36
Poisson RV Example
The number of hits at a Web site in any time interval is a Poisson random variable. Ainterval is a Poisson random variable. A particular site has on average = 2 hits per second.
What is the probability that there are no hits in an interval of 0.25 seconds?
What is the probability that there are no moreWhat is the probability that there are no more than two hits in an interval of one second?
Chapter 3 : Discrete Random Variables
(Continue)
• H : number of hits at a Web site in any time intervalinterval
• average = 2 hits per second.
• = T = (2 hits/s) x (t) = 0.5t hits
210!50 5.0 hhet th
Chapter 3 : Discrete Random Variables
otherwise0
,...2,1,0!5.0 hhethtHP
37
Solution
• What is the probability that there are no hits in an interval of 0.25 seconds?an interval of 0.25 seconds?
= T = (2 hits/s) x (0.25s) = 0.5 hits
The PMF of no hits is
P[H=0]=fH(0) = 0.50e-0.5/0! = 0.607
Chapter 3 : Discrete Random Variables
Solution
• What is the probability that there are no more than two hits in an interval of one second?than two hits in an interval of one second?
In an interval of 1 second,= T = (2 hits/s) x (1s) = 2 hits.The PMF of H is
Chapter 3 : Discrete Random Variables
otherwise0
,...2,1,0!12 2 hhehf
h
H
38
Solution
{H < 2} = {H = 0} {H = 1} {H = 2}
P[H < 2] = P[H = 0] + P[H = 1] + P[H = 2]
= PH(0) + PH(1) + PH(2)
= e-2 + 21e-2 /1! + 22e-2/2! = 0.677
Chapter 3 : Discrete Random Variables
Poisson RV Example
The number of database queries processed by a computer in any 10-second interval is a Poissoncomputer in any 10 second interval is a Poisson random variable, K, with = 5 queries.
(a) What is the probability that there will be no queries processed in a 10-second interval?
(b) What is the probability that at least two queries will be processed in a 2-second interval?
Chapter 3 : Discrete Random Variables
39
Solution
The PMF is5k
(a) The probability that there will be no queries processed in a 10-second interval is
,...2,1,0 !
5 5
kk
ekf
k
K
Chapter 3 : Discrete Random Variables
50 ef K
Solution
(b) = T, = 5, T = 10 = 0.5 queries/second
N : number of queries processed in a 2-second interval, = 2 = 1
Therefore
,...2,1,0 !1 nnenf N
Therefore,
P[N ≥ 2] = 1 – PN(0) – PN(1) = 1 – e-1 – e-1 = 0.264
Chapter 3 : Discrete Random Variables
40
Example
Calls arrive at random times at a telephone switching office with an average of = 0.25switching office with an average of 0.25 calls/second. What is the PMF of the number of calls that arrive in any T = 20-second interval?
Chapter 3 : Discrete Random Variables
(Continue)
• Let j = number of calls that arrive
t 0 25 20 5 ll• = t = 0.25x20 = 5 calls
otherwise
jjejf
j
J
,...2,1,0
0
!/5 5
0.1
0.2
f J(j
)
Chapter 3 : Discrete Random Variables
00 5 10 15j
41
Poisson → Binomial
• Poisson probabilities can be approximate th bi i l b biliti if i l dthe binomial probabilities if n is large and pis small, then = np.
...,2,1,0 !
1
ke
kpp
k
nkf
kknk
N
Chapter 3 : Discrete Random Variables
Poisson RV Example
The probability of a bit error in a communication line is 10-3.line is 10 .
Find the probability that a block of 1000 bits has five or more errors.
Chapter 3 : Discrete Random Variables
42
Solution
• Each bit transmission corresponds to a Bernoulli trial with a “success” corresponding to a bit errortrial with a success corresponding to a bit error in transmission
• The probability of k errors in 1000 transmission is given by the binomial probability with n = 1000and p = 10-3
Chapter 3 : Discrete Random Variables
Solution
• The Poisson approximation to binomial probabilities uses = np = 1000(10-3) = 1probabilities uses np 1000(10 ) 1
515 KPKP
4
0 !1
k
k
ek
111111 1
Chapter 3 : Discrete Random Variables
!4
1
!3
1
!2
1
!1
111 1e
00366.05 KP
43
Summary of Discrete RV
RV PMF
Bernoulli BernoulliSuccess/Fail
BinomialTest n time until
k success
1
01
x
x
p
pxXP
knk ppk
nkXP
1
Chapter 3 : Discrete Random Variables
PascalTest until k
success kxk pp
k
xkXP
11
1
Summary of Discrete RV
RV PMF
Geometric RV 1 1xGeometric RVTest until success
Poisson RVOccurrence in a period
of time
0
1 1x
X
ppxP
ek
kNPk
!
Chapter 3 : Discrete Random Variables
44
Average
• The average is a statistic of the collection of numerical observationsnumerical observations
• Use to describe the entire collection• Averages:MeanMedianModeMode
Chapter 3 : Discrete Random Variables
Average
• adding up all numbers in the collection andMean :
adding up all numbers in the collection anddividing by the number of terms in the sum
• number in the middle of the set of numbersn is odd (n+1)/2 th
i th f /2 d /2 +1 th
Median :
Chapter 3 : Discrete Random Variables
n is even the average of n/2 and n/2 +1 th
• most common number in the collection ofobservations
Mode :
45
Example
For one quiz, 10 students have the following grades (on a scale of 0 to 10)
Sum of the ten grades is 68.4, 5, 5, 5, 7, 7, 8, 8, 9, 10 mean = 68/10 = 6.8
)9, 5, 10, 8, 4, 7, 5, 5, 8, 7
Find the mean, the median, the mode------------------------------------------------------------
Chapter 3 : Discrete Random Variables
4, 5, 5, 5, 7, 7, 8, 8, 9, 10 median = (7+7)/2 = 7(four scores below 7 and four score above 7)
4, 5, 5, 5, 7, 7, 8, 8, 9, 10 mode = 5 (score occurs more often than any other)
Expected Value of Random Variable
• A measure of the center of the distribution• The sum of all possible values for a random• The sum of all possible values for a random
variable, each value multiplied by its probability of occurrence
XSx
XX xxPXE Probability Distribution
0
0.1
0.2
0.3
0.4
f X(x
)
Chapter 3 : Discrete Random Variables
00 1 2 3 4 5x
Expected value
46
Expected Value of Random Variable
x(1) = -2, x(2) = 0x(3) = 0, x(4) = 1Outcomes
RVX()=x
• Experiment RV X
• Experiment Trial n independent
x(5) = 2, x(6) = -1 ect.SX = {-2, -1, 0, 1, 2}
0 1 2-1-2SX
• x(i) ith trial• x(1), x(2), …, x(n) set of n sample values of X
Chapter 3 : Discrete Random Variables
Expected Value of RV
n
in ix
nm
1
1• Average
xSx
xn xNn
m1
• n trials, assume each x SX occur Nx times
• Relative frequency of probability
Chapter 3 : Discrete Random Variables
n
NxP x
nX
lim
47
Expected Value
• Expected value
N1
lili
xSxx
nn
nxN
nm limlim
xSx
x
n n
Nx lim
X xxP
1
2
3
Chapter 3 : Discrete Random Variables
XSx
X
X
XExxP
xSx
x P(x) xP(x)
0 0 3 Probability Distribution0 00
Example
0 0.31 0.252 0.23 0.154 0.05
0
0.1
0.2
0.3
0.4
0 1 2 3 4 5x
f X(x
)
0.000.250.400.450.20
5 0.05
)(xP )]([ xxP
Total 1.00Center of distribution
Expected Value
0.251.55
Chapter 3 : Discrete Random Variables
48
Bernoulli Expected value
1
01 xpxPXPMF, SX = {0, 1}
1xpX
Expected Value
pppxxPXEXSx
X
110
, X { , }
Chapter 3 : Discrete Random Variables
The Bernoulli random variable X has expected value E[X] = p
PMF,
Geometric Expected Value
,...3,2,11 1 xppxP xX
SX = {1, 2,…}
Expected Value
ppxpXEx
x 111
1
x 1
Chapter 3 : Discrete Random Variables
The geometric random variable X has expected value E[X] = 1/p
49
Infinite Geometric Series
x
xpxpXE1
11 qqdq
dpXE 1 ,
1
1
x
x
x
x
x
qd
p
qdq
dp
xqp
0
0
1
p
qpq
p
1
1 1
12
n
x
x
n
x
qdq
dp
qdq
p
0
0
limq
qn
x
x
n
1
1lim
0
Infinite Geometric Series
Chapter 3 : Discrete Random Variables
Poisson Expected Value
0 !
x
ex
xXE 0 !x x
!11
!
1
xxx
xx
1
1
!1x
x
xeXE
1 !x
x
ex
x
Chapter 3 : Discrete Random Variables
0 !m
m
meXE
Let m = x - 1 e
ee
50
Expected Value of other RV
RV E[X]RV E[X]Binomial RV
Test n time until ksuccess
Pascal RV
np
Chapter 3 : Discrete Random Variables
Test until k success k/p
Derived Random Variables
• Use sample values of a random variable to compute other quantitiescompute other quantities
• ExampleMeasure the power level of received signal in
millwatts(x) convert to decibels by calculating y = 10log10x
Chapter 3 : Discrete Random Variables
51
Derived Random Variables
OutcomesS
RVX()=X
0 1 2-1-2
SX
RV Y
0 1 2 3 4
Chapter 3 : Discrete Random Variables
0SY
3
Derived random variable
Example
• Random Variable X = # of pages in colourprinting machinep g
• Probability model PX(x) for # of pages in each colour printing machine
• Charging plan for printing:1st page = 10 Baht2nd page = 9 Baht 3rd 8 B ht
Find a function Y = g(X) f th h f l3rd page = 8 Baht
4th page = 7 Baht5th page = 6 Baht6 – 10 pages = 50 Baht
Chapter 3 : Discrete Random Variables
for the charge for colourprinting
52
Solution
RV XOutcomesS Outcomes
3 4 1021
SX
OutcomesS Outcomes
Chapter 3 : Discrete Random Variables
: Outcomes of colour printing machineX : # of pages in colour printing machine
Solution
RV X
OutcomesS Outcomes
3 4 1021
SX
RV Y
Chapter 3 : Discrete Random Variables
10 19 27 50
SY
Derived RV
106
51
50
5.05.10 2
X
XXXY
53
Solution
X
1
Y
10123456
1019273440
Chapter 3 : Discrete Random Variables
78910
50
PMF of Derived RV
For discrete random variable X,
th PMF f Y (X) ithe PMF of Y = g(X) is
yxgx
XY xPyP:
Chapter 3 : Discrete Random Variables
54
Example
• Suppose the probability model for # of pages Xof a printing machine is
otherwise
x
x
xPX 8,7,6,5
4,3,2,1
0
1.0
15.0
of a printing machine is
• Find the PMF of Y : the charge for printing
Chapter 3 : Discrete Random Variables
106
51
50
5.05.10 2
X
XXXXgY
PY(y)
Solution
X PX(x) Y
PY[10] = PX[1] = 0.15
PY[19] = PX[2] = 0.15
PY[27] = PX[3] = 0.15
PY[34] = PX[4] = 0.15
PY[40] = PX[5] = 0.1
1 0.152 0.153 0.154 0.155 0.10
1019 273440
0.150.150.150.150.1
PY[50] = PX[6]+PX[7]+PX[8]
= 0.1+0.1+0.1 = 0.3
Chapter 3 : Discrete Random Variables
6 0.107 0.108 0.10
50 0.3
55
Example
The amplitude V (volts) of a sinusoidal signal is a random variable with PMF
otherwise0
3,...,2,37/1 vvPV
0
0.1
0.2
-5 0 5v
P[V
=v]
Chapter 3 : Discrete Random Variables
Let Y = V2/2 watts denote the average power of the transmitted signal. Find PY(y)
v
Solution
Y = V2/2
S = {-3 -2 -1 0 1 2 3} vPYP SV = {-3, -2, -1, 0, 1, 2, 3}
SY = {0, 0.5, 2, 4.5}
Y = 0, PY(0) = PV(0) = 1/7
Y = 0.5, PY(0.5) = PV(1) + PV(-1)
yvgvVY vPYP
:
= 1/7 + 1/7 =2/7
Y = 0.5, 2, 4.5, PY(y) = 2/7
Chapter 3 : Discrete Random Variables
56
Solution
3237/1 v
542507/2
07/1
y
y
yPY
otherwise0
3,...,2,37/1 vvPV
Chapter 3 : Discrete Random Variables
otherwise0
5.4,2,5.07/2 yyPY
Expected Value of a Derived RV
Given a random variable X with PMF PX(x) and the derived random variable Y = g(X) the
XSx
XY xPxgYE
the derived random variable Y g(X), the expected value of Y is
Chapter 3 : Discrete Random Variables
ySy
YY yyPYE
57
Example
• What is E[Y]?
otherwise
x
x
xPX 8,7,6,5
4,3,2,1
0
1.0
15.0
Chapter 3 : Discrete Random Variables
106
51
50
5.05.10 2
X
XXXYXg
Solution
8
1xX xPxgYE
E[Y] = 0.15[(10.5-0.5) + (10.5(2)-0.5(2)2 )+ (10.5(3) - 0.5(3)2) + (10.5(4)-0.5(4)2)]
4 (0 1)(50)(3)
1x
8
6
24
1
2 1.0501.055.055.1015.05.05.10xx
XXYE
+ 4 + (0.1)(50)(3)
= 0.15[10 +19 + 27 + 34] + 4 + 15
= 32.5
Chapter 3 : Discrete Random Variables
58
Property of Expected value
For any random variable X,
E[Y] = E[X - µX] = 0
E[Y] = E[aX + b] = aE[X] + b
Chapter 3 : Discrete Random Variables
A linear transformation
Example
• Let V = g(R) = 4R + 7 and
,
2
0
0
4/3
4/1
otherwise
r
r
rPR
Chapter 3 : Discrete Random Variables
• Find E[R], E[V]
59
Solution
• E[R] = 0(1/4) + 2(3/4) =3/2
• V = 4R + 7 S = {7 15}• V = 4R + 7 SV = {7, 15}
• PV(7) = ¼ ,PV(15) = ¾
E[4R+7] = 4E[R] + 7 = 4(3/2) + 7
E[V] = (VPV)= 7(1/4)+15(3/4)
Chapter 3 : Discrete Random Variables
4(3/2) + 7= 13
7(1/4)+15(3/4)= 13
Variance and Standard Deviation
• VarianceDescribes the difference between RV X and its
expected value Y = X – E[X]
How far from average?Because E[Y] = E[X-µX] = 0, it is better to know E[|Y|]
E[Y2] = E[(X - µX)2] Variance
Chapter 3 : Discrete Random Variables
Var[X] = E[(X - µX)2]
60
Variance
• Theorem
2222][Var XEXEXEX X
Var[aX + b] = a2Var[X]
Chapter 3 : Discrete Random Variables
[ ] [ ]
Standard Deviation
• Standard DeviationA measure of dispersion expressed in terms
XX Var
A measure of dispersion expressed in terms of the original units
Chapter 3 : Discrete Random Variables
61
x P(x) xP(x)
0 0 05 0x2 x2P(x)
0 0
Example
Probability Distribution
0.3
0.4
0 0.05 01 0.2 0.22 0.2 0.43 0.1 0.34 0.3 1.2
0 01 0.24 0.49 0.316 1.2
-
x
PX(x
)
0
0.1
0.2
0.3
0 1 2 3 4 5
+
E[X] = 2.855 0.15 0.75 25 0.75
10.45Total 1.00 2.85Var[X] = 10.45 – 2.852
= 2.33X = 1.5
Chapter 3 : Discrete Random Variables
)]([ 2 xPx )(xP )]([ xxPE[X2]
E[X] 2.85
Theorem
(a) If X is Bernoulli (p), then Var[X] = p(1-p)
(b) If X is Geometric (p), then Var[X] = (1-p)/p2
(c) If X is Binomial (p), then Var[X] = np(1-p)
(d) If X is Pascal (p), then Var[X] = k(1-p)/p2
(e) If X is Poisson (p), then Var[X] =
Chapter 3 : Discrete Random Variables
62
References
1. Alberto Leon-Garcia, Probability and Random Processes for Electrical Engineering, 3rd Ed., Addision-Wesley Publishing, 1994
2. Roy D. Yates, David J. Goodman, Probability and Stochastic Processes: A Friendly Introduction for Electrical and Computer Engineering, 2nd, John Wiley & Sons, Inc, 2005
3. Jay L. Devore, Probability and Statistics for Engineering and the Sciences, 3rd edition, Brooks/Cole Publishing Company, USA, 1991.
Chapter 3 : Discrete Random Variables
(Continue)
4. Robert B. Cooper, Introduction to QueueingTheory, 2nd edition,Theory, 2nd edition,
5. Donald Gross, Carl M. Harris, Fundamentals of Queueing Theory, 3rd edition, Wiley-Interscience Publication, USA, 1998.
6. Leonard Kleinrock, Queueing Systems Vol. I: Theory, A Wiley-Interscience Publication,Theory, A Wiley Interscience Publication, Canada, 1975
Chapter 3 : Discrete Random Variables