Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

Unit 4

Probability

Probability is an important subject in inferential biostatistics and also highly applicable in


biological science. The probability of an event is the measure of likelihood of that event
occurring or not occurring. It is an important concept in decision making. Decisions are
influenced by probability. An event is represented by capital letter A , B , C and so on.
P( A) means the probability of A happening and Ac is the probability of event A not
happening.

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.

Sample Space (S)

Totality of all outcomes of a random experiment. The outcome cannot be determined as


it is stochastic.

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

1. Probability of an event is between 0 and 1


0  P( A)  1
2. Probability sure event
P( S )  1
3. Bernoulli outcome
P( A  B)  P( A)  P( B) Provided that events A and B are mutually exclusive.

Mutually exclusive events

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

Operation on sets (Set Theory)

Let A and B be two events defined by the Sample Space as:

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

Draw venn diagram B  A  B  Ac

P( B)  P( A  B  Ac )
P( B)  P( A)  P( B  Ac )

A  B  Ac  
A  B  Ac   

Addition rule for non-mutually exclusive events

Non-mutually exclusive the intersection is not null. i.e. A  B   (Non-disjoined)


Venn diagram

P( A  B)  P( A)  P( B)  P( A  B)

Venn diagram

Dependent and Independent events

Let A and B be events defined on a Sample Space S . We define dependency or


independency using the conditional probability approach.

Conditional probability

Let A and B be two events, we define the conditional probability as P( A / B) and P( B / A)


. That is;

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)

If P( A / B)  P( A) it follows that A and B are independent. P( A / B)  P( A) are


dependent.
Example
Suppose P( A / B)  0.6 , P( A)  0.4 , P( B)  0.3

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)

Baye’s Theorem describes probability of an event based on prior knowledge of


conditions that might be related to the event.

Generalized based theorem


Let E , E , E ....E
1 2 3 K
be events on the sample space S .

Write down the Baye’s Theorem given; P( E i / B)

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

Maximum ( P( H / F ); P(S / F ); P(C / F )

P( H / F )  P( H )
P( H ) 
P( F / H )  P( H )  P( F / S )  P(C )

P( F )  (0.9  0.1)  (0.2  0.6)  (0.5  0.3)

 0.36

P( H / F )  0.09  0.36

 0.25

0.2  0.6
P( S / F ) 
0.36
 0.33

P(C / F )  0.5  0.3

 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.

The discrete random variable is specified by the probability of distribution function or


probability mass function or probability generating function. A random variable is
discrete if and only if;

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

Toss a coin (tree diagram)

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

Expectation and Variance of X


Expectation of X is given by E( X )   xP( X  x)

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

Continuous random variables


Takes any given value in an interval e.g. yield is continuous, temperature in an oven.
Probability density function is given by f ( X ) .

f ( X ) is a density function of X If and only if;



1. 
f ( x)dx  1
2. f ( x)  0
b
3. a
f ( x )  P ( a  X  b)


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

Discrete probability models


Used to model discrete random variables.
They are:
1. Binomial
2. Geometry
3. Poisson etc.
Binomial probability distribution model
For the random variable X to be modeled by a binomial distribution the following
conditions must be met;
1. Finite trials are performed
2. For each of the finite trial there’s a Bernoulli outcome i.e. exactly two possible
outcomes. One termed as a “success” and the other a “failure”
3. Probability of success and failure is known and fixed i.e. p and q .
4. Events “success” and “ failure” are mutually exclusive and exhaustive ( p  q  1 )
5. “Success” and “Failure” are independent P(S / F )  P(S ) or P( F / S )  P( F )

Now if X satisfies all the above conditions, X follows binomial any trials probability P
of success and any trials ( X B(n, p))

The probability generating function of X is given by;


n
P( X  r )  c p r q nr , r  0,1, 2,...
r

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)

q is the probability of failure

1st trial = q

1st and 2nd = q  q  q 2


Failing 3 times success = q  q  q  q3

Success 1st instant: p

Success 2nd: fail and succeed = qp

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

P( X  20)  (0.9)19 0.1

 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.

Consider the following


We record the number of patients admitted at Oshakati state hospital per day.
Day Number
1 15
2 7
3 20
4 6
5 1
6 0
7 10

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!

What is the probability number of people admitted per day is 4?

e8 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)]
e8  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

NB: lambda is proportional to time. That is;


What is the probability that 5 people will be admitted in 2 days?

e16 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

Two parameters are used to describe a normal random variable;


1. Mean (  )


2
2. Variance ( )

If X is normally distributed function of X ( f ( X ) ) is given by;


1  x 
2
1   
f (X )  e 2     X  
 2

Properties of a normal curve

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

To evaluate  f ( x) d ( x) is very complex. Since it is difficult to evaluate that, when


dealing with X that follows X N ( ; 2 ) we need to transform X  Z transformation
X 
of X  Z is called standardization. We transform using the formula Z  . Z will

be normally distributed with 0 and 1 ( Z N (0,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

Let a and b be real numbers (a, b  R) , Z be a standardized normal Random Variable.


1. P(Z  a)  (a)

Draw graph

2. p(a  Z  b)  P(Z  b)  P(Z  a)

 (b)  (a)

Draw graph

3. P(Z  a)  P(Z  a)

 1  P( Z  a )
 1   (a)

Draw graph

Using normal standardized table

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

Let Z be normal 0, 1 (Z N (0,1)) if P(Z  x)  b then, x  1 (b)

Example

Suppose we are given P(Z  x)  0.95 , find x

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;

a) Less than 21kg


b) Between 19kg and 22kg
c) Above 18kg

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)

You might also like