Beruflich Dokumente
Kultur Dokumente
KNF2053
Numerical Methods and Statistics
Probability
Definition of Probability
Random Experiment
Sample space, S
Sample space, S
Example 1
Experiment: E :Tossing a die
Sample Space: S = {1,2,3,4,5,6}
Event:
Sample space, S
Simple exercise
A dice is tossed once.
a) What is the sample space, S?
b) Give the set of the following events
i.
ii.
Sample space, S
Simple exercise
A coin is tossed twice
a) What is the sample space, S?
b) Give the set of the following events:
i.
ii.
Include
A
B include A is denoted as B A.
All the elements of A is also
belonging to B.
Equal
A equal to B is denoted A = B. It
means A B and B A. A
happen if and only if B happen.
S
A=B
Union
Denoted by the symbol A B,
is the event containing all the
elements that belong to A and
B or both.
Intersection
Denoted by the symbol A B,
is the event containing all
elements that common to A and
B
Mutually exclusive or
disjoint
A and B are mutually exclusive,
or disjoint if A and B cannot
happen at the same time
(A B = )
Complement
The complement of an event A
with respect to S is the subset
of all elements of S that are not
A
B
S
A'
A
Axioms of Probability
P () = 0
P (A) = 1 P(A)
Example 1
The probability that John passes Mathematics is 2/3,
and the probability he passes English is 3/9. If the
probability of passing both subjects is 1/4, what is
the probability that John will pass at least one of
these subjects?
Let M : the event passing Math
Let E : the event passing English
Example 1-Solution
The probability that John will pass at least one of
these subjects.
Let M : the event passing Math
Let E : the event passing English
P( M E ) P( M ) P( E ) P( M E )
2 3 1
3 9 4
3
mn
Permutation
n!
Pr n: no. of object
(n r )!
r: no. of ways
Permutation
n!
Pr
n: no.
n ofr!object
r: no. of ways
Pr n
Example 2
Pr 265
11881376
n!
26!
Pr
7893600
(n r )! (26 5)!
Combination
Denotes by nCr
Without repetition:
3 combinations ab, ac and bc
With repetitions:
6 combinations aa, ab , ac, bb, bc and cc
Combination
n
n!
Cr
r r!(n r )!
n r 1
(n r 1)!
Cr
r r!((n r 1) r )!
Pr nCr r!
Example 3
Example 3 - Solution
a)
n
3!
Cr
3
r 2!(3 2)!
n r 1
4!
Cr
6
r 2!(4 2)!
Example 3 - Solution
b)
Pr nCr r!
3 2!
6
Pr nCr r!
6 2!
12
Conditional Probability
Example:
A : rain next Sunday
B : rain next Saturday
Conditional Probability
P( A B)
P( A | B)
P( B)
Example 4
Example 4 - Solution
event A = {1,2,3}
event B = {1,3,5}
P( A B)
P( B)
A B {1,3}
2 1
P( A B)
6 3
3 1
P( B)
6 2
P( A | B)
1
P( A B)
2
3
P( A | B)
1
P( B)
3
2
Multiplicative Rule
P ( A B ) P ( A) P ( B | A)
or equivalently
P( A B) P( B) P( A | B)
Independent Events
P( A B) P( A) P( B)
Remarks:
When P(B) > 0, A and B are independent
P(A|B) = P(A)
When P(A) = 0 or P(B) = 0, A and B are
independent
Example 5
Lets consider when a coin is tossed twice. Let A
= head appears in the first time and B = Tail
appears in the second time. Show that A and B
are independent events.
Example 5 - Solution
S = {(H,H), (H,T), (T,H), (T,T)}
A = head appears in the first time = {(H,H),
(H,T)}
B = Tail appears in the second time = {(H,T),
(T,T)}
P(B) > 0, so:
P( A | B)
P( A B)
1
4
2
P( B)
2
4
Bayes Rule
S
A
We may express A as
A B'
A B
A ( A B) ( A B ' )
P ( A) P( A B) P( A B' )
P( A | B) P( B) P( A | B' ) P( B' )
Bayes Rule
Definition:
S
A3
A1
A2
A4
A5
P( B) P( B Ai )
i 1
n
P( B | Ai )P( Ai )
S
B
A3
i 1
A2
A1
A4
A5
Bayes Rule
P( Ai B )
P( B | Ai ) P( Ai )
P( Ai | B )
n
P( B)
P( B | Ai ) P( Ai )
i 1
For i = 1, 2, , n
Example 6
In a factory, production line A,B and C are all
producing boxes with the same size. On their
production, production line A, B and C produce 1%,
2% and 3% defective boxes, respectively. Of the
total production, line A produces 25%, line B
produces 35% and line C produces 40%. A box is
selected randomly from the total production of a day
a) what is the probability that it is defective?
b) if the box is defective, what is the conditional
probability that it was produced by line C?
Example 6 - Solution
Let D = defective box
A = box from line A
B = box from line B
C = box from line C
a)
P ( D) P( D A) P ( D B) P ( D C )
P( D | A) P( A) P( D | B ) P( B ) P ( D | C ) P (C )
1 25 2 35 3 40
10000 2000
Example 6 - Solution
b) By Bayes Theorem
P(C ) P ( D | C )
P (C | D)
P( D)
40
3
100 100
43
2000
24
43