SlideShare a Scribd company logo
1 of 64
Unit VI
Discrete Structures
Permutations and Combinations
SE (Comp.Engg.)
• BOTH
• PERMUTATIONS AND COMBINATIONS
• USE A COUNTING METHOD CALLED
FACTORIAL
• Lets start with a simple example.
• A student is to roll a die and flip a
coin. How many possible outcomes will
there be?
• 1H 2H 3H 4H 5H 6H
• 1T 2T 3T 4T 5T 6T
• The number of ways to arrange the letters
ABC:
____ ____ ____
Number of choices for first blank? 3 ____ ____
3 2 ___
Number of choices for second blank?
Number of choices for third blank? 3 2 1
Permutations
• A Permutation is an arrangement of
items in a particular order.
The number of Permutations of n items
chosen r at a time, is given by the
formula
.
0
where n
r
r
n
n
r
p
n 



)!
(
!
• Arrange 2 alphabets from a,b,c.
• ab, ba, ac,ca,bc,cb
• 3P2=3!/(3-2)!=6
• A combination lock will open when the
right choice of three numbers (from 1
to 30, inclusive) is selected. How many
different lock combinations are possible
assuming no number is repeated?
24360
28
*
29
*
30
)!
3
30
(
!
30
3
30 




27!
30!
p
CIRCULAR
PERMUTATIONS
When items are in a circular
format, to find the number of
different arrangements,
divide:
n! / n
• Six students are sitting around a circular table
in the cafeteria. How many different seating
arrangements are there?
•6!  6 = 120
Combination
• A Combination is an arrangement of
items in which order does not matter.
.
0
where n
r
r
n
r
n
r
C
n




)!
(
!
!
The number of Combinations of n
items chosen r at a time, is given by
the formula
• To play a particular card game, each
player is dealt five cards from a
standard deck of 52 cards. How many
different hands are possible?
960
,
598
,
2
1
*
2
*
3
*
4
*
5
48
*
49
*
50
*
51
*
52
)!
5
52
(
!
5
!
52
5
52





5!47!
52!
C
• A student must answer 3 out of 5 essay
questions on a test. In how many
different ways can the student select
the questions?
10
1
*
2
4
*
5
)!
3
5
(
!
3
!
5
3
5 




3!2!
5!
C
Product and Sum Rules
• Product Rule:
• If we need to perform procedure 1 AND
procedure 2.
There are n1 ways to perform procedure 1 and n2
ways to perform procedure 2.
• There are n1•n2 ways to perform procedure 1 AND
procedure 2.
• Sum Rule:
If need to perform either procedure 1 OR
procedure 2. There are n1 ways to perform
procedure 1 and n2 ways to perform procedure 2.
• There are n1+n2 ways to perform procedure 1 OR
procedure 2.
• This “OR” is an “exclusive OR.” One choice or the other, but
not both.
• How many vehicle number plates can be
made if each plate contains two different
letters followed by three different digits
Two different letters are made in 26P2 ways.
3 different digits are combined in 10P3ways
Total no. of number plates= 26P2 * 10P3
=26!*10!/(24!*7!)
=26*25*10*9*8
=468000
• An 8 member team is to be formed from a
group of 10 men and 15 women. In how many
ways can the team be chosen if :
(i) The team must contain 4 men and 4 women
(ii) There must be more men than women
(iii) There must be at least two men
The team must contain 4 men and 4 women =
286650
(ii) There must be more men than women =
(iii) There must be at least two men
• Passwords consist of character strings of 6 to 8
characters. Each character is an upper case
letter or a digit. Each password must contain
at least one digit.
• How many passwords are possible?
• Total number is
• # passwords with 6 char. + # passwords
with 7 char. + # pws 8 char.
• (=P6+P7+P8).
• P6: # possibilities without constraint : 366
• # exclusions is # passwords without any
digits is 266
• And so, P6 = 366-266
• Similarly, P7 = 367-267 and P8 = 368-268
• P = P6+P7+P8 = 366-266 + 367-267 + 368-2
• How many bit-strings of length 8 either begin
with 1 or end with 00?
• A = 8-bit strings starting with 1
• |A| = # of 8-bit strings starting with 1 is 27
• B = 8-bit strings starting with 00
• |B| = # of 8-bit strings ending with 00 is 26
• # of bit-strings begin with 1 and end with 00 is
25.
• # of 8-bit strings starting with 1 or ending with
00 is
• 27+ 26- 25
• |AB| = |A| + |B| - |AB|
• Inclusion–Exclusion Principle
33
Permutations with
non-distinguishable objects
• The number of different permutations of n
objects, where there are non-distinguishable
objects of type 1, non-distinguishable objects
of type 2, …, and non-distinguishable objects
of type k, is
i.e., C(n, )C(n- , )…C(n- - -…- , )
1 2
!
! !... !
k
n
n n n
1
n
2
n
k
n
1
n 1
n 2
n 1
n 2
n 1
k
n  k
n
1 2 ... k
n n n n
   
• How many different strings can be made by
reordering the letters of the word
OFF
• 3!/2!=3
• OFF
• FFO
• FOF
• ONE
• OEN
• NEO
• NOE
• ENO
• EON
• How many different strings can be made by
reordering the letters of the word
SUCCESS
Generating Permutations
Lexicographic method
• For the following 4
• combinations from the set f= {1;2;3;4;5;6;7}
find the combination that immediately follows
them in lexicographic order
1234 is followed by
3467 is followed by
4567 is followed by
What is probability?
• Probability is the measure of how likely an
event or outcome is.
• Different events have different probabilities!
How do we describe probability?
• You can describe the probability of an event with the
following terms:
– certain (the event is definitely going to happen)
– likely (the event will probably happen, but not definitely)
– unlikely (the event will probably not happen, but it might)
– impossible (the event is definitely not going to happen)
• probabilities are expressed as fractions.
– The numerator is the number of ways the event
can occur.
– The denominator is the number of possible events
that could occur.
6.43
Random Experiment…
• …a random experiment is an action or process
that leads to one of several possible
outcomes. For example:
Experiment Outcomes
Flip a coin Heads, Tails
Exam Marks Numbers: 0, 1, 2, ..., 100
Assembly Time t > 0 seconds
Course Grades F, D, C, B, A, A+
What is the probability that I will choose a
red marble?
• In this bag of marbles, there are:
– 3 red marbles
– 2 white marbles
– 1 purple marble
– 4 green marbles
Probability example
• Sample space: the set of all possible outcomes.
• Probabilities: the likelihood of each of the possible outcomes
(always 0 P 1.0).
)
(
1
)
(
)
(
1
)
(
1
)
(
)
(
1
)
(
0
E
P
E
P
E
P
E
P
E
P
E
P
E
P








6.46
Probabilities…
• List the outcomes of a random experiment…
• This list must be exhaustive, i.e. ALL possible
outcomes included.
• Die roll {1,2,3,4,5} Die roll {1,2,3,4,5,6}
• The list must be mutually exclusive, i.e. no
two outcomes can occur at the same time:
• Die roll {odd number or even number}
• Die roll{ number less than 4 or even number}
• A and B are independent if and only if
P(A&B)=P(A)*P(B)
• A and B are mutually exclusive events:
P(A or B) = P(A) + P(B)
6.48
Events & Probabilities…
• The probability of an event is the sum of the
probabilities of the simple events that constitute
the event.
• E.g. (assuming a fair die) S = {1, 2, 3, 4, 5, 6} and
• P(1) = P(2) = P(3) = P(4) = P(5) = P(6) = 1/6
• Then:
• P(EVEN) = P(2) + P(4) + P(6) = 1/6 + 1/6 + 1/6 =
3/6 = 1/2
Female
Low
Male
e.g. 1. The following table gives data on the type of car, grouped by
petrol consumption, owned by 100 people.
4
21
23
7
33
12
High
Medium
One person is selected at random.
L is the event “the person owns a low rated car”
F is the event “a female is chosen”.
Find (i) P(L) (ii) P(F  L) (iii) P(F| L)
100
Total
(i) P(L) =
Solution:
Find (i) P(L) (ii) P(F  L) (iii) P(F L)
100
4
21
23
Female
7
33
12
Male
High
Medium
Low
20 20
7

7
35
100
(ii) P(F  L) =
23
Total
100
(iii) P(F L) 
23
Notice that
P(L)  P(F L)
35
23
20
7


100
23

So, P(F  L) = P(F|L)  P(L)
= P(F  L)
35
5
1
45
R
F
e.g. 2. I have 2 packets of seeds. One contains 20 seeds and
although they look the same, 8 will give red flowers and 12 blue.
The 2nd packet has 25 seeds of which 15 will be red and 10 blue.
Draw a Venn diagram and use it to illustrate the conditional
probability formula.
Solution:
15
10
12
P(R  F) =
P(F) =
P(R F) =
8
8
45
20
8
45
20
20
8

P(R  F) = P(R|F)  P(F)
So,
P(R F)  P(F) =

20
45
45
8

1
1
Let R be the event “ Red flower ” and
F be the event “ First packet ”
Bayes’ Rule: derivation
)
(
)
&
(
)
/
(
B
P
B
A
P
B
A
P 
• Definition:
Let A and B be two events with P(B)  0. The
conditional probability of A given B is:
     
       
B
A
P
B
P
B
A
P
B
P
B
A
P
B
P
A
B
P
|~
~
|
|
|


Example
• Three jars contain colored balls as described in the table
below.
– One jar is chosen at random and a ball is selected. If the ball is red,
what is the probability that it came from the 2nd jar?
Jar # Red White Blue
1 3 4 1
2 1 2 3
3 4 3 2
Example
• We will define the following events:
– J1 is the event that first jar is chosen
– J2 is the event that second jar is chosen
– J3 is the event that third jar is chosen
– R is the event that a red ball is selected
Example
• The events J1 , J2 , and J3 mutually exclusive
– Why?
• You can’t chose two different jars at the same time
• Because of this, our sample space has been
divided or partitioned along these three
events
Venn Diagram
• Let’s look at the Venn Diagram
Venn Diagram
• All of the red balls are in the first, second, and
third jar so their set overlaps all three sets of
our partition
Finding Probabilities
• What are the probabilities for each of the
events in our sample space?
• How do we find them?
     
B
P
B
A
P
B
A
P |


Computing Probabilities
• Similar calculations
show:
     
8
1
3
1
8
3
| 1
1
1 



 J
P
J
R
P
R
J
P
     
     
27
4
3
1
9
4
|
18
1
3
1
6
1
|
3
3
3
2
2
2










J
P
J
R
P
R
J
P
J
P
J
R
P
R
J
P
Venn Diagram
• Updating our Venn Diagram with these
probabilities:
Where are we going with this?
• Our original problem was:
– One jar is chosen at random and a ball is selected.
If the ball is red, what is the probability that it
came from the 2nd jar?
• In terms of the events we’ve defined we want:
   
 
R
P
R
J
P
R
J
P

 2
2 |
Finding our Probability
   
 
 
     
R
J
P
R
J
P
R
J
P
R
J
P
R
P
R
J
P
R
J
P









3
2
1
2
2
2 |
   
     
17
.
0
71
12
27
4
18
1
8
1
18
1
|
3
2
1
2
2




































R
J
P
R
J
P
R
J
P
R
J
P
R
J
P

More Related Content

Similar to unit-3-permutation_combination.pptx

counting techniques
counting techniquescounting techniques
counting techniquesUnsa Shakir
 
AI-04 Production System - Search Problem.pptx
AI-04 Production System - Search Problem.pptxAI-04 Production System - Search Problem.pptx
AI-04 Production System - Search Problem.pptxPankaj Debbarma
 
SRWColAlg6_09_01.ppt
SRWColAlg6_09_01.pptSRWColAlg6_09_01.ppt
SRWColAlg6_09_01.pptRizaCatli2
 
PERMUTATION & COMBINATION
PERMUTATION & COMBINATIONPERMUTATION & COMBINATION
PERMUTATION & COMBINATIONPawan Mishra
 
powerpoints probability.pptx
powerpoints probability.pptxpowerpoints probability.pptx
powerpoints probability.pptxcarrie mixto
 
Counting, pigeonhole, permuntation, Permutations and Combination ,Binomial T...
Counting,  pigeonhole, permuntation, Permutations and Combination ,Binomial T...Counting,  pigeonhole, permuntation, Permutations and Combination ,Binomial T...
Counting, pigeonhole, permuntation, Permutations and Combination ,Binomial T...sheiblu
 
[Maths] arithmetic
[Maths] arithmetic[Maths] arithmetic
[Maths] arithmeticOurutopy
 
6. Permutations and Combinations-Revised (1).pptx
6. Permutations and Combinations-Revised (1).pptx6. Permutations and Combinations-Revised (1).pptx
6. Permutations and Combinations-Revised (1).pptxTonmoyKabiraj
 
Notes on permutations and combinations
Notes on permutations and combinationsNotes on permutations and combinations
Notes on permutations and combinationsadeelashiq
 
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjek
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjekAIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjek
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjekpavan402055
 
Binomial distribution good
Binomial distribution goodBinomial distribution good
Binomial distribution goodZahida Pervaiz
 

Similar to unit-3-permutation_combination.pptx (20)

Probability Theory for Data Scientists
Probability Theory for Data ScientistsProbability Theory for Data Scientists
Probability Theory for Data Scientists
 
Counting
CountingCounting
Counting
 
counting techniques
counting techniquescounting techniques
counting techniques
 
Qa04 hcf & lcm
Qa04 hcf & lcmQa04 hcf & lcm
Qa04 hcf & lcm
 
5Enote5.ppt
5Enote5.ppt5Enote5.ppt
5Enote5.ppt
 
5Enote5.ppt
5Enote5.ppt5Enote5.ppt
5Enote5.ppt
 
AI-04 Production System - Search Problem.pptx
AI-04 Production System - Search Problem.pptxAI-04 Production System - Search Problem.pptx
AI-04 Production System - Search Problem.pptx
 
SRWColAlg6_09_01.ppt
SRWColAlg6_09_01.pptSRWColAlg6_09_01.ppt
SRWColAlg6_09_01.ppt
 
PERMUTATION & COMBINATION
PERMUTATION & COMBINATIONPERMUTATION & COMBINATION
PERMUTATION & COMBINATION
 
powerpoints probability.pptx
powerpoints probability.pptxpowerpoints probability.pptx
powerpoints probability.pptx
 
Counting, pigeonhole, permuntation, Permutations and Combination ,Binomial T...
Counting,  pigeonhole, permuntation, Permutations and Combination ,Binomial T...Counting,  pigeonhole, permuntation, Permutations and Combination ,Binomial T...
Counting, pigeonhole, permuntation, Permutations and Combination ,Binomial T...
 
[Maths] arithmetic
[Maths] arithmetic[Maths] arithmetic
[Maths] arithmetic
 
Counting DM
Counting DMCounting DM
Counting DM
 
Probability
ProbabilityProbability
Probability
 
6. Permutations and Combinations-Revised (1).pptx
6. Permutations and Combinations-Revised (1).pptx6. Permutations and Combinations-Revised (1).pptx
6. Permutations and Combinations-Revised (1).pptx
 
Probability.ppt
Probability.pptProbability.ppt
Probability.ppt
 
Notes on permutations and combinations
Notes on permutations and combinationsNotes on permutations and combinations
Notes on permutations and combinations
 
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjek
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjekAIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjek
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjek
 
Permutation and combination
Permutation and combinationPermutation and combination
Permutation and combination
 
Binomial distribution good
Binomial distribution goodBinomial distribution good
Binomial distribution good
 

Recently uploaded

VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 

Recently uploaded (20)

VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 

unit-3-permutation_combination.pptx

  • 1. Unit VI Discrete Structures Permutations and Combinations SE (Comp.Engg.)
  • 2. • BOTH • PERMUTATIONS AND COMBINATIONS • USE A COUNTING METHOD CALLED FACTORIAL
  • 3. • Lets start with a simple example. • A student is to roll a die and flip a coin. How many possible outcomes will there be?
  • 4. • 1H 2H 3H 4H 5H 6H • 1T 2T 3T 4T 5T 6T
  • 5. • The number of ways to arrange the letters ABC: ____ ____ ____ Number of choices for first blank? 3 ____ ____ 3 2 ___ Number of choices for second blank? Number of choices for third blank? 3 2 1
  • 6. Permutations • A Permutation is an arrangement of items in a particular order. The number of Permutations of n items chosen r at a time, is given by the formula . 0 where n r r n n r p n     )! ( !
  • 7. • Arrange 2 alphabets from a,b,c. • ab, ba, ac,ca,bc,cb • 3P2=3!/(3-2)!=6
  • 8. • A combination lock will open when the right choice of three numbers (from 1 to 30, inclusive) is selected. How many different lock combinations are possible assuming no number is repeated?
  • 10. CIRCULAR PERMUTATIONS When items are in a circular format, to find the number of different arrangements, divide: n! / n
  • 11. • Six students are sitting around a circular table in the cafeteria. How many different seating arrangements are there?
  • 12. •6!  6 = 120
  • 13. Combination • A Combination is an arrangement of items in which order does not matter. . 0 where n r r n r n r C n     )! ( ! ! The number of Combinations of n items chosen r at a time, is given by the formula
  • 14. • To play a particular card game, each player is dealt five cards from a standard deck of 52 cards. How many different hands are possible?
  • 16. • A student must answer 3 out of 5 essay questions on a test. In how many different ways can the student select the questions?
  • 18. Product and Sum Rules • Product Rule: • If we need to perform procedure 1 AND procedure 2. There are n1 ways to perform procedure 1 and n2 ways to perform procedure 2. • There are n1•n2 ways to perform procedure 1 AND procedure 2.
  • 19. • Sum Rule: If need to perform either procedure 1 OR procedure 2. There are n1 ways to perform procedure 1 and n2 ways to perform procedure 2. • There are n1+n2 ways to perform procedure 1 OR procedure 2. • This “OR” is an “exclusive OR.” One choice or the other, but not both.
  • 20. • How many vehicle number plates can be made if each plate contains two different letters followed by three different digits
  • 21. Two different letters are made in 26P2 ways. 3 different digits are combined in 10P3ways Total no. of number plates= 26P2 * 10P3 =26!*10!/(24!*7!) =26*25*10*9*8 =468000
  • 22. • An 8 member team is to be formed from a group of 10 men and 15 women. In how many ways can the team be chosen if : (i) The team must contain 4 men and 4 women (ii) There must be more men than women (iii) There must be at least two men
  • 23. The team must contain 4 men and 4 women = 286650 (ii) There must be more men than women = (iii) There must be at least two men
  • 24. • Passwords consist of character strings of 6 to 8 characters. Each character is an upper case letter or a digit. Each password must contain at least one digit. • How many passwords are possible?
  • 25. • Total number is • # passwords with 6 char. + # passwords with 7 char. + # pws 8 char. • (=P6+P7+P8).
  • 26. • P6: # possibilities without constraint : 366 • # exclusions is # passwords without any digits is 266 • And so, P6 = 366-266
  • 27. • Similarly, P7 = 367-267 and P8 = 368-268
  • 28. • P = P6+P7+P8 = 366-266 + 367-267 + 368-2
  • 29. • How many bit-strings of length 8 either begin with 1 or end with 00?
  • 30. • A = 8-bit strings starting with 1 • |A| = # of 8-bit strings starting with 1 is 27 • B = 8-bit strings starting with 00 • |B| = # of 8-bit strings ending with 00 is 26 • # of bit-strings begin with 1 and end with 00 is 25.
  • 31. • # of 8-bit strings starting with 1 or ending with 00 is • 27+ 26- 25
  • 32. • |AB| = |A| + |B| - |AB| • Inclusion–Exclusion Principle
  • 33. 33 Permutations with non-distinguishable objects • The number of different permutations of n objects, where there are non-distinguishable objects of type 1, non-distinguishable objects of type 2, …, and non-distinguishable objects of type k, is i.e., C(n, )C(n- , )…C(n- - -…- , ) 1 2 ! ! !... ! k n n n n 1 n 2 n k n 1 n 1 n 2 n 1 n 2 n 1 k n  k n 1 2 ... k n n n n    
  • 34. • How many different strings can be made by reordering the letters of the word OFF
  • 35. • 3!/2!=3 • OFF • FFO • FOF
  • 36. • ONE • OEN • NEO • NOE • ENO • EON
  • 37. • How many different strings can be made by reordering the letters of the word SUCCESS
  • 39. • For the following 4 • combinations from the set f= {1;2;3;4;5;6;7} find the combination that immediately follows them in lexicographic order 1234 is followed by 3467 is followed by 4567 is followed by
  • 40. What is probability? • Probability is the measure of how likely an event or outcome is. • Different events have different probabilities!
  • 41. How do we describe probability? • You can describe the probability of an event with the following terms: – certain (the event is definitely going to happen) – likely (the event will probably happen, but not definitely) – unlikely (the event will probably not happen, but it might) – impossible (the event is definitely not going to happen)
  • 42. • probabilities are expressed as fractions. – The numerator is the number of ways the event can occur. – The denominator is the number of possible events that could occur.
  • 43. 6.43 Random Experiment… • …a random experiment is an action or process that leads to one of several possible outcomes. For example: Experiment Outcomes Flip a coin Heads, Tails Exam Marks Numbers: 0, 1, 2, ..., 100 Assembly Time t > 0 seconds Course Grades F, D, C, B, A, A+
  • 44. What is the probability that I will choose a red marble? • In this bag of marbles, there are: – 3 red marbles – 2 white marbles – 1 purple marble – 4 green marbles
  • 45. Probability example • Sample space: the set of all possible outcomes. • Probabilities: the likelihood of each of the possible outcomes (always 0 P 1.0). ) ( 1 ) ( ) ( 1 ) ( 1 ) ( ) ( 1 ) ( 0 E P E P E P E P E P E P E P        
  • 46. 6.46 Probabilities… • List the outcomes of a random experiment… • This list must be exhaustive, i.e. ALL possible outcomes included. • Die roll {1,2,3,4,5} Die roll {1,2,3,4,5,6} • The list must be mutually exclusive, i.e. no two outcomes can occur at the same time: • Die roll {odd number or even number} • Die roll{ number less than 4 or even number}
  • 47. • A and B are independent if and only if P(A&B)=P(A)*P(B) • A and B are mutually exclusive events: P(A or B) = P(A) + P(B)
  • 48. 6.48 Events & Probabilities… • The probability of an event is the sum of the probabilities of the simple events that constitute the event. • E.g. (assuming a fair die) S = {1, 2, 3, 4, 5, 6} and • P(1) = P(2) = P(3) = P(4) = P(5) = P(6) = 1/6 • Then: • P(EVEN) = P(2) + P(4) + P(6) = 1/6 + 1/6 + 1/6 = 3/6 = 1/2
  • 49. Female Low Male e.g. 1. The following table gives data on the type of car, grouped by petrol consumption, owned by 100 people. 4 21 23 7 33 12 High Medium One person is selected at random. L is the event “the person owns a low rated car” F is the event “a female is chosen”. Find (i) P(L) (ii) P(F  L) (iii) P(F| L) 100 Total
  • 50. (i) P(L) = Solution: Find (i) P(L) (ii) P(F  L) (iii) P(F L) 100 4 21 23 Female 7 33 12 Male High Medium Low 20 20 7  7 35 100 (ii) P(F  L) = 23 Total 100 (iii) P(F L)  23 Notice that P(L)  P(F L) 35 23 20 7   100 23  So, P(F  L) = P(F|L)  P(L) = P(F  L) 35 5 1
  • 51. 45 R F e.g. 2. I have 2 packets of seeds. One contains 20 seeds and although they look the same, 8 will give red flowers and 12 blue. The 2nd packet has 25 seeds of which 15 will be red and 10 blue. Draw a Venn diagram and use it to illustrate the conditional probability formula. Solution: 15 10 12 P(R  F) = P(F) = P(R F) = 8 8 45 20 8 45 20 20 8  P(R  F) = P(R|F)  P(F) So, P(R F)  P(F) =  20 45 45 8  1 1 Let R be the event “ Red flower ” and F be the event “ First packet ”
  • 52. Bayes’ Rule: derivation ) ( ) & ( ) / ( B P B A P B A P  • Definition: Let A and B be two events with P(B)  0. The conditional probability of A given B is:
  • 53.               B A P B P B A P B P B A P B P A B P |~ ~ | | |  
  • 54. Example • Three jars contain colored balls as described in the table below. – One jar is chosen at random and a ball is selected. If the ball is red, what is the probability that it came from the 2nd jar? Jar # Red White Blue 1 3 4 1 2 1 2 3 3 4 3 2
  • 55. Example • We will define the following events: – J1 is the event that first jar is chosen – J2 is the event that second jar is chosen – J3 is the event that third jar is chosen – R is the event that a red ball is selected
  • 56. Example • The events J1 , J2 , and J3 mutually exclusive – Why? • You can’t chose two different jars at the same time • Because of this, our sample space has been divided or partitioned along these three events
  • 57. Venn Diagram • Let’s look at the Venn Diagram
  • 58. Venn Diagram • All of the red balls are in the first, second, and third jar so their set overlaps all three sets of our partition
  • 59. Finding Probabilities • What are the probabilities for each of the events in our sample space? • How do we find them?       B P B A P B A P |  
  • 60. Computing Probabilities • Similar calculations show:       8 1 3 1 8 3 | 1 1 1      J P J R P R J P             27 4 3 1 9 4 | 18 1 3 1 6 1 | 3 3 3 2 2 2           J P J R P R J P J P J R P R J P
  • 61. Venn Diagram • Updating our Venn Diagram with these probabilities:
  • 62. Where are we going with this? • Our original problem was: – One jar is chosen at random and a ball is selected. If the ball is red, what is the probability that it came from the 2nd jar? • In terms of the events we’ve defined we want:       R P R J P R J P   2 2 |
  • 63. Finding our Probability               R J P R J P R J P R J P R P R J P R J P          3 2 1 2 2 2 |
  • 64.           17 . 0 71 12 27 4 18 1 8 1 18 1 | 3 2 1 2 2                                     R J P R J P R J P R J P R J P

Editor's Notes

  1. 11/21/2022