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

Tutorial 3: Robability Models & Applications

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 17

Tutorial 3

Probability Models & Applications

1
Poisson Distribution
 A random variable X, taking on one of
the values 0, 1, 2, …, is said to be a
Poisson random variable with parameter
λ, if for some λ> 0,

 i
p (i )  P{ X  i}  e
i!

2
Approximate Binomial by
Poisson Distribution
 Suppose X is a binomial random
variable with parameter (n,p) and
let λ = np.
n!
P{ X  i}  p i (1  p) n i
(n  i )!i!
i n i
n!     
   1  
(n  i )!i!  n   n
(1   )n
n(n  1)...(n  i  1)  i
n

ni i! (1   ) i
n 3
Approximate Binomial by
Poisson Distribution (con’t)
 Now, for n large and p small,
n i
   n(n  1)...(n  i  1)  
1    e 1 1    1
 n n i
 n

 Hence, for n large and p small,


 i
P{ X  i}  e
i!
4
Example 1
 Suppose that the probability that an item
produced by a certain machine will be
defective is 0.1. Find the probability that
a sample of 10 items will contain at most
1 defective item.

 Using Binomial dist,


10  10 
P   (0.1) (0.9)   (0.1)1 (0.9) 9  0.7361
0 10

0 1

5
Example 1 (con’t)
 Using Poisson approximation,
Now n = 10, p = 0.1, Let λ= 10x0.1 = 1

 P = P{X = 0} + P{X = 1}
0 1
1 1
 e 1  e 1
0! 1!
1 1
e e
 0.7358  0.7361

6
Conditional Probability

 Two events E and F, the conditional


probability of E given F is defined, as
long as P(F) > 0, by

P ( EF )
P( E | F ) 
P( F )

7
Conditional Probability Mass Function
 X and Y are discrete r.v.,
the conditional probability mass function
of X given Y = y, is defined by
p X |Y ( x | y )  P{ X  x | Y  y}
P{ X  x, Y  y}

P{Y  y}
p ( x, y )

pY ( y ) 8
Example 2
 Suppose that p(x,y) , the joint probability
mass function of X and Y, is given by
p(1,1)=0.5, p(1,2)=0.1, p(2,1)=0.1, p(2,2)=0.3
Calculate the probability mass function
of X given that Y=1.

 We first note that


pY (1)   p( x,1)  p(1,1)  p (2,1)  0.6
x

9
Example 2 (con’t)
 Hence, p X |Y (1 | 1)  P{ X  1 | Y  1}
P{ X  1, Y  1}

P{Y  1}
p (1,1)

pY (1)
5

6

p (2,1) 1
 Similarly, p X |Y ( 2 | 1)  
pY (1) 6
10
Conditional Probability Density Function
 X and Y have a joint probability density
function f(x,y), then the conditional
probability density function of X, given
Y=y, is defined for all values of y such
that fY ( y )  0 , by
f ( x, y )
f X |Y ( x | y ) 
fY ( y )

11
Example 3
 Suppose the joint density of X and Y is
6 xy (2  x  y ) ,0  x  1,0  y  1
f ( x, y ) 
0 , otherwise

Compute the conditional density function


of X given Y=y, where 0<y<1.

12
Example 3 (con’t)
f ( x, y )
f X |Y ( x | y ) 
fY ( y )
6 xy (2  x  y )
 1
 6 xy(2  x  y)dx
0

6 xy (2  x  y )

y (4  3 y )
6 x(2  x  y )

4  3y
13
Matlab
 1) After logon to a workstation, type “matlab”
to run the matlab program.

 2) How to program:
i) Compute in the command prompt.
ii) Use editor to edit the matlab file and same
as .m extension.

 3) Type the file name to run the matlab file


(e.g. filename mat.m, then type name “mat”
to run the file)
14
Matlab (con’t)
 Syntax of Matlab
– To make a 1x3 matrix called mat
>> mat = [ 1 3 2]
– Multiple the matrix by 5
>> mat*5
– plot the matrix
– >> plot(mat)

15
Matlab (con’t)
 Edit the .m file
– How to plot the equation Y = 3X + 4?

Result = []; %declare a matrix


for i=0:100,
R = 3*i+ 4;
Result = [Result R];
end
plot(Result);

16
Matlab (con’t)

 Special function in matlab


– who to check the existing variable
– clear variable_name to clear a variable
with name variable_name
– clear to clear all the existing variable
– helpwin to get help for matlab

17

You might also like