IE27_03_CountingTechniques

54

description

Study Materials for Statistics and ProbabilityUP Diliman BS Industrial Engineering IE 27 Course

Transcript of IE27_03_CountingTechniques

Page 1: IE27_03_CountingTechniques
Page 2: IE27_03_CountingTechniques

Quiz 1 will be on Tuesday, September 1, 2014, coverage is only up to this lecture

The Tentative Exam Schedule for IE 27 is as followsSeptember 16 (Tuesday) - First Long ExamOctober 13 (Monday) - Second Long ExamNovember 10 (Monday) - Third Long ExamDecember 5 (Friday) - Fourth Long Exam

December 12 (Friday) - Finals

Please indicate your full name at the back of every page of your homework

Submit your homework

Page 3: IE27_03_CountingTechniques

Today’s Agenda:Reliability

Counting Techniques

Page 4: IE27_03_CountingTechniques

What are the conditions to say that two events A & B are independent?

Review

P(A | B) = P(A)P(B | A) = P(B)

P(A ∩ B)= P(A)*P(B)

Given that two events are independent what is the P(A ∩ B)?

P(A ∩ B) = P(A)*P(B)

Page 5: IE27_03_CountingTechniques

The system works if there is a working path from X to Y. Assume the devices fail independently and that the

probabilities of functioning of each device is shown. What is the probability that the system works?

Reliability

0.8 0.9 0.7X Y

Let A, B & C be the event that each device worksA B C

The system works if A AND B AND C all workThe system works if A AND B AND C all work

The system works if there is a working path from X to Y. Assume the devices fail independently and that the

probabilities of functioning of each device is shown. What is the probability that the system works?

P(A ∩ B ∩ C) = ?

Since the events are independent we can multiply their probabilities

P(A ∩ B ∩ C) = P(A)*P(B)*P(C)

P(A ∩ B ∩ C) = (0.8)(0.9)(0.7)= 0.504

Page 6: IE27_03_CountingTechniques

The system works if there is a working path from X to Y. Assume the devices fail independently and that the

probabilities of functioning of each device is shown. What is the probability that the system works?

Reliability

0.8

0.7

X Y

Let A & B be the event that each device works

A

B

The system works if either A or B works

Or in other words all events EXCEPT when A & B both do not work

Page 7: IE27_03_CountingTechniques

The system works if there is a working path from X to Y. Assume the devices fail independently and that the

probabilities of functioning of each device is shown. What is the probability that the system works?

Reliability

0.8

0.7

X Y

A

B

All events EXCEPT when A & B both do not work

P(system) = 1 – P(A’)P(B’)

All events EXCEPT when A & B both do not work

P(system) = 1 – P(A’)P(B’)

All events EXCEPT when A & B both do not work

P(system) = 1 – P(A’)P(B’)

All events EXCEPT when A & B both do not work

P(system) = 1 – P(A’)P(B’)

Page 8: IE27_03_CountingTechniques

The system works if there is a working path from X to Y. Assume the devices fail independently and that the

probabilities of functioning of each device is shown. What is the probability that the system works?

Reliability

0.8

0.7

X Y

A

B

P(system) = 1 – P(A’)P(B’)

P(system) = 1 – (1 - 0.8)(1 - 0.7)

P(system) = 1 – (0.2)(0.3)

P(system) = 1 – (0.06)

P(system) = 0.94

Page 9: IE27_03_CountingTechniques

Find the probability that the system will work

Reliability

0.85

0.8

X Y

0.95

0.9

0.75

P(system) = 0.93746

Page 10: IE27_03_CountingTechniques

Find the probability that the device B works given the system works.

Reliability

0.85

0.8

X Y

0.95

Let B be the probability the B works and K be the probability that the system works

A B

C

P(K) = 0.9615?P(K) = 0.9615

P(B | K) =P(K)

P(B ∩ K)

0.9615

Page 11: IE27_03_CountingTechniques

Find the probability that the device B works given the system works.

Reliability

P(B ∩ K) = ?

Using the Total Probability Rule

P(B) = P(B ∩ K) + P(B ∩ K’)

P(B ∩ K) = P(B) - P(B ∩ K’)

0.85

0.8

X Y

0.95

A B

C

Page 12: IE27_03_CountingTechniques

Find the probability that the device B works given the system works.

Reliability

P(B ∩ K) = P(B) - P(B ∩ K’)

Given that B works, the only time the system will not work is when A & C are not working

P(B ∩ K) = 0.95 – (0.95)*(0.15)*(0.2)

P(B ∩ K) = 0.95 – 0.0285

P(B ∩ K) = 0.9215

0.85

0.8

X Y

0.95

A B

C

Page 13: IE27_03_CountingTechniques

Find the probability that the device B works given the system works.

Reliability

P(B | K) =0.9215

0.9615≈ 0.95840

Note: There is one more way to find P(B ∩ K). Finding this method will serve as a challenge to you

0.85

0.8

X Y

0.95

A B

C

Page 14: IE27_03_CountingTechniques

Counting Techniques

Fundamental Counting PrincipleIf task K1, K2… Km can be done in x1, x2… xm ways respectively, then the total number of

ways the tasks can be done in sequence from K1 to Km is the product of all n from n1

to nm

Page 15: IE27_03_CountingTechniques

The Eng’g Caf sells meals at a promo price. A meal consists of a soup, a viand, a dessert and a drink. The

menu consists of 3 kinds of soup, 5 kinds of viand, 4 kinds of dessert and 5 kinds of drinks. How many possible meal

combinations are there?

Counting Techniques

soup viand dessert drink

3 5 4 5x x x

300Possible meal combinations

Page 16: IE27_03_CountingTechniques

A password must only have 6 characters. The first character must be a capital letter and the last 2

characters must both be a number, the rest must only be a letter or a number. How many possible password

combinations are there?

Counting Techniques

26

619,652,800Possible password combinations

10

10

62

62

62

A password must only have 6 characters. The first character must be a capital letter and the last 2

characters must both be a number, the rest must only be a letter or a number. How many possible password

combinations are there?

A password must only have 6 characters. The first character must be a capital letter and the last 2

characters must both be a number, the rest must only be a letter or a number. How many possible password

combinations are there?

A password must only have 6 characters. The first character must be a capital letter and the last 2

characters must both be a number, the rest must only be a letter or a number. How many possible password

combinations are there?

A password must only have 6 characters. The first character must be a capital letter and the last 2

characters must both be a number, the rest must only be a letter or a number. How many possible password

combinations are there?

Page 17: IE27_03_CountingTechniques

In the recently concluded PBB: All In, Daniel, Maris, Jane and Vickie were announced as the BIG 4. How may ways

can I arrange them in all possible orders of winning?

Counting Techniques

4 3 2 1

There are still 4 possible housemates we can place at the first spot

Only 3 are available for the second spot as we already assigned a housemate to the first spot

Having filled the first two spots, we only have two housemates to choose from

And the last housemate fills the last spot

Page 18: IE27_03_CountingTechniques

In the recently concluded PBB: All In, Daniel, Maris, Jane and Vickie were announced as the BIG 4. How may ways

can I arrange them in all possible orders of winning?

Counting Techniques

4 3 2 1x x x

= 4!

= 24

Page 19: IE27_03_CountingTechniques

PBB: All In has a total of 18 housemates. How many ways can I select a Big Winner, 2nd Big Placer, 3rd Big Placer and

4th Big Placer from these 18 housemates?

Counting Techniques

18!NO! We only need to arrange 4 of the 18 and not all 18

housemates

Page 20: IE27_03_CountingTechniques

PBB: All In has a total of 18 housemates. How many ways can I select a Big Winner, 2nd Big Placer, 3rd Big Placer and

4th Big Placer from these 18 housemates?

Counting Techniques

18

17

16

15

x x x

=73,440

This is what we call a Permutation

Page 21: IE27_03_CountingTechniques

Counting Techniques

Permutation

All possible arrangements of a set where order is important

Given a set of n elements, the number of permutations of a subset of r elements

(taken at a time is

nPr = (n-r)!

n!

Page 22: IE27_03_CountingTechniques

PBB: All In has a total of 18 housemates. How many ways can I select a Big Winner, 2nd Big Placer, 3rd Big Placer and

4th Big Placer from these 18 housemates?

Counting Techniques

In this example n = 18 and r = 4

18P4 = (18-4)!

18!

18P4 = 14!

18!

18P4 = 18 x 17 x 16 x 15

18P4 = 73,440

Page 23: IE27_03_CountingTechniques

A building has 5 unique security spots. The company has a total of 8 guards. How many ways can the company

assign exactly 1 guard to each security spot?

Counting Techniques

In this example n = 8 and r = 5

8P5 = (8-5)!

8!

8 x 7 x 6 x 5 x 4

6,720 ways

Page 24: IE27_03_CountingTechniques

How many ways can the PBB: All In Big 4 sit on a round table?

Counting Techniques

4! NOPE!

Page 25: IE27_03_CountingTechniques

Counting Techniques

Circular Permutation

The number of permutations of n different elements arranged in a circle is (n-1)!

Page 26: IE27_03_CountingTechniques

Counting Techniques

Let us examine…

In a circle

A

B

C

D

D

A

B

C

B

C

D

AD

C

A

B

These arrangements are all the same, it is just a matter of perspective

Page 27: IE27_03_CountingTechniques

Counting Techniques

Let us examine…

Thus we set one element in a stationary position

A

?

?

?

A

?

?

?

A

?

?

??

A

?

?

Then we find all possible arrangements of the remaining elements

Thus the formula (n-1)!

Page 28: IE27_03_CountingTechniques

How many ways can the PBB: All In Big 4 sit on a round table?

Counting Techniques

= 3!= 6

Page 29: IE27_03_CountingTechniques

How many ways can I rearrange the letters in the word “MICO”

Counting Techniques

4 3 2 1

= 4!

= 24

Page 30: IE27_03_CountingTechniques

How many ways can I rearrange the letters in the word “ABACA”

Counting Techniques

= 5! This would be true if all the A’s are unique

AAABC AAABC AAABCAAABC AAABC AAABC

But they are NOT unique!

AAABC AAABC AAABCAAABC AAABC AAABC

So in reality all these arrangements is just 1 arrangement

But they are included in the 5! Count so we have to remove them from the total count

Since 3! Is the number of ways we can interchange the A’s we divide 5! (the total) with 3!

Page 31: IE27_03_CountingTechniques

How many ways can I rearrange the letters in the word “ABACA”

Counting Techniques

= 5! 3!

= 20This is what we call Partition Permutation

Page 32: IE27_03_CountingTechniques

Counting Techniques

How many ways can I arrange 3 copies of Montgomery, 4 copies of Taha and 2 copies of Leithold in a book shelf?

9! 3!

How many ways can I arrange 3 copies of Montgomery, 4 copies of Taha and 2 copies of Leithold in a book

shelf?

4! 2!

How many ways can I arrange 3 copies of Montgomery, 4 copies of Taha and 2 copies of

Leithold in a book shelf?

How many ways can I arrange 3 copies of Montgomery, 4 copies of Taha and 2 copies of

Leithold in a book shelf?

How many ways can I arrange 3 copies of Montgomery, 4 copies of Taha and 2 copies of

Leithold in a book shelf?

M M M T T T T L L

= 1,260

Page 33: IE27_03_CountingTechniques

Counting Techniques

The formula for general permutation is actually taken from the concept of Partition Permutation

Let us prove

Page 34: IE27_03_CountingTechniques

Counting Techniques

How many ways can I select a Big Winner, 2nd Big Placer, 3rd Big Placer and 4th Big Placer from the set of final 8

housemates?

8P4 = (8-4)!

8!

Page 35: IE27_03_CountingTechniques

Counting Techniques

How many ways can I select a Big Winner, 2nd Big Placer, 3rd Big Placer and 4th Big Placer from the set of final 8

housemates?

1234XXXX

1XX42X3X

13XXXX24

Page 36: IE27_03_CountingTechniques

Counting Techniques

How many ways can I select a Big Winner, 2nd Big Placer, 3rd Big Placer and 4th Big Placer from the set of final 8

housemates?

1234XXXXTechnically it is just the number of ways I can arrange the

string “X X X X 1 2 3 4”

By Partition Permutation

8! 4!8P4 =

(8-4)!

8!=

1,680

Page 37: IE27_03_CountingTechniques

Counting Techniques

How many ways can I select a Final Four from the set of final 8 housemates?

Let us use Partition Permutation again

4444XXXX

4X4XXX44

4XX44X4X

Page 38: IE27_03_CountingTechniques

Counting Techniques

How many ways can I select a Final Four from the set of final 8 housemates?

Let us use Partition Permutation again

4444XXXXTechnically it is just the number of ways I can arrange the

string “X X X X 4 4 4 4”

By Partition Permutation

8! 4! 4!

= 70Permutations with no

specific order is called

COMBINATION

Page 39: IE27_03_CountingTechniques

Counting Techniques

Combination

Number of ways of selecting r objects from n elements where order is not important

Given a set of n elements, the number of combination of a subset of r elements (taken

at a time is

nCr = (n-r)!r!

n!

nCr =

r

n

Page 40: IE27_03_CountingTechniques

Counting Techniques

How many ways can I select a Final Four from the set of final 8 housemates?

8C4 =

4

8 8! 4!

= 4!

= 70

Page 41: IE27_03_CountingTechniques

Counting TechniquesIn a class 10 students, how many ways can I select 3

volunteers for board work?

10C3 =

3

10

10!= (10-3)!3!

= 120

n = 10 r = 3

10!= 7!3!

V V V N N N N N N N

Page 42: IE27_03_CountingTechniques

Counting Techniques

How many ways can I be dealt a hand of 13 cards from a standard deck of cards?

52C13 =

13

52

52!= (52-13)!

13!= 6.35014 x

1011

n = 52 r = 13

52!= 39!13!

Page 43: IE27_03_CountingTechniques

Counting Techniques

What we know so far

Line Permutationn!

Circular Permutation(n-1)!

Partition Permutation

n1!n2!...nm!

n!

FPC(x1)(x2)…

(xm) Permutation

nPr = (n-r)!

n!

Combination

nCr = (n-r)!r!

n!

Page 44: IE27_03_CountingTechniques

Examples

How many ways can I arrange 6 Boys and 3 girls in a line if all the girls must be beside each other?

B1 B2 B3 B4 B5 B6 G1 G2 G3

Since all the girls must be beside each other, we can treat them as 1 entity first

I can now rearrange these 7 individual entities (6 boys + girl group) how many ways?

7!3!

Plus an additional 3! Because the three girls can switch places

3! = 30,240

Page 45: IE27_03_CountingTechniques

Examples

How many ways can I arrange 10 students in a line if 2 of them cannot be beside each other?

= total arrangements minus number of ways the 2 sit beside each other

= total arrangements minus number of ways the 2 sit beside each other

= 10! – 9!2!

= total arrangements minus number of ways the 2 sit beside each other

= 10! – 9!2!

= 2,903,400

Page 46: IE27_03_CountingTechniques

Examples

Twenty distinct cars park in the same parking lot everyday. Ten of these cars are US-made, while the other ten are Japan-made. This parking lot has exactly twenty spaces, and all are in a row,

so the cars park side by side each day. The drivers have different schedules on any given day, however, so the position

any car might take on a certain day is random. What is the probability that on a given day, the cars will park in such a way

that they alternate (e.g., US-made, Japan-made, US-made, etc.)?

Page 47: IE27_03_CountingTechniques

Examples

I have 3 different books related to math, 5 different books related to science and 6 literature books. How many ways can I

arrange them in a bookshelf if all books of the same subject must be beside each other?

Page 48: IE27_03_CountingTechniques

Examples

What is the probability that in 7 coin tosses, exactly 5 comes up tails?

Page 49: IE27_03_CountingTechniques

Examples

What is the probability that in 7 coin tosses, at least 5 comes up tails?

Page 50: IE27_03_CountingTechniques

Examples

If I am dealt 5 cards, what is the probability that I am dealt with exactly 2 aces?

Page 51: IE27_03_CountingTechniques

Examples

If I am dealt 5 cards, what is the probability that it is a full house (3 of a kind + 2 of a kind)?

Page 52: IE27_03_CountingTechniques

Examples

In a delivery of 20 boxes, 4 are known to be defective. If I select 3 boxes at random what is the probability that I select exactly 2

boxes that is defective?

Page 53: IE27_03_CountingTechniques

Source: Taha

Next Time on IE 27

Random Variable

PMF, PDF

Discrete Probability Distributions

Page 54: IE27_03_CountingTechniques

.Fin.