You are on page 1of 7

Discrete Structures – Spring-2021 Assignment-01 Solution

Sets
Problem 1
a. List all subsets of {𝑥, 𝑦, 𝑧}. How many do you get?
{}, {𝑥}, {𝑦}, {𝑧}, {𝑥, 𝑦}, {𝑥, 𝑧}, {𝑦, 𝑧}, {𝑥, 𝑦, 𝑧}. Total 8 subsets.
b. List all subsets of {𝑣, 𝑤, 𝑥, 𝑦, 𝑧}, containing 𝑦 but NOT containing 𝑧.
{𝑦}, {𝑣, 𝑦}, {𝑤, 𝑦}, {𝑥, 𝑦}, {𝑣, 𝑤, 𝑦}, {𝑣, 𝑥, 𝑦}, {𝑤, 𝑥, 𝑦}, {𝑣, 𝑤, 𝑥, 𝑦}
c. Define a set of which both {1, 3, 4} and {0, 3, 5} are subsets. Find such a set with the smallest possible number of
elements.
{0, 1, 3, 4, 5} is the smallest possible superset of both sets.
d. What is the number of subsets of a set with n elements, containing a given element (one element becomes fixed;
it is part of every subset)?
2𝑛−1
Problem 2
a. We form the union of a set with 5 elements and a set with 9 elements. Which of the following numbers can
we get as the cardinality of the union: 4, 6, 9, 10, 14, 20?
6,9,10 and 14
b. We form the union of two sets. We know that one of them has n elements and the other has m elements. What
can we infer about the cardinality of their union?
The cardinality of their union can be at least equal to the cardinality of the greater set; this happens when one
of the set is a subset of the other set, and it can be at most equal to the sum of the cardinality of both the sets,
when there is no common element between the sets.
Let |𝐴| = 𝑚 and |𝐵| = 𝑛, then
max(𝑚, 𝑛) ≤ |𝐴 ∪ 𝐵 | ≤ 𝑚 + 𝑛
c. What is the intersection of
i) the sets { } and {1, 2, 3};
{}
ii) the set of girls in this class and the set of boys in this class;
null/ empty set ∅
iii) the set of prime numbers and the set of even numbers?
{2}
d. We form the intersection of two sets. We know that one of them has n elements and the other has m elements.
What can we infer about the cardinality of their intersection?
The cardinality of the intersection can be at least zero, when there is no common element between the sets
and it can be equal to the cardinality of the smaller set when one (smaller) of the set is the subset of the other
set.
Let |𝐴| = 𝑚 and |𝐵| = 𝑛, then
0 ≤ |𝐴 ∩ 𝐵 | ≤ min(𝑚, 𝑛)
Problem 3
Use Venn-diagram to prove following:
a. Prove equations (1.2), (1.3), and (1.4) given in the reading pages.
VENN DIAGRAM
b. Prove that |𝐴 ∪ 𝐵| + |𝐴 ∩ 𝐵| = |𝐴| + |𝐵|.
VENN DIAGRAM
Problem 4
a. What is the symmetric difference of the set ℤ+ of nonnegative integers and the set 𝔼 of odd integers (𝔼 =
{. . . , −3, −1, 1, 3, . . . } contains both negative and positive odd integers).
ℤ+ = {0, 1, 2, 3, 4, 5, ⋯ }
Discrete Structures – Spring-2021 Assignment-01 Solution

𝔼𝑜𝑑𝑑 = {⋯ , −3, −1, 1, 3, ⋯ }


ℤ+ Δ 𝔼𝑜𝑑𝑑 = {⋯ , −3, −1, 0, 2, 4, 6, 8, 10, ⋯ }
b. Let 𝐶 be the symmetric difference of 𝐴 and 𝐵 ( that is 𝐴Δ𝐵 = 𝐶). Now, form the symmetric difference of A
and C. What did you get? Give a proof of the answer using Venn diagram.
Set B
VENN DIAGRAM
Counting
Problem 5
From section 1.1 of the given reading, what is the number of pairings (in all the various senses as discussed) in a
party of 12?
a. Handshakes b. Seating arrangements c. Playing chess (with 6 chess-boards)

Handshakes
Each of the 12 people shake hands with each other. That means each person shakes hand with 11 people.
So the total number of handshakes should be 11 × 10 = 110. But, each handshake is counted twice, so to
110
avoid over-counting, we should divide the answer by 2, i.e. 2 = 55. Hence the total number of
handshakes in party of 12 is 55.
Seating arrangements
12 people can be seated in 12 ∗ 11 ∗ 10 ∗ 9 ∗ 8 ∗ 7 ∗ 6 ∗ 5 ∗ 4 ∗ 3 ∗ 2 ∗ 1 or in other words 12! ways.
Playing chess (with 6 chess-boards)
It is same as seating 12 people on chairs, however, it shouldn’t matter which players sits at which position
at the same board. There are 2 ways in which a pair of players can sit on a board. So, for six chess board,
there are 2 ∗ 2 ∗ 2 ∗ 2 ∗ 2 ∗ 2 = 26 ways in which the players can sit the 6 boards.
And it should also not matter which pair sits at which table, so the number of ways 6 chess-boards can be
12!
arranged are 6!. Therefore, number of different pairings, after avoiding over-counting are (26∗6!) = 10395
Or in other way:
Say the Oldest of the 12 can choose anyone as his partner he’d have 11 choices.
Which means 11 different pairs. After he’s done the next Oldest would have 9 choices and so on until
there’s only 2 people left who’d have to pair with each other.
So the answer to this would be 11 ∗ 9 ∗ 7 ∗ 5 ∗ 3 = 10395 Pairs

Problem 6
(a) How many words of 8 letters can you form, using the English alphabet? (there are 26 different letters, of which 5
are vowels).
Each of the 8 places can be filled in 26 ways, so by product rule 268 different words can be formed.
(b) How many words of length 8 can you form, where no letter is repeated?
26 ∗ 25 ∗ 24 ∗ 23 ∗ 22 ∗ 21 ∗ 20 ∗ 19
(c) How many words of length 8 can you form, where the first letter is the same as the last letter?
267 ,since last one is same the first one.
(d) How many words of length 8 can you form, which contain exactly one vowel?
217 (words contain exactly one vowel at a certain position)
There are 8 different positions for the vowel, so number of ways to place vowels = 8 x 5 = 40
Total words of length 8 with exactly one vowel = 40 ∗ 217

Problem 7
In how many ways can a photographer at a wedding arrange 8 people in a row, including the bride and groom, if
a) the bride must be next to the groom?
Discrete Structures – Spring-2021 Assignment-01 Solution

The bride and groom can be considered as one unit. So 6 other people and the bride and groom can be arranged
in 7! Ways. However the bride and groom can be next to each other in 2! Ways. Therefore, there are total 7! ×
2! = 10,080 ways when the bride must be standing next to the groom.
b) the bride is not next to the groom?
There are total 8! = 40320 ways to arrange 8 persons in a row. Subtracting answer of (a) from 40320, there are
30240 ways when the bride is not next to the groom.
c) the bride is positioned somewhere to the left of the groom?
As there are total 8! = 40320 ways to arrange 8 persons in a row, half of the time the bride would be positioned
40320
somewhere to the left of the groom. Thus, = 20,160 is the answer.
2

Problem 8
In how many ways can you seat 12 people at two round tables with 6 places each?
Think of possible ways of defining when two seatings are different, and find the answer for each.

Solution:
Rotations of people sitting around a table, do not matter; however, they are sitting on which table, it does matter.
Consider seating relative to special guest (fix one person). Then, there are 11 ∗ 10 ∗ 9 ∗ 8 ∗ 7 ways to seat rest 5 people around the
first table.
Now fix one guest at next table. For the rest of 5 people, there are 5 ∗ 4 ∗ 3 ∗ 2 ∗ 1 ways to seat the rest 5.
The total number of ways are is (11 ∗ 10 ∗ 9 ∗ 8 ∗ 7) ∗ (5 ∗ 4 ∗ 3 ∗ 2 ∗ 1).
OR 11𝑃5 ∗ 5𝑃5

Problem 9
Part A: How many permutations of the letters ABCDEFGH contain
a) the string ED? b) the string CDE? c) the strings BA and FGH? d) the strings AB, DE, and
GH? e) the strings CAB and BED? f ) the strings BCA and ABF?
Solution:
a. The set of permutations of the letters include {𝐴, 𝐵, 𝐶, 𝐷𝐸, 𝐹, 𝐺, 𝐻} of which there are 7! = 5040
b. The set of permutations of the letters ABCDEF GH that contain the string CDE is the same as the set of
permutations of the 6-element set {𝐴, 𝐵, 𝐶𝐷𝐸, 𝐹, 𝐺, 𝐻}. The latter set has 𝑃(6, 6) = 6! = 720 elements
c. Here we are interested in the set of permutations of the set {𝐵𝐴, 𝐶, 𝐷, 𝐸, 𝐹𝐺𝐻}, of which there are 5! =
120
d. Here, are interested in the set of permutations of the set {𝐴𝐵, 𝐶, 𝐷𝐸, 𝐹, 𝐺𝐻} of which there are 5! = 120
elements.
e. B cannot occur twice therefore, there are zero permutations.
f. B cannot occur twice therefore, there are zero permutations

Part B: The English alphabet contains 21 consonants and five vowels. How many strings of six lowercase letters of
the English alphabet contain
a) exactly one vowel? b) exactly two vowels? c) at least one vowel? d) at least two vowels?
Solution:
a. Exactly one vowel
# of strings = 𝐶(6, 1)(5)(215 )
b. Exactly two vowels
# of strings = 𝐶(6, 2)(52 )(214 )
c. At least one vowel
# of strings = (# 𝑜𝑓 𝑎𝑙𝑙 𝑎𝑙𝑝ℎ𝑎𝑏𝑒𝑡𝑠) − #(𝑖𝑛𝑣𝑎𝑙𝑖𝑑 = # 𝑜𝑓 0 𝑣𝑜𝑤𝑒𝑙𝑠) = 266 − 216
d. At least two vowels
# of strings = (# 𝑜𝑓 𝑎𝑙𝑙 𝑎𝑙𝑝ℎ𝑎𝑏𝑒𝑡𝑠) − #(𝑖𝑛𝑣𝑎𝑙𝑖𝑑 = # 𝑜𝑓 0 𝑣𝑜𝑤𝑒𝑙𝑠) − #(𝑖𝑛𝑣𝑎𝑙𝑖𝑑 = # 𝑜𝑓 1 𝑣𝑜𝑤𝑒𝑙𝑠)
Problem 10
a. Prove the extended version of binomial identity. Prove by both methods:
i. Algebraic way (evaluate the given expression)
𝑛 𝑛−2 𝑛−2 𝑛−2
( )= ( )+ 2( )+( )
𝑘 𝑘−2 𝑘−1 𝑘
Solution
Discrete Structures – Spring-2021 Assignment-01 Solution

𝑛 𝑛!
LHS: ( ) = 𝑘!(𝑛−𝑘)!
𝑘
𝑛 − 2 𝑛 − 2 𝑛 − 2
RHS: (
𝑘 − 2
)+ 2 (𝑘 − 1 ) + ( 𝑘
)
(𝑛 − 2)! 2 × (𝑛 − 2)! (𝑛 − 2)!
= + +
(𝑘 − 2)! (𝑛 − 2 − 𝑘 + 2)! (𝑘 − 1)! (𝑛 − 2 − 𝑘 + 1)! (𝑘)! (𝑛 − 2 − 𝑘)!

1 2 1
= (𝑛 − 2)! { + + }
(𝑘 − 2)! (𝑛 − 𝑘)! (𝑘 − 1)! (𝑛 − 𝑘 − 1)! (𝑘)! (𝑛 − 𝑘 − 2)!

1 2
= (𝑛 − 2)! { +
(𝑘 − 2)! (𝑛 − 𝑘)(𝑛 − 𝑘 − 1)(𝑛 − 𝑘 − 2)! (𝑘 − 1)(𝑘 − 2)! (𝑛 − 𝑘 − 1)(𝑛 − 𝑘 − 2)!
1
+ }
𝑘(𝑘 − 1)(𝑘 − 2)! (𝑛 − 𝑘 − 2)!

(𝑛 − 2)! 1 2 1
= { + + }
(𝑘 − 2)! (𝑛 − 𝑘 − 2)! (𝑛 − 𝑘)(𝑛 − 𝑘 − 1) (𝑘 − 1)(𝑛 − 𝑘 − 1) 𝑘(𝑘 − 1)

(𝑛 − 2)! 𝑘(𝑘 − 1) + 2𝑘(𝑛 − 𝑘) + (𝑛 − 𝑘)(𝑛 − 𝑘 − 1)


= { }
(𝑘 − 2)! (𝑛 − 𝑘 − 2)! 𝑘(𝑘 − 1)(𝑛 − 𝑘)(𝑛 − 𝑘 − 1)

(𝑛 − 2)! 𝑘 2 − 𝑘 + 2𝑛𝑘 − 2𝑘 2 + 𝑛2 − 2𝑛𝑘 + 𝑘 2 − 𝑛 + 𝑘


= { }
(𝑘 − 2)! (𝑛 − 𝑘 − 2)! 𝑘(𝑘 − 1)(𝑛 − 𝑘)(𝑛 − 𝑘 − 1)

(𝑛 − 2)! 𝑛2 − 𝑛
= { }
(𝑘 − 2)! (𝑛 − 𝑘 − 2)! 𝑘(𝑘 − 1)(𝑛 − 𝑘)(𝑛 − 𝑘 − 1)
(𝑛 − 2)! 𝑛(𝑛 − 1)
= { }
(𝑘 − 2)! (𝑛 − 𝑘 − 2)! 𝑘(𝑘 − 1)(𝑛 − 𝑘)(𝑛 − 𝑘 − 1)

𝒏!
= 𝒌!(𝒏−𝒌)! = LHS

ii. By combinatorial argument of counting


𝑛
( ) = (𝑛 − 2) + 2 (𝑛 − 2) + (𝑛 − 2)
𝑘 𝑘−2 𝑘−1 𝑘
Solution:
𝑛
LHS: We need to pick 𝑘 objects out of 𝑛 objects. There are ( ) ways to do that.
𝑘
RHS: We can achieve the same count in another way We divide 𝑛 objects into 2 groups: first contains 2 objects, the
other contains (𝑛 − 2) objects.
We may select 𝑘 objects in either of three ways:
2
1st way is to select both objects from the first group. So there are ( ) = 1 way to do that, and we select rest of the
2
𝑛 − 2
(𝑘 − 2) objects from the second group. There are ( ) ways to do that.
𝑘−2
2
2nd way is to select one object from the first group. So there are ( ) = 2 ways to do that, and we select rest of the
1
𝑛 − 2
(𝑘 − 1) objects from the second group. There are ( ) ways to do that.
𝑘−1
Discrete Structures – Spring-2021 Assignment-01 Solution

2
3rd way is to select none of the objects from the first group. So there are ( ) = 1 way to do that, and we select rest of
0
𝑛−2
the (𝑘) objects from the second group. There are ( ) ways to do that.
𝑘
So total ways to choose 𝑘 objects in this secnario will be
𝑛−2 𝑛−2 𝑛−2
( ) +2( )+( )
𝑘−2 𝑘−1 𝑘

b. Prove (again in two way – algebraic and combinatorial) that


𝑛 𝑛 𝑛−1
( )= ( )
𝑘 𝑘 𝑘−1

Algebraic Proof:
𝑛 𝑛!
LHS: ( ) = 𝑘!(𝑛−𝑘)!
𝑘
𝑛 𝑛−1
RHS: ( )
𝑘 𝑘−1
𝑛 (𝑛 − 1)!
=
𝑘 (𝑘 − 1)! (𝑛 − 1 − 𝑘 + 1)!

𝑛 ⋅ (𝑛 − 1)!
=
𝑘 ⋅ (𝑘 − 1)! (𝑛 − 𝑘)!
𝑛! 𝑛
= = ( )
𝑘! (𝑛 − 𝑘)! 𝑘
= LHS

Combinatorial Proof:
We can choose a k-element set by first choosing one element (n possibilities) and then choosing a (𝑘 − 1)-element
𝑛 − 1) 𝑛 − 1)
subset of the remaining 𝑛 − 1 elements. There are ( possibilities. This becomes a total of 𝑛 ⋅ (
𝑘−1 𝑘−1
But we get every k-element subset exactly 𝑘 times (depending on which of its elements was chosen first), so we
𝑛 𝑛 − 1)
have to divide the result by 𝑘, to get 𝑘 ⋅ (
𝑘−1

c. Prove (again in two way – algebraic and combinatorial) that


𝑎 𝑎 𝑎−𝑐
( ) (𝑏 ) = ( )( )
𝑏 𝑐 𝑎−𝑐 𝑏−𝑐
Algebraic Proof:
𝑎 𝑏 𝑎! 𝑏! 𝑎!
LHS: ( ) ( ) = 𝑏!(𝑎−𝑏)! ⋅ 𝑐!(𝑏−𝑐)! = (𝑎−𝑏)!(𝑏−𝑐)!𝑐!
𝑏 𝑐
𝑎 𝑎−𝑐 𝑎! (𝑎−𝑐)!
RHS: ( )( ) = (𝑎−𝑐)!(𝑎−𝑎+𝑐)! ⋅ (𝑏−𝑐)!(𝑎−𝑐−𝑏+𝑐)!
𝑎−𝑐 𝑏−𝑐
𝑎! (𝑎 − 𝑐)!
= ⋅
(𝑎 − 𝑐)! 𝑐! (𝑏 − 𝑐)! (𝑎 − 𝑏)!

𝑎!
=
(𝑎 − 𝑏)! (𝑏 − 𝑐)! 𝑐!

= LHS
Combinatorial Proof:

Both sides count the number of ways to divide an a-element set into three sets with a − b, b − c, and c elements.
Discrete Structures – Spring-2021 Assignment-01 Solution

On LHS, we first selected 𝑏 elements out of 𝑎, (we got 2 groups of sizes 𝑎 − 𝑏 and 𝑏 ) and then from 𝑏 elements, we
choose 𝑐 elements. SO we divided 𝑏 elements into 2 groups of sizes 𝑐 and 𝑏 − 𝑐.
In short, we have got 3 groups of sizes 𝑎 − 𝑏, 𝑏 − 𝑐, and 𝑐.

On RHS, we are doing the same thing in different way. From 𝑎 elements, we select 𝑐 elemets first. From the remaining
𝑎 − 𝑐 elements, we choose 𝑏 − 𝑐 elements, leaving behind 𝑎 − 𝑐 − 𝑏 + 𝑐 = 𝑎 − 𝑏 elelemts. So we get 3 groups
having elements 𝑎 − 𝑏, 𝑏 − 𝑐, and 𝑐.
Graphs
Problem 11
A friendship graph is given below.
a. Make a 5 × 5 array to show who is friend of whom.
(All rows are labelled A, B, C, D, E, and all columns are labelled A, B, C, D, E. Mark the corresponding
entry if they are friends, and cross if they are not).
Solution:
A B C D E
A    
B    
C    
D    
E    
b. Represent the friendship relation, from the graph below, as sets (e.g. 𝐴 = {𝐸, 𝐵, 𝐶, 𝐷}, all friends of A.
Similarly do for others).

𝐵 = {𝐴, 𝐶, }, 𝐶 = {𝐴, 𝐵, 𝐸}, 𝐷 = {𝐴} 𝑎𝑛𝑑 𝐸 = {𝐴, 𝐶}

Problem 12
a. Draw graph of the following chemical bonds:

Solution
Discrete Structures – Spring-2021 Assignment-01 Solution

b. Draw graph of the following maze. You make an edge whenever one labelled corridor is connected to another
one.

Solution

You might also like