Main Menu Main Menu (Click on the topics below) Combinatorics Introduction Equally likely...
-
Upload
neal-harrison -
Category
Documents
-
view
217 -
download
0
Transcript of Main Menu Main Menu (Click on the topics below) Combinatorics Introduction Equally likely...
Main Menu Main Menu (Click on the topics below)
Combinatorics
Introduction
Equally likely Probability Formula
Counting elements of a list
Counting elements of a sublist
Sum of numbers from 1 to n
Pairs of numbersPossibility Trees & The Multiplication Rule
Cartesian Product
Subsets of A= {a1, a2,…, an}
3 digit numbers with distinct digits
Relations from A to B
3 digit +ve odd integers with distinct digits
Symmetric Relations
Simple Graphs
Click on the picture
CombinatoricsCombinatoricsCounting the number of possible outcomes.Counting the number of ways a task can be done.
Sanjay Jain, Lecturer, Sanjay Jain, Lecturer,
School of ComputingSchool of Computing
Introduction Introduction
Sanjay Jain, Lecturer, Sanjay Jain, Lecturer,
School of ComputingSchool of Computing
Multiplication Rule Examples
Click on the picture
CombinatoricsCombinatorics
Counting
Probability To say that a process is random means that when it
takes place, one out of a possible set of outcomes will occur. However it is in general impossible to predict with certainty which of the possible outcomes will occur.
A sample space is the set of all possible outcomes of a random experiment.
An event is a subset of a sample space..
ExampleExample
Tossing two coins.Sample Space: {HH, HT, TH, TT}Event: At least one head: {HH, HT, TH}
END OF SEGMENT
Equally Likely Probability FormulaEqually Likely Probability Formula
Suppose S is a sample space in which all outcomes are equally likely. Suppose E is an event in S. Then the probability of E, denoted by Pr(E) is
Notation: For a set A, #(A) denotes the number of elements in A. Sometimes n(A) or || A || is also used for #(A).Sometimes Prob(E) or P(E) is also used for Pr(E).
)(#
)(#)Pr(
S
EE
ExampleExample
Consider the process of drawing a card from a pack of cards.
What is the probability of drawing an Ace? Assume drawing any card is equally likely.Sample Space: S={SA, S2, S3, …., HA, H2,….}.Event: E={SA, HA, DA, CA}#(S)=52#(E)=4Pr(E)=4/52
END OF SEGMENT
Counting The Elements of A ListCounting The Elements of A List
How many integers are there from 8 through 15?
8 9 10 11 12 13 14 15
1 2 3 4 5 6 7 8
TheoremTheorem
If m and n are integers and m n then there are n-m+1 integers from m to n (both inclusive).
Proof: m m+1 m+2 ………………… nm+0 m+1 m+2 …………………m+(n-m)1 2 3 ……………… (n-m)+1
END OF SEGMENT
Counting Elements of a SublistCounting Elements of a Sublist
How many 3 digit positive integers are divisible by 5?100 105 ………. 99520*5 21*5 ……… 199*520 21 ……….. 199199 -20+1=180
END OF SEGMENT
Floors and CeilingsFloors and Ceilings
w denotes the largest integer w.For example: 6.9 = 6; -9.2 = -10; 9 = 9
w denotes the smallest integer w.For example: 6.9 =7; -9.2 = -9; 9 = 9
END OF SEGMENT
Sum of numbers from 1 to nSum of numbers from 1 to nTheorem: 1+2+….+n = n(n+1)/2ProofWe show this by induction on n.For n=1, the above is clearly true.Suppose the theorem holds for n = k.We show the theorem for n = k+1.
1 + 2 + … + k + (k+1)
= [k (k + 1) / 2] + (k+1)
= (k + 2) ( k + 1) / 2
= (k + 1) (k + 2) / 2
END OF SEGMENT
Pairs of numbers:Pairs of numbers:
How many distinct pairs of numbers (i,j) satisfy the property 1 i < j n?
For any i, 1 i < n, the number of j’s which satisfy 1 i < j n, is n - i.Thus, the number of distinct pairs of numbers (i,j) that
satisfy the property 1 i < j n is
1
1
n
i
in
1
1
*)1(n
i
inn=
2
)1(*)1(
nnnn
=
2
)1( nn
=
END OF SEGMENT
Possibility TreesPossibility Trees
Coin Toss:
2 ways
TossToss
2 x 2 ways
H T
THH T
END OF SEGMENT
The Multiplication RuleThe Multiplication RuleTheorem: If an operation (or job) consists of k tasks
(or steps), T1, T2,…, Tk, performed one after another and
T1 can be done in n1 waysT2 can be done in n2 ways (irrespective of how T1 is done)….Tk can be done in nk ways (irrespective of how T1 ... Tk-1 are done)
Then, the entire operation can be done in n1* n2* ….* nk ways.
The Multiplication RuleThe Multiplication RuleTheorem: If an operation (or job) consists of k tasks
(or steps), T1, T2,…, Tk, performed one after another and
Ti can be done in ni ways (irrespective of how T1 ... Ti-1 are done)
Caution: Note the independence assumption. One cannot use the multiplication rule unless the independence assumption holds.
END OF SEGMENT
Cartesian ProductCartesian Product
How many elements are there in A x B?
A= {a1, a2,…., an}
B= {b1, b2,…., bm}
Recall: A X B = {(a,b) : a A and b B}.
Cartesian ProductCartesian Product
Job: select an element of A X B. T1: Select an element a of A
T2: Select an element b of B (this gives us an element (a,b) of A X B)
T1 can be done in n ways
T2 can be done in m ways (irrespective of how T1 is done)
by the multiplication rule, the job can be done in n*m ways.
The number of elements of A x B is n*m
END OF SEGMENT
Subsets of A= {aSubsets of A= {a11, a, a22,…, a,…, ann}}
How many subsets of A={a1, a2,…, an} are there?Job: select a subset of A.
T1: either select or not select a1
T2: either select or not select a2
….
Tn: either select or not select an
Each of these tasks can be done in two ways (irrespective of how the earlier tasks are done).
Thus the number of ways of doing the job is 2n. Therefore, the number of subsets of A is 2n.
END OF SEGMENT
3 digit numbers with distinct digits3 digit numbers with distinct digits
How many 3 digit numbers with distinct digits are there?
3 digit numbers with distinct digits3 digit numbers with distinct digits
How many 3 digit numbers with distinct digits are there? T1: Select the hundred’s digit
T2: Select the ten’s digit
T3: Select the unit’s digit
3 digit numbers with distinct digits3 digit numbers with distinct digits
How many 3 digit numbers with distinct digits are there?
T1: Select the hundred’s digit
T1 can be done in 9 ways (digit 0 cannot be selected)
3 digit numbers with distinct digits3 digit numbers with distinct digits
How many 3 digit numbers with distinct digits are there?
T2: Select the ten’s digit
T2 can be done in 9 ways (irrespective of how T1 was done). You cannot select the digit chosen in T1
3 digit numbers with distinct digits3 digit numbers with distinct digits
How many 3 digit numbers with distinct digits are there?
T3: Select the unit’s digit
T3 can be done in 8 ways (irrespective of how earlier tasks were done). You cannot select the digit chosen in T1 and T2
3 digit numbers with distinct digits3 digit numbers with distinct digits
How many 3 digit numbers with distinct digits are there? T1 can be done in 9 ways
T2 can be done in 9 ways
T3 can be done in 8 ways
Therefore, the total number of 3 digit numbers with distinct digits are 9*9*8
END OF SEGMENT
Relations From A to BRelations From A to BHow many different relations are there from A to B?
A={a1, a2,…., an}, B={b1, b2,…., bm}
T(i,j) : select or not select (ai,aj) as a member of R.
(1 i n and 1 j m)
Note that the total number of tasks is n*m.
Each T(i,j) can be done in 2 ways.
Thus all the tasks can be done in 2n*m waysTotal number of relations is: 2n*m
Relations From A to BRelations From A to B
Another Method: A relation is a subset of A X B.Number of elements in A X B = n*mnumber of subsets of A X B = 2n*m
How many different relations are there from A to B?A={a1, a2,…., an}, B={b1, b2,…., bm}
END OF SEGMENT
Be careful in using the Multiplication RuleBe careful in using the Multiplication Rule
How many 3 digit +ve odd integers have distinct digits? T1: Select the hundred’s digit
T2: Select the ten’s digit
T3: Select the unit’s digit
3 digit +ve odd integers3 digit +ve odd integers
How many 3 digit +ve odd integers have distinct digits? T1: Select the hundred’s digit
T1 can be done in 9 ways
3 digit +ve odd integers3 digit +ve odd integers
How many 3 digit +ve odd integers have distinct digits? T2: Select the ten’s digit
T2 can be done in 9 ways (irrespective of how T1 was done). You cannot select the digit chosen in T1
3 digit +ve odd integers3 digit +ve odd integers
How many 3 digit +ve odd integers have distinct digits? T3: Select the unit’s digit
T3 can be done in ? ways (the number of ways is either 3 or 4 or 5 depending on how exactly T1 and T2 were done).
3 digit +ve odd integers3 digit +ve odd integers
How many 3 digit +ve odd integers have distinct digits? T1 can be done in 9 ways
T2 can be done in 9 ways
T3 can be done in ? ways
Therefore, the Multiplication Rule may not always be applicable.
However, for this problem one can use the Multiplication Rule by reordering tasks.
3 digit +ve odd integers3 digit +ve odd integers
How many 3 digit +ve odd integers have distinct digits? (reordering tasks) T1: Select the unit’s digit
T2: Select the hundred’s digit
T3: Select the ten’s digit
3 digit +ve odd integers3 digit +ve odd integers
How many 3 digit +ve odd integers have distinct digits? (reordering tasks) T1: Select the unit’s digit
T1 can be done in 5 ways
3 digit +ve odd integers3 digit +ve odd integers
How many 3 digit +ve odd integers have distinct digits? (reordering tasks) T2: Select the hundred’s digit
T2 can be done in 8 ways (irrespective of how T1 was done).
3 digit +ve odd integers3 digit +ve odd integers
How many 3 digit +ve odd integers have distinct digits? (reordering tasks) T3: Select the ten’s digit
T3 can be done in 8 ways (irrespective of how T1
and T2 are done).
3 digit +ve odd integers3 digit +ve odd integers
How many 3 digit +ve odd integers have distinct digits? (reordering tasks) T1 can be done in 5 ways
T2 can be done in 8 ways
T3 can be done in 8 ways
Therefore, the total number of 3 digit +ve odd integers with distinct digits is 5*8*8
END OF SEGMENT
Symmetric RelationsSymmetric RelationsSuppose A ={a1,a2,…,an}.How many symmetric relations can be defined on A?We will show that it is 2n(n+1)/2
Recall: for a relation to be symmetric, for each i, j, either both (ai,aj) and (aj,ai) are in R or both are not in R.
Divide the job of selecting a symmetric relation R into the following tasks.
Si (for 1 i n)
Either select or not select (ai,ai) in R
T(i,j) (for 1 i < j n)
Either select or not select both (ai,aj) and (aj,ai) in R
Note that the number of different T(i,j) 's are (n-1)n/2
Symmetric RelationsSymmetric Relations
Si (for 1i n)
Either select or not select (ai,ai) in R
T(i,j) (for 1i<j n)
Either select or not select both (ai,aj) and (aj,ai) in R
Each Si and T(i,j) can be done in exactly 2 ways.Thus the total number of symmetric relations on A are(2*2*…*2) * (2*2*….*2)
(there are n 2’s in the first group, and ((n-1)n/2) 2’s in the second group)
=2n*2n(n-1)/2
=2n(n+1)/2
END OF SEGMENT
Simple GraphsSimple GraphsHow many simple undirected graphs are there with n vertices?
This is similar to symmetric relations except that Si’s are not there.
T(i,j) (for 1 i < j n)
Either select or not select the edge {vi,vj} (= {vj,vi})
Note that the number of different T(i,j) 's are (n-1)n/2
Each T(i,j) can be done in exactly 2 ways.Thus the total number of simple graphs is2*2*….*2
(there are ((n-1)n/2) 2’s )=2n(n-1)/2
END OF SEGMENT
SummarySummary
Multiplication Rule Remember the conditions under which multiplication
rule is applicable, specially note the independence assumption
Click on the picture
Follow-UpFollow-Up
Explain assignments. List books, articles, electronic sources. If appropriate, give an introduction to the next lecture in
the series.
Click on the picture