UNIT 4 Probability
UNIT 4 Probability
UNIT 4 Probability
Probability
Statistical Experiment
This is any activity that results in data being generated e.g. tossing a coin and observe
number of heads appearing. Or connecting bulbs and observe number of hours they will
be on until worn out.
Example
If we toss a coin 3 times and observe the number of heads appearing then S 0,1, 2,3
Sample Point
This is a single element in a Sample Space and is denoted by small (s). s is a subset of
S (s C ) .
An event can be rare or sure. A rare event is almost an impossible event if not impossible
indeed. A sure event is certain or bound to happen, e.g. the event that the sun will rise
tomorrow is sure. If an event is rare and sure it is deterministic. Probability of an event is
measured to a scale from 0-1. P( A) = 0 means A is a rare event. P( B) = 1 means A is
a sure event.
Axioms of Probability
Two events A and B are said to be mutually exclusive or disjoined if they cannot occur
at the same time. In other words mutually exclusive events have a null intersection.
Mutualy exclusive
Non-mutually exclusive
1. Union ( )
A B is a set that is formed by combining elements from A and B .if an element
appears in A and B in it will appear once in A and B .
2. Intersection ( )
A B is a set formed by including only common elements in A and B
3. Compliment
Ac is a set of all element which are not in A .
Theorem
P( B) P( A B Ac )
P( B) P( A) P( B Ac )
A B Ac
A B Ac
P( A B) P( A) P( B) P( A B)
Venn diagram
Conditional probability
P( A B)
P( A / B) (4.1)
P( B)
Equation (4.1) gives the conditional probability of A given that event B has occurred.
P( A B)
P( B / A)
P( A)
NB: P( B A) P( A B)
Find P( B / A)
Solution
P( A B)
P( A / B)
P( B)
P( B A)
P( B / A)
P( A)
P( B) P( A / B) P( A B)
P( A) P( B / A) P ( B A)
P( B) P( A / B) P( A) P( B / A)
P( B) 0.6 0.4 P( B / A)
0.3 0.6
P( B / A)
0.4
0.45
Example 2
Have pets No pets Total
Male 0.41 0.08 0.49
Female 0.45 0.06 00.51
Total 0.86 0.14 1
1. What is the probability that a random person chosen is a male and owns a pet?
2. Are the events male and own a pet dependent or not?
Solutions
P( M O)
P ( M / O)
P(O)
0.41
0.86
0.476
0.48
P( M ) 0.49
P( M / O) P( M )
0.48 0.49
Total probability
The formula for conditional probability can be extended to more than two events.
Baye’s Theorem
P( B) P( A / B) P( A B)
P( A) P( B / A) P( B A)
P( A) P( B / A)
P( A / B)
P( B)
Baye’s Theorem
P( B) P( A / B)
P( B / A)
P( A)
Let E , E , E ....E
1 2 3 K
be mutually exclusive events and exhaustive events defined on a
sample space S . Let B be another event.
P( E 1 / B) P( E 1)
P( E 1 / B)
P( B / E i ) P( E 1) P( B / E 2) ...P( B / E k ) P( E k )
P( E i ) P( B / E i )
P( E i / B) , where i 1 k
P( B / E i ) P( E i )
Example 1
A printer manufacturer obtained the following probability from a data base of test
results. Printer failures are associated with 3 types of problems:
1. Hardware
2. Software
3. And others (such as connectors).
With probability 0.1, 0.6 and 0.3 respectively. The probability of a printer failure given a
hardware problem is 0.9, given a software problem is 0.2 and given any other type of
problem is 0.5. if a customer enters the manufacture’s website to diagnose a printer
failure. What is the most likely cause of the problem?
P( H ) 0.1 P( F / H ) 0.9
P( S ) 0.6 P( F / S ) 0.2
P(C ) 0.3 P( F / C ) 0.5
P( H / F ) P( H )
P( H )
P( F / H ) P( H ) P( F / S ) P(C )
0.36
P( H / F ) 0.09 0.36
0.25
0.2 0.6
P( S / F )
0.36
0.33
0.416
Discrete random variable
Assumes exact random values called integers,
E.g.
Number of patients discharged from a hospital.
Number of cars without road permits
Number of tickets issued in the festive season.
1. P( X x ) 1
2. 0 P( X ) 1
r
NB: the cumulative probability distribution function ( X r ) ( X x)
i 1
Example 1
Consider an experiment which a fair coin is tossed 3 times. Let the discrete random
variable X be the number of tails appearing. Determine the probability distribution of X
S 0,1, 2,3
x 0 1 2 3
P( X x ) 1 3 3 1
8 8 8 8
1 3 3 1 8
P( X x) 1
8 8 8 8 8
0 P( X x) 1
P( X 2) P( X 0) P( X 1)
1 3 4 1
8 8 8 2
Variance ( X ) E ( X 2 ) [ E ( X )]2
x2 P( X x) [ xP( X x)]2
1 3 3 1
E ( X ) 0( ) 1( ) 2( ) 3( )
8 8 8 8
3 6 3
8 8 8
12
8
3
1.5
2
2trials
1 3 3 1
Variance( X ) (02 ( ) 12 ( ) 22 ( ) 32 ( )) (1.5) 2
8 8 8 8
3 12 9
( ) (1.5)2
8 8 8
24
(1.5)2
8
3
4
0.75
E ( X ) xf ( x)dx
Variance( X ) x 2 f ( x)dx 2
Example 1
Time until the chemical reaction is complete in milliseconds is approximated by the
cumulative probability distribution function.
1. Determine f ( X )
2. What proportion of reaction is complete within 200 milliseconds
Now if X satisfies all the above conditions, X follows binomial any trials probability P
of success and any trials ( X B(n, p))
n n!
c
r r !(n r )!
0! 1! 1
Example 1
Expecting mothers in a community have a 60% chance of giving birth to a baby girls.
Out of 8 expecting mothers chosen from the community determine the probability that;
1. None will give birth to a girl.
2. All of them will give birth to a boy.
3. At least 5 of them will give birth to a baby girl.
4. At most 3 will give birth to boys.
5. What is the expected number of boys?
Solutions
Let X be the random variable number of girls from the expectant mothers.
1. X B(8,0.6) , q 0.4
8
P( X 0) c(0.6)0 (0.4)8
0
0.000655
2. X b B(8, o.4)
8
P( X b 8) c(0.4)8 (0.6)0
8
0.000655
3. X B(8,0.6)
P( X 5) P( X 5) P( X 6) P( X 7) P( X 8)
8 8 8 8
c(0.6)5 (0.4)3 c(0.6)6 (0.4)2 c(0.6)7 (0.4)1 c(0.6)8 (0.4)0
5 6 7 8
0.4034
4. X B(8,0.4)
P( X 3) P( X 0) P( X 1) P( X 2) P( X 3)
8 8 8 8
c(0.4)0 (0.6)8 c(0.4)1 (0.6)7 c(0.4)2 (0.4)6 c(0.4)3 (0.6)5
0 1 2 3
5. If X B(n, p)
E ( X ) np
Variance( X ) npq
Geometric distributions
All condition for the binomial must be satisfied except that the experiment must be
repeated infinitely. The only way the random variable X is defined. In the geometric
case define the random variable of X as the “number of trials needed until the first
success”. If the probability of success is P then we write X Geo( P)
1st trial = q
Success 3rd: q 2 p
Succeed 4th = q 3 p
In general, success after r trial, the probability distribution function i.e. probability of
success after r trials is given by:
P( X r ) q r 1 p , r 1, 2,3,....
Example
The probability that student passes an exam is 0.1. Given that events passing and
failing are independent, what is the probability that the student will pass after 11 seats?
Solutions
X Geo(0.1)
P( X 12) q11 p
(0.9)11 0.1
0.03
0.01
P( X 7) (0.9)6 0.1
0.05
1
E( X )
p
Poisson distribution
The distribution is important in queuing models. It is used to model the average
occurrence of a random variable in a time interval, e.g. number of patients admitted to a
state hospital per hour.
TNumber
Tdays
59
7
8.4
8 / days
Define Random variable X as the number of patients admitted per day X Po( )
X Po(8)
e r
P.d . f P( X r ) ; r 0,1, 2,3 , where e is the Euler constant 2.7182
r!
e8 8r
P( X 4)
4!
0.057
What is the probability that more than 3 people are admitted per day?
P( X 3) P( X 4) P( X 5) P( X 6) ...
P( X 3) P( 3) 1
P( X 3) 1 P( X 3)
1 [ P( X 0) P( X 1) P( X 2) P ( X 3)]
e8 80 e 8 81 e 8 82 e 8 83
1[ ]
0! 1! 2! 3!
8 8 512e 8
1 [e 32e ]
6
355 8
1 e
3
1 0.03969641
0.96
e16 165
P( X 5)
5!
Normal/Gaussian Distribution
Used to model for continuous random variables. It is an important distribution in
statistical inference. All parametric test depend on this distribution. All parametric test
depend on this distribution. Parametric test are: Z , F , t tests. A random variable is
normally distributed if its’ density takes form.
Draw graph
2
2. Variance ( )
1. Symmetric about ( )
2. Asymptotic
Area under the curve corresponds to probability that is; P( X )
f ( X ) d ( x)
f ( X )d ( x) 1
1
1 Z2
f (Z ) e 2
2
To get probabilities we can use the statistical tables called the Z tables.
f (Z )
Draw graph
Draw graph
(b) (a)
Draw graph
1 P( Z a )
1 (a)
Draw graph
P( Z 0) 0.5
P( Z 0.5) 0.6915
P( Z 1.45) 0.9265
P( Z 3.31) 0.99953
P( Z 2.41) 0.99202
P( Z 0.25) 1 P( Z 0.25)
1 0.5987
0.4013
Theorem
Example
1. x 1 (0.95)
1.64
Draw graph
2. P(Z y) 0.4013 y
Draw graph
1 0.4013 0.5987
P( Z y ) 0.5987
y (0.5987)
y 0.25
y 0.25
Application of normal distribution
Example 1
The weight of bags field by a certain machine is normally distributed with a mean of
20kg and standard deviation of 1kg for a randomly selected bag filled by this machine,
determine the probability that the weight is;
Solutions
X N (20,1)
1. P( X 21)
21 20
P( Z )
1
P( Z 1)
(1)
0.8413
2. P(19 X 22)
P( X 22) P( X 19)
22 20 19 20
P( Z ) P( Z )
1 1
P( Z 2) P( Z 1)
P( Z 2) [1 P( Z 1)]
(2) [1 (1)]
0.9772 1 0.8413
0.8185
3. P( X 18) 1 P( X 18)
18 20
1 P( Z )
1
1 P( Z 2)
1 (2)
A batch of 15 000 bottle pesticide as a mean volume that is normally distributed with a
mean of 500ml and a standard deviation of 1.5. Determine the proportion of bottles
whose volume is between 498 and 505ml.
X N (5)