You are on page 1of 11

Exercises on Combinatorial Theory Counting problems

Sum rule and product rule

Exercise 1. Given five characters A, B, C, D, E.


(i) How many strings of length 4 can be made from these characters (without character
repetition)?

(ii) How many strings are there in part (i) starting with B ?

(iii) How many strings are there in part (i) that do not start with B?

Solution:
(i) Let Ω be the set of strings of length 4 can be made from these characters.
The number of possibilities of strings of length 4 can be made from these
characters is
5! 5!
𝑨𝟒𝟓 = = = 5! = 120.
(5 − 4)! 1!

(ii) Let 𝔹 be the set of strings in part (i) starting with B.


The number of possibilities of strings in part (i) starting with B is
𝔹 = 𝑷𝟒 = 𝟒! = 𝟐𝟒.

(iii) The number of possibilities of strings in part (i) do not start with B is
̅ = Ω − 𝔹 = 120 − 24 = 96.
𝔹

Exercise 2. Given a set X with |X| = n. How many ordered collection (A, B) are there
satisfying A ⊆ B ⊆ X?

Exercise 3. The committee of a meeting has 6 people A, B, C, D, E, F, and they have to


elect a chair, a co-chair, and a secretary.

(i) How many ways are there they can elect?

(ii) How many ways are there they can elect, in which one of two people A, B is the
chair?

(iii) How many ways are there they can elect, in which E is elected?

(iv) How many ways are there they can elect, in which D and F are elected?
Solution:
(i) Choose 3 out of 6 people, then put them into 3 different positions.
Hence, the numbers of possibilities of such ways they can elect is
6! 6!
𝔸 = 𝑨36 = = = 6.4.5 = 120.
(6 − 3)! 3!
(ii) Let Ω be the set in which one of two people A, B is the chair
Case 1: Let 𝔸 be the set A is the chair,so we just need to choose 2 out of 5
people then put them into 2 different positions.
So, the numbers of possibilities of such ways they can elect is

5! 5!
𝑨25 = = = 5.4 = 20.
(5 − 2)! 3!

Case 2: : Let 𝔹 be the set B is the chair,so we just need to choose 2 out of 5
people then put them into 2 different positions
So, the numbers of possibilities of such ways they can elect is
𝟓! 𝟓!
𝔹 = 𝑨𝟐𝟓 = = = 𝟓. 𝟒 = 𝟐𝟎.
(𝟓 − 𝟐)! 𝟑!

Combining both cases above, we have the numbers of possibilities of ways they
can elect is
Ω =𝔸 + 𝔹 = 20 + 20 = 40.
(iii) Let α be the set in which E is elected.
Since, they have to elect a chair, a co-chair, and a secretary. So E can be
elected to 1 of 3 positions.
So, the numbers of possibilities of ways they can elect is

5! 5! 5!
𝜶 = 𝑨𝟐𝟓 + 𝑨𝟐𝟓 + 𝑨𝟐𝟓 = (5−2)! + (5−2)! + (5−2)! = 𝟐𝟎 + 𝟐𝟎 + 𝟐𝟎 = 𝟔𝟎.
(iv) Let δ be the set in which D and F are elected
• D and F can be elected to 2 of 3 positions.
The numbers of possibilities of such ways they can elect is
𝟑!
𝑨2𝟑 = = 𝟑.
(𝟑 − 𝟐)!
• After they elect for D and F, they have 1 position.

Consider D, F to be the same person, so we have the numbers of possibilities of


ways they can elect is
𝟓!
𝜹 = 3. 𝑨𝟐𝟓 = 𝟑. = 𝟓. 𝟒. 𝟑 = 𝟔𝟎.
(𝟓 − 𝟐)!
Exercise 4. How many binary sequences of length 10 are there that start with either
101 or 111?

Solution:
Let A0 be the set of binary sequences of length 10 are there that start with 101.

Let A1 be the set of binary sequences of length 10 are there that start with 111.

Hence, the set of binary sequences of length 10 are there that start with either 101 or
111: B (𝐀1 ∪ 𝑨0 )

the numbers of possibilities of binary sequences of length 10 are there that start with
either 101 or 111.

𝑩 = 𝑨1 + 𝑨0 = 𝟐𝟕 + 𝟐𝟕 = 𝟐𝟖 = 𝟐𝟓𝟔.

Exercise 5. There are 10 different books in which 5 books are about Informatics, 3
books are about Mathematics, and 2 books are about Arts. How many ways are there to
choose out 2 books of different fields?

Solution:
Let Ω be the set of 2 books of different fields.

Case 1: 2 books in Mathematics and informatics. The numbers of possibilities of such


ways we can choose is
5.3 = 15.

Case 2: 2 books in Mathematics and Arts. The numbers of possibilities of such ways we
can choose is
3.2 = 6.

Case 3: 2 books in Arts and Informatics. The numbers of possibilities of such ways we
can choose is
2.5 = 10.

Hence, The numbers of possibilities of such ways we can choose out 2 books of different
fields is

Ω = 15 + 6 + 10 = 31.

Exercise 6. There are 10 different books in which 5 books are about Informatics, 3
books are about Mathematics, and 2 books are about Arts.

(i) How many ways are there to arrange these books into a cell on a bookshelf?
(ii) How many ways are there to arrange these books into a cell on a bookshelf, in which
all the Informatics books are on the left while all the Arts books are on the right?

(iii) How many ways are there to arrange these books into a cell on a bookshelf, in
which the books of the same field are arranged next to each other?

(iv) How many ways are there to arrange these books into a cell on a bookshelf, in
which the Arts books are not arranged next to each other?

Solution:
(i) The numbers of possibilities of ways to arrange these books into a cell on a
bookshelf is
10! = 3628800.
(ii) Let 𝕀 be the ordered set of 5 books are about Informatics,the numbers of
possibilities of such ways to arrange these books into a cell on a bookshelf
5! = 120.
Let 𝔸 is the ordered set of 2 books are about Arts,the numbers of possibilities
of such ways to arrange these books into a cell on a bookshelf
2! = 2.
Let 𝕄 be the ordered set of 3 books are about Mathemetics,the numbers of
possibilities of such ways to arrange these books into a cell on a bookshelf
3! = 6.
Consider 𝕀, 𝔸, 𝕄 as elements, we can arrange such that 𝕀 in the left, while 𝔸 on
the right. The numbers of possibilities of such ways we can arrange is 2
Hence, The numbers of possibilities of ways we can arrange is
120.2.6.2 = 2880.
(iii) Let 𝕀 be the ordered set of 5 books are about Informatics,the numbers of
possibilities of such ways to arrange these books into a cell on a bookshelf
5! = 120.
Let𝔸 be the ordered set of 2 books are about Arts,the numbers of possibilities
of such ways to arrange these books into a cell on a bookshelf
2! = 2.
Let 𝕄 be the ordered set of 3 books are about Mathemetics,the numbers of
possibilities of such ways to arrange these books into a cell on a bookshelf
3! = 6.

Consider 𝕀, 𝔸, 𝕄 as elements. the numbers of possibilities of ways to arrange


them.
3! = 6
Hence, The numbers of possibilities of ways we can arrange is
120.2.6.6 = 8640.
(iv) Let 𝜴 be the set of cases in which 10 books are arranged into a cell on a
bookshelf. 𝜴 = 10!
Let 𝜺 be the set of cases such that two books are about Arts always sided by
side, so 𝜺̅ be the set of cases such that the Arts books are not arranged next to
each other.
• Arrange 2 books are about Arts,the numbers of possibilities of such
ways to arrange these books into a cell on a bookshelf
2! = 2.
• Consider 2 books are about Arts as a book, so we have 9 books, The
numbers of possibilities of ways to arrange 9 books into a cell on a
bookshelf is
9! = 362880.
The numbers of possibilities of ways to arrange such that two books are about
Arts always sided by side is
𝜺 = 2.362880 = 725760.

Hence, the numbers of possibilities of ways to arrange such that the Arts books
are not arranged next to each other is
𝜺̅ = 𝜴 − 𝜺 = 10! − 725760 = 2903040.

Exercise 7. How many natural numbers of 4 digits are there that are constituted by
digits 0, 1, 2, 3, 4, 5 such that

(i) No digit is repeated?

(ii) The digits are allowed to be repeated?

(iii) There is at least one even digit?

Solution:
(i) The numbers of possibilities of natural numbers of 4 digits in which no digit is
repeated is.
5.5.4.3 = 300.
(ii) The numbers of possibilities of natural numbers of 4 digits in which the digits
are allowed to be repeated is
5.6.6.6 = 1080.
(iii) Because we have 3 odd digits, 3 even digits, when we create a natural number
4 digits from the 6 digits above, make sure the numbers have at least one even
number.
The numbers of possibilities of natural numbers of 4 digits in which is at least
one even digit is
5.6.6.6 = 1080.
Exercise 8. Given a triangle, with n selected points on one edge and m selected points
on another edge (without choosing the vertices of the triangle). Connect the selected
points on each edge to the opposite vertex of the triangle.

(i) How many intersections are there inside the triangle?

(ii) How many parts are there in the triangle?

Solution:
(i) Each line drawn from the vertex draws n lines that cut m lines drawn from the
other vertex at m distinct points.
The number of intersections of the lines in the triangle is 𝑚. 𝑛
(ii) • Draw m roads that divide the triangle into m + 1 part
• Draw n roads that divide the triangle into n + 1 parts
The number of parts are there in the triangle is (𝑚 + 1). (𝑛 + 1)

Exercise 9. How many ordered collections of sets {X1, X2, X3} are there such that
X1 ∪ X2 ∪ X3 = {1, 2, 3, 4, 5, 6, 7, 8} and X1 ∩ X2 ∩ X3 = ∅?

Solution:
Consider a pair (X1, X2, X3) satisfying the problem:

• Number 1: We realize that the number 1 must at least 1 appear in one of the sets
𝑋1 , 𝑋2 , 𝑋3 and appear at most in 2 sets

▪ If the number 1 appears in only one set, the number of arrangements is


3 ways.
▪ If the number 1 appears in 2 sets, the number of arrangements is also 3
ways.

The numbers of possibilities of ordered collections of sets {X1, X2, X3} is 3 + 3 = 6.

• The same is for the case the numbers 2,3,4,5,6,7,8.


So we have, The numbers of possibilities of ordered collections of sets {X1, X2, X3}
is 68 = 1679616.

Permutations and combinations

Exercise 10. How many permutations of letters in string ABCDEF are there that contain
substring DEF?

Solution:
Consider D, E, F as a letter; so we have 4 letters.
The numbers of possibilities of permutations of them is 4! = 24.
The numbers of possibilities of permutations of letters in string ABCDEF that contain
substring DEF is
1.24 = 24.

Exercise 11. How many permutations of letters in string ABCDEF are there in which the
letters D, E, F are next to each other?

Solution:
We arrange D, E, F .The numbers of possibilities of permutations of them is 3! = 6.
Consider D, E, F as a letter; so we have 4 letters.
The numbers of possibilities of permutations of them is 4! = 24.
The numbers of possibilities of permutations of letters in string ABCDEF that contain
substring DEF is
6.24 = 144.

Exercise 12. How many ways are there for 6 people to sit around a table?

Solution:
Because round tables there is no arrangement. We choose a person to sit in one of the
six seats as a landmark.
The next position has 5 ways to choose, the next position has 4 choices, the next
position has 3 choices, the next position has 2 choices, and the last position has 1 choice.
Hence, the numbers of possibilities of such ways for 6 people to sit around a table
5! = 120.

Exercise 13. How many ways are there to arrange 7 male students and 5 female
students on a horizontal line such that female students are not arranged next to each
other?

Solution:
We arrange 7 male students on a horizontal line

M M M M M M M

The numbers of possibilities of such ways to arrange 7 male students on a horizontal


line is 7! = 5040.
Based on the table above we have a way to arrange 5 female students in a row, each
person will be placed in an empty position.So we arrange 5 female students into 8
positions
The numbers of possibilities of such ways arrange 5 female students on a horizontal line
is
8!
𝐴58 = = 6720.
(8 − 5)!
The numbers of possibilities of such ways to arrange 7 male students and 5 female
students on a horizontal line such that female students are not arranged next to each
other is
7! . 𝐴58 = 33868800.

Exercise 14. How many binary sequences of length 32 are there in which there are
exactly 6 digits 1?

Solution:
We arrange 6 digits 1 into 32 positions. The numbers of possibilities of such ways to
32! 32!
arrange 6 digits 1 into 32 positions is 𝐴632 = (32−6)! = 26! = 652458240.
In the remaining positions, we put the digit 0. The numbers of possibilities of such ways
to arrange digit 0 in the remaining positions is 1.
Hence, The numbers of possibilities of binary sequences of length 32 in which there are
exactly 6 digits 1 is
1. 𝐴632 = 652458240.

Exercise 15. There are 3 baskets containing balls of 3 colors red, blue, violet. Each
basket contains at least 8 balls, and all balls in each basket are of the same color.
(i) How many ways are there to choose out 8 balls from the baskets?
(ii) How many ways are there to choose out 8 balls from the baskets, in which there are
at least 1 red ball, 1 blue ball, and 1 violet ball?

Exercise 16. Consider the equation x1 + x2 + x3 + x4 = 29.


(i) How many positive integer solutions are there?
(ii) How many non-negative integer solutions are there?
Solution:
(i) With 𝑥𝑖 ≥ 1(𝑖 = 1,2,3,4)
Put 𝑥𝑖 = 𝑦𝑖 + 1(𝑦𝑖 ≥ 0)
⇒ 𝑦1 + 1 + 𝑦2 + 1 + 𝑦3 + 1 + 𝑦4 + 1 = 29.
⇒ 𝑦1 + 𝑦2 + 𝑦3 + 𝑦4 = 25.
4−1 3
So,the numbers solution are: 𝐶25+4−1 = 𝐶28 .
(ii) With 𝑥𝑖 ≥ 0 (𝑖 = 1,2,3,4)
4−1 3
The numbers solution are: 𝐶29+4−1 = 𝐶32 .

Inclusion-exclusion principle

Exercise 17. How many natural numbers from 1 to 1000 are there that are either odd
or square?

Solution:
𝐴1 : the set of the odd into (1,100)

𝐴2 : the set of the numbers square into (1,1000)

We have:
1000
• The elements of set 𝐴1 :|𝐴1 | = 2
= 500.
• The elements of set 𝐴2 : |𝐴2 | = 31.
• The elements of set |𝐴1 ∩ 𝐴2 | = |𝐴1 | + |𝐴2 | − |𝐴1 ∩ 𝐴2 |
= 500 + 31 − 16
= 515.

Exercise 18. How many binary sequences of length 8 are there that do not have 6
consecutive digits 0?

Solution:
We call that A is set of binary sequence of lenght 8 have 6 consecutive digit 0⇒ |𝐴| = 8.

The number binary sequences of lenght 8 is |𝑋| = 28 .

Therefore, the number of binary sequences satisfy is |𝑋| − |𝐴| = 28 − 8 = 248.

Exercise 19. How many natural numbers of 10 digits are there that are constituted by
only digits {1, 2, 3} and contain at least one digit 1, one digit 2, one digit 3?

Solution:
We call that Ai is set of the numbers have 10 digits, in which do not appear (i=1,2,3), so
𝐴𝑖 = |𝑋| − |𝐴1 ∩ 𝐴2 ∩ 𝐴3 |
= |𝑋| − [|𝐴1 | + |𝐴2 | + |𝐴3 | − |𝐴1 ∩ 𝐴2 | − |𝐴2 ∩ 𝐴3 | − |𝐴3 ∩ 𝐴1 | + |𝐴1 ∩ 𝐴2 ∩ 𝐴3 |]
= 310 − 210 − 210 − 210 + 1 + 1 + 1 − 0

= 310 − 3.210 + 3=55980.

Exercise 20. How many binary sequences of length 10 are there that either start with
111 or end with 0000?

Solution:
A1:The set of binary sequences of lenght 10 start 111 |𝐴1 | = 27 .

A2: The set of binary sequences of lenght 10 end 0000 |𝐴2 | = 26

𝐴1 ∩ 𝐴2 : 𝑡ℎ𝑒 𝑠𝑒𝑡 𝑜𝑓 𝑏𝑖𝑛𝑎𝑟𝑦 𝑠𝑒𝑞𝑢𝑒𝑛𝑐𝑒 𝑜𝑓 𝑙𝑒𝑛𝑔ℎ𝑡 10 𝑤𝑖𝑡ℎ 𝑠𝑡𝑎𝑟𝑡 1111 𝑎𝑛𝑑 𝑒𝑛𝑑 0000 |𝐴1 ∩ 𝐴2 | = 23

Therefore, the number binary sequences satisfy is |𝑋| = |𝐴1 ∩ 𝐴2 |


= |𝐴1 | + |𝐴2 | − |𝐴1 ∩ 𝐴2 |

= 27 + 26 − 23
= 184

Exercise 21. Consider the equation x1 + x2 + x3 + x4 = 29. How many nonnegative


integer solutions are there that satisfy x1 ≤ 3, x2 ≤ 12, x3 ≤ 5, x4 ≤ 10?

Solution:
We have :
𝑥1 + 𝑥2 + 𝑥3 + 𝑥4 = 29
⟺ (3 − 𝑥1 ) + (12 − 𝑥2 ) + (5 − 𝑥3 ) + (10 − 𝑥4 ) = 1

Let
3 − 𝑥1 = 𝑡1
𝑡1 ≥ 0 𝑡2 ≥ 0
12 − 𝑥2 = 𝑡2 ( )
𝑡3 ≥ 0 𝑡4 ≥ 0
5 − 𝑥3 = 𝑡3
10 − 𝑥4 = 𝑡4

And, 𝑡1 ≤ 3; 𝑡2 ≤ 12; 𝑡3 ≤ 5; 𝑡4 ≤ 10

So, the numbers of solutions satify is


𝑘−1 4−1
𝐶𝑛+𝑘−1 = 𝐶1+4−1 =4
Exercise 22. There are 50 students in a class. They have done a test of 3 exercises.
Every student did at least one of the three exercises. 40 students completed their
solutions for the first exercise. 35 students completed their solutions for the second
exercise. 30 students completed their solutions for the third exercise. Prove that at most
27 students completed their solutions for all exercises in the test.

Solution:
|𝐴1 | 𝑡ℎ𝑒 𝑠𝑒𝑡 𝑜𝑓 𝑠𝑡𝑢𝑑𝑒𝑛𝑡𝑠 𝑐𝑜𝑚𝑝𝑙𝑒𝑡𝑒 𝑡ℎ𝑒 𝑓𝑖𝑠𝑡 𝑒𝑥𝑒𝑟𝑐𝑖𝑠𝑒 |𝐴1 | = 40
|𝐴2 | 𝑡ℎ𝑒 𝑠𝑒𝑡 𝑜𝑓 𝑠𝑡𝑢𝑑𝑒𝑛𝑡𝑠 𝑐𝑜𝑚𝑝𝑙𝑒𝑡𝑒 𝑡ℎ𝑒 𝑠𝑒𝑐𝑜𝑛𝑑 𝑒𝑥𝑒𝑟𝑐𝑖𝑠𝑒 |𝐴2 | = 35
|𝐴3 | 𝑡ℎ𝑒 𝑠𝑒𝑡 𝑜𝑓 𝑠𝑡𝑢𝑑𝑒𝑛𝑡𝑠 𝑐𝑜𝑚𝑝𝑙𝑒𝑡𝑒 𝑡ℎ𝑒 𝑡ℎ𝑖𝑟𝑑 𝑒𝑥𝑒𝑟𝑐𝑖𝑠𝑒 |𝐴3 | = 30

The number students complete all exercise is |𝐴1 ∩ 𝐴2 ∩ 𝐴3 |


|𝐴1 ∩ 𝐴2 ∩ 𝐴3 | = |𝐴1 | + |𝐴2 | + |𝐴3 | − |𝐴1 ∩ 𝐴2 | − |𝐴2 ∩ 𝐴3 | − |𝐴3 ∩ 𝐴1 | + |𝐴1 ∩ 𝐴2 ∩ 𝐴3 |

50 = 40 + 35 + 30 − |𝐴1 ∩ 𝐴2 ||𝐴2 ∩ 𝐴3 ||𝐴3 ∩ 𝐴1 ||𝐴1 ∩ 𝐴2 ∩ 𝐴3 |

Let |𝐴1 ∩ 𝐴2 ∩ 𝐴3 | = 𝐾
𝐾1 = |𝐴1 ∩ 𝐴2 | − |𝐴1 ∩ 𝐴2 ∩ 𝐴3 | ≥ 0
𝐾2 = |𝐴3 ∩ 𝐴2 | − |𝐴1 ∩ 𝐴2 ∩ 𝐴3 | ≥ 0
𝐾3 = |𝐴1 ∩ 𝐴3 | − |𝐴1 ∩ 𝐴2 ∩ 𝐴3 | ≥ 0
⟺ 50 = 105 − (3𝐾 + 𝐾1 + 𝐾2 + 𝐾3 ) + 𝐾
⟺ 55 = 2𝐾 + 𝐾1 + 𝐾2 + 𝐾3
⟺ 55 ≥ 2𝐾 (𝐾1 + 𝐾2 + 𝐾3 ≥ 0)
⟺ 𝐾 ≤ 27

So, that at most 27 students completed their solutions for all exercises in the test.

Recurrence

You might also like