0% found this document useful (0 votes)
43 views

Week2 Lecture2 PDF

Uploaded by

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

Week2 Lecture2 PDF

Uploaded by

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

EE501 Stochastic Processes

Semester 191
Week-2, Lecture-2

Mohamed Abdul Haleem


Room B14-S-345
Tel: x2572
Email: [email protected]
Binomial Random Variable Approximations, Conditional
Probability Density Functions, a-priori pdf, and a-
posteriori probability

Let X represent a Binomial r.v. Then


k2 k2
 n  k n k
Pk1  X  k2    Pn ( k )     p q .
k k1 k k1  k 
n n!
Since the binomial coefficient    grows quite rapidly with n, it is difficult
 k  ( n  k )!k!
to compute above for large n. In this context, two approximations are extremely
useful.

The Normal Approximation (Demoivre-Laplace Theorem) Suppose n   with p


held fixed. Then for k in the npq neighborhood of np, we can approximate
 n  k n k 1
  p q  e ( k np ) / 2 npq .
2

k  2npq

2
Binomial Random Variable - The Normal Approximation

Thus if k1 and k2 in the above are within or around the


neighborhood of the interval np  npq, np  npq , we can
approximate the summation above by an integration. In that
case the expression reduces to
Pk1  X  k2   
k2 1 x2 1  y2 / 2
e ( x np ) 2 / 2 npq
dx   e dy,
k1 2npq x1 2
where
k1  np k  np
x1  , x2  2 .
npq npq

We can express this in terms of the normalized integral


1 x

 y 2 /2
erf (x )  e dy  erf (x )
2 0

that has been tabulated extensively. 3


1 x 1

 y 2 /2
erf (x )  e dy  G (x )  , x  0
2 0 2
1
where G  x  
x

 y 2 /2
e dy
2 -

x erf(x) x erf(x) x erf(x) x erf(x)

0.05 0.01994 0.80 0.28814 1.55 0.43943 2.30 0.48928


0.10 0.03983 0.85 0.30234 1.60 0.44520 2.35 0.49061
0.15 0.05962 0.90 0.31594 1.65 0.45053 2.40 0.49180
0.20 0.07926 0.95 0.32894 1.70 0.45543 2.45 0.49286
0.25 0.09871 1.00 0.34134 1.75 0.45994 2.50 0.49379

0.30 0.11791 1.05 0.35314 1.80 0.46407 2.55 0.49461


0.35 0.13683 1.10 0.36433 1.85 0.46784 2.60 0.49534
0.40 0.15542 1.15 0.37493 1.90 0.47128 2.65 0.49597
0.45 0.17364 1.20 0.38493 1.95 0.47441 2.70 0.49653
0.50 0.19146 1.25 0.39435 2.00 0.47726 2.75 0.49702

0.55 0.20884 1.30 0.40320 2.05 0.47982 2.80 0.49744


0.60 0.22575 1.35 0.41149 2.10 0.48214 2.85 0.49781
0.65 0.24215 1.40 0.41924 2.15 0.48422 2.90 0.49813
0.70 0.25804 1.45 0.42647 2.20 0.48610 2.95 0.49841
0.75 0.27337 1.50 0.43319 2.25 0.48778 3.00 0.49865

4
Binomial Random Variable - The Normal Approximation

For example, if x1 and x2 are both positive ,we obtain


Pk1  X  k2   erf ( x2 )  erf ( x1 ).

Example: A fair coin is tossed 5,000 times. Find the probability that
the number of heads is between 2,475 to 2,525.
Solution: We need P(2,475  X  2,525). Here n is large so that we
1
can use the normal approximation. In this case p  2 , so that np  2,500
and npq  35. Since np  npq  2,465, and np  npq  2,535,
the approximation is valid for k1  2,475 and k 2  2,525. Thus
P k1  X  k 2   
x2 1  y2 / 2
e dy.
x1 2
k 1  np 5 k 2  np 5
Here x 1     0.71428, x 2 
7
  0.71428.
7
npq npq 5
1 x 1

 y 2 /2
erf (x )  e dy  G (x )  , x  0
2 0 2
1
where G  x  
x

 y 2 /2
e dy
2 -

x erf(x) x erf(x) x erf(x) x erf(x)

0.05 0.01994 0.80 0.28814 1.55 0.43943 2.30 0.48928


0.10 0.03983 0.85 0.30234 1.60 0.44520 2.35 0.49061
0.15 0.05962 0.90 0.31594 1.65 0.45053 2.40 0.49180
0.20 0.07926 0.95 0.32894 1.70 0.45543 2.45 0.49286
0.25 0.09871 1.00 0.34134 1.75 0.45994 2.50 0.49379

0.30 0.11791 1.05 0.35314 1.80 0.46407 2.55 0.49461


0.35 0.13683 1.10 0.36433 1.85 0.46784 2.60 0.49534
0.40 0.15542 1.15 0.37493 1.90 0.47128 2.65 0.49597
0.45 0.17364 1.20 0.38493 1.95 0.47441 2.70 0.49653
0.50 0.19146 1.25 0.39435 2.00 0.47726 2.75 0.49702

0.55 0.20884 1.30 0.40320 2.05 0.47982 2.80 0.49744


0.60 0.22575 1.35 0.41149 2.10 0.48214 2.85 0.49781
0.65 0.24215 1.40 0.41924 2.15 0.48422 2.90 0.49813
0.70 0.25804 1.45 0.42647 2.20 0.48610 2.95 0.49841
0.75 0.27337 1.50 0.43319 2.25 0.48778 3.00 0.49865

6
Binomial Random Variable - The Normal Approximation
Since x1  0, the above probability is given by
P2,475  X  2,525  erf ( x 2 )  erf ( x1 )  erf ( x 2 )  erf (| x1 |)
5
 2erf    0.516,
7
where we have used Table erf (0.7)  0.258 .
1 1
e x / 2
2
e x / 2
2

2 2

x x
x1 x2 x1 x2
(a) x1  0, x2  0 (b) x1  0, x2  0

7
Binomial RandomVariable-The Poisson Approximation

The Poisson Approximation: As we have mentioned earlier,


for large n, the Gaussian approximation of a binomial r.v. is
valid only if p is fixed, i.e., only if np  1and npq  1. What
if np is small, or if it does not increase with n?

Obviously that is the case if, for example, p  0 as n  ,


such that np   is a fixed number.

8
Binomial Random Variable-The Poisson Approximation

Many random phenomena in nature in fact follow this pattern.


• Total number of calls on a telephone line. 1 2

n

• Claims in an insurance company. 0



T
Consider random arrivals such as telephone calls over a line. Let n
represent the total number of calls in the interval (0, T ).
From our experience, as T   we have n   so that we may
assume n  T .Consider a small interval of duration  as in Fig. If
there is only a single call coming in, the probability p of that single
call occurring in that interval must depend on its relative size with
respect to T.
9
1 2 n


0 T
Binomial RandomVariable-The Poisson Approximation

Hence we may assume p . Note that p  0 as T  .
T

However in this case np  T      is a constant,
T
and the normal approximation is invalid here.
Suppose the interval  in Fig. is of interest to us. A call inside that interval is a
“success” (H ), whereas one outside is a “failure” (T ). This is equivalent to the coin
tossing situation, and hence the probability Pn (k ) of obtaining k calls (in any order)
in an interval of duration  is given by the binomial p.m.f. Thus
n!
Pn (k )  p k (1  p )n k ,
(n  k )!k!
and here as n  , p  0 such that np   . It is easy to obtain an
excellent approximation to the above in that situation. Rewrite above as …

10
1 2 n


0 T
Binomial RandomVariable-The Poisson Approximation
n( n  1)  ( n  k  1) ( np) k n k
Pn ( k )  (1  np / n )
nk k!
 1  2  k  1  k (1   / n ) n
  1   1     1   .
 n  n  n  k! (1   / n ) k

Thus k
lim Pn ( k )  e  ,
n  , p 0 , np   k!
 1  2  k 1 
k

since the finite products  1   1     1   as well as 1  
 n  n  n   n
tend to unity as n  , and

n

lim1    e  .
n 
 n
The right side of above represents the Poisson p.m.f and the Poisson approximation
to the binomial r.v. is valid in situations where the binomial r.v parameters n and p
diverge to two extremes ( n  , p  0) such that their product np is a constant.
11
Binomial RandomVariable-The Poisson Approximation

Example 1: Winning a Lottery: Suppose two million lottery


tickets are issued with 100 winning tickets among them. (a) If a
person purchases 100 tickets, what is the probability of
winning? (b) How many tickets should one buy to be 95%
confident of having a winning ticket?

12
Binomial RandomVariable-The Poisson Approximation

Solution: The probability of buying a winning ticket


No. of winning tickets 100
p   5  10 5.
Total no. of tickets 2  10 6

Here n  100,and the number of winning tickets X in the n purchased tickets has an
approximate Poisson distribution with parameter
  np  100  5  10 5  0.005.
 k
Thus P( X  k )  e ,
k!
and (a) Probability of winning  P( X  1)  1  P( X  0)  1  e   0.005.
(b) In this case we need P( X  1)  0.95.
P( X  1)  1  e    0.95 implies   ln 20  3.

But   np  n  5  105  3 or n  60,000. Thus one needs to buy about 60,000


tickets to be 95% confident of having a winning ticket!
13
Binomial RandomVariable-The Poisson Approximation

Example 2: A space craft has 100,000 components n   The


probability of any one component being defective is 2  105 ( p  0).
The mission will be in danger if five or more components become
defective. Find the probability of such an event.

Solution: Here n is large and p is small, and hence Poisson


approximation is valid. Thus np    100,000  2  105  2,
and the desired probability is given by
  k
4 k 4
P( X  5)  1  P( X  4)  1   e 2
 1 e  k!
k 0 k! k 0

2 4 2
 1  e 1  2  2     0.052.
 3 3
14
Conditional Probability Density Function

For any two events A and B, we have defined the conditional


probability of A given B as
P( A  B )
P( A | B )  , P( B )  0.
P( B )
Noting that the probability distribution function FX (x) is given by
FX ( x)  P X ( )  x ,

we may define the conditional distribution of the r.v. X given the event
B as
P  X ( )  x   B 
FX ( x | B )  P X ( )  x | B  .
P( B )

15
Conditional Probability Density Function

Thus the definition of the conditional distribution depends on


conditional probability, and since it obeys all probability axioms, it
follows that the conditional distribution has the same properties as any
distribution function. In particular
P  X ( )     B  P( B )
FX (  | B )   1,
P( B ) P( B )
P  X ( )     B   P( )  0.
FX (  | B ) 
P( B ) P( B )
Further P  x1  X ( )  x2   B 
P( x1  X ( )  x2 | B ) 
P( B )
 FX ( x2 | B )  FX ( x1 | B ),

Since for x2  x1,  X ( )  x2    X ( )  x1   x1  X ( )  x2  .


16
Conditional Probability Density Function

The conditional density function is the derivative of the


conditional distribution function. Thus
dFX ( x | B )
f X ( x | B)  ,
dx
and we obtain
x
FX ( x | B )   
f X (u | B )du.

We can also write

P  x1  X ( )  x2 | B  
x2
 x1
f X ( x | B )dx.
Conditional Probability Density Function

Example 1: Toss a coin and X(T )=0, X(H )=1. Suppose B  {H }.


Determine FX ( x | B).
Solution: FX (x) has the form in (a). We need FX ( x | B) for all x.
For x  0, X ( )  x   , so that   X ( )  x   B   ,
and FX ( x | B)  0.
FX (x)

1
q
x
1
(a)
Conditional Probability Density Function

Solution: FX (x) has the form in (a). We need FX ( x | B) for all x.


For x  0, X ( )  x   , so that   X ( )  x   B   ,
and FX ( x | B)  0.
For 0  x  1, X ( )  x   T , so that   X ( )  x   B   T   H   
and FX ( x | B)  0.

For x  1, X ( )  x  , and   X ( )  x   B     B  {B}


P( B )
and FX ( x | B )  1 FX (x) FX ( x | B )
P( B )
1 1
q
x x
1 1
(a) (b)
FX ( x | B)
f X ( x | B)
1
f X (x)
FX (x)

a x a x

Conditional Probability Density Function

Example 2: Given FX (x), suppose B  X ( )  a. Find f X ( x | B).


Solution: We will first determine FX ( x | B).
P  X  x    X  a  
FX ( x | B )  .
P X  a 
For x  a,  X  x    X  a   X  x  so that
P X  x  F ( x)
FX ( x | B )   X .
P X  a  FX ( a )
For x  a,  X  x    X  a   ( X  a) so that FX ( x | B)  1. Thus
 FX ( x )
 , x  a,
FX ( x | B )   FX ( a )

 1, x  a,
and hence  f X ( x)
d  , x  a,
f X ( x | B)  FX ( x | B )   FX ( a )
dx 
 0, otherwise.
Conditional Probability Density Function

Example 3: Let B represent the event  a  X ( )  b with b  a. For a


given FX (x), determine FX ( x | B) and f X ( x | B).

P  X ( )  x   a  X ( )  b  
Solution:
FX ( x | B )  P X ( )  x | B 
P a  X ( )  b 
P X ( )  x   a  X ( )  b 
 .
FX (b)  FX ( a )
For x  a, we have  X ( )  x  a  X ( )  b   , and hence
FX ( x | B)  0.
Conditional Probability Density Function

For a  x  b, we have  X ( )  x  a  X ( )  b  {a  X ( )  x} and


hence P a  X ( )  x  FX ( x )  FX ( a )
F ( x | B)   .
FX (b)  FX ( a ) FX (b)  FX ( a )
X

For x  b, we have  X ( )  x  a  X ( )  b   a  X ( )  b so


that FX ( x | B)  1. Thus we have
 f X ( x)
 , a  x  b,
f X ( x | B )   FX (b)  FX ( a )

 0, otherwise.

f X ( x | B)

f X (x )
x
a b
Conditional pdf, Bayes’ theorem, a-priori probability and
a-posteriori probability

We can use the conditional p.d.f. together with the Bayes’ theorem to update
our a-priori knowledge about the probability of events in the presence of new
observations. Ideally, any new information should be used to update our
knowledge. As we see in the next example, conditional p.d.f. together with
Bayes’ theorem allow systematic updating. For any two events A and B, Bayes’
theorem gives
P ( B | A) P ( A)
P( A | B )  .
P( B )
Let B  x1  X ( )  x2  so that above becomes
P ( x1  X ( )  x2 ) | AP ( A)
PA | ( x1  X ( )  x2 ) 
P  x1  X ( )  x2 
x2

F ( x | A)  FX ( x1 | A)
 X 2 P ( A) 
 x1
f X ( x | A)dx
P ( A).
FX ( x2 )  FX ( x1 ) x2
 x1
f X ( x )dx
Conditional pdf, Bayes’ theorem, a-priori probability and
a-posteriori probability

Further, let x1  x, x2  x   ,   0, so that in the limit as   0,

lim PA | ( x  X ( )  x   )  P  A | X ( )  x  
f X ( x | A)
P ( A).
 0 f X ( x)
or P( A | X  x ) f X ( x )
f X | A ( x | A)  .
P( A)
 
We also get P ( A)  f X ( x | A)dx   P ( A | X  x ) f X ( x )dx,

  
1


or P ( A)   
P ( A | X  x ) f X ( x )dx

P( A | X  x ) f X ( x )
f X | A ( x | A)  
.
Thus we get the desired result

P ( A | X  x ) f X ( x )dx

24
Conditional pdf, Bayes’ theorem, and a-priori probability

To illustrate the usefulness of this formulation, let us reexamine the


coin tossing problem.
Example 4: Let p  P(H ) represent the probability of obtaining a
head in a toss. For a given coin, a-priori p can possess any value in the
interval (0,1). In the absence of any additional information, we may
assume the a-priori p.d.f. f P ( p) to be a uniform distribution in that
interval. Now suppose we actually perform an experiment of tossing
the coin n times, and k heads are observed. This is new information.
How can we update f P ( p) ?
Conditional pdf, Bayes’ theorem, a-priori probability and
a-posteriori probability

Solution: Let A= “k heads in n specific tosses”. Since these tosses result in a


specific sequence, f P ( p)
P( A | P  p )  p k q n k ,
and using the result in previous viewgraph we get p
0 1
1 1 ( n  k )! k!
P( A)   0
P( A | P  p ) f P ( p )dp   0
p k (1  p ) n k dp 
( n  1)!
.

The a-posteriori p.d.f f P| A ( p | A) represents the updated information given


the event A, and P ( A | P  p ) f ( p ) f ( p | A) P| A

f P| A ( p | A)  P
P ( A)
( n  1)! p
 p k q n k , 0  p  1  ( n, k ). 0 1
( n  k )! k!
Notice that the a-posteriori p.d.f of p in is not a uniform distribution, but a
beta distribution.
26
Conditional pdf, Bayes’ theorem, a-priori probability and
a-posteriori probability

We can use this a-posteriori p.d.f. to make further predictions, For example,
in the light of the above experiment, what can we say about the probability of
a head occurring in the next (n+1)th toss?
Let B = “head occurring in the (n+1)th toss, given that
k heads have occurred in n previous tosses”.
1
Clearly P( B | P  p )  p, and P ( B )   P ( B | P  p ) f P ( p | A)dp.
0

Notice that we have used the a-posteriori p.d.f to reflect our knowledge about the
experiment already performed. We get
1 ( n  1)! k n k k 1
P( B )   p  p q dp  .
0 ( n  k )! k! n2
Thus, if n =10, and k = 6, then
7
P( B )   0.58,
12
which is more realistic compare to p = 0.5. 27
Conditional pdf, Bayes’ theorem, a-priori probability and
a-posteriori probability

To summarize, if the probability of an event X is unknown, one should


make noncommittal judgement about its a-priori probability density
function f X (x). Usually the uniform distribution is a reasonable
assumption in the absence of any other information. Then
experimental results (A) are obtained, and our knowledge about X
must be updated reflecting this new information. Bayes’ rule helps to
obtain the a-posteriori p.d.f of X given A. From that point on, this a-
posteriori p.d.f f X |A ( x | A) should be used to make further predictions
and calculations.

You might also like