Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Full name:

Checker’s full name

Discrete Maths: Practice Test 1


VGU/CS students
Duration: 100 minutes
Instructor: Huong Tran

Attention. There are 13 questions in total.

1 General knowledge: 8 questions


1. (2pts) (k-combinations) Write down all 2-combinations of three elements {a, b, c}
where the repetition of elements

(a) is not allowed.


Answer: {a, b}, {a, c}, {b, c}

(b) is allowed.
Answer: {{a, a}}, {{a, b}}, {{a, c}}, {{b, b}}, {{b, c}}, {{c, c}}.

2. (1pt) (Pascal triangle) Knowing that the 10th row of Pascal’s triangle representing
the values of 10

k
, 0 ≤ k ≤ 10, is given as follows

1 10 45 120 210 252 210 120 45 10 1.

Using this row to calculate the value of 11



7
?
Answer: From the 10th row of Pascal triangle above, we have 10

7
= 120 and
10
= 120. By the Pascal formula, we have 11 = 10 + 10
   
6 7 7 6
= 120 + 210 = 330.

3. (2pts) (Binomial/multinomial coefficient formula)


10! 3 2
(a) The coefficient of x3 y 2 z 5 in the expansion of (2x − 3y − z)10 is − 3!2!5! 23
(b) The number of binary strings with length 10 starting with 1 and containing
5 occurrences of 1 is C(9, 4)

4. (2pt) (Partition of a set)

1
(a) Write down all partitions of the set [4] into 2 blocks such that each block
contains exactly 2 elements.

Answer: {1, 2} t {3, 4}; {1, 3} t {2, 4}; {1, 4} t {2, 3}.
(b) A tennis club has 2n members. We want to pair up the members by twos for
single matches. In how many ways we pair up all the members of the club.
Answer: It is equal to the number of partitions of the set [2n] into n blocks
and each block contains exactly 2 elements.
• Choose 2 elements for the first block: Since it is un-ordered in each block
2
of partition, there are C2n ways;
• Choose 2 elements from the rest 2n − 2 elements for the second block:
2
Since it is un-ordered in each block of partition, there are C2n−2 ways;
• etc;
• Choose 2 elements from the rest 2 elements for the nth block: there are
2
C2n−4 ways;
2 2
By the product counting rule, there are C2n · C2n−2 · · · · · C42 · C22 ways for
choosing n ordered blocks, each block contains 2 elements.
However, by definition of partition into blocks, there is no order for those
blocks in each partition. Notice that each tuple of n blocks, which is un-
ordered, gives exactly n! blocks ordered. Hence, by the division counting
rule, there are
2 2
C2n C2n−2 · · · C22 (2n)!
=
n! n!2n
partitions satisfying the hypothesis.
5. (3pts) (Finite functions) How many functions are there from [5] to [7] such that
it maps 1 to 5 and it is
(a) arbitrary?

Answer: 74
(b) one-to-one (injective)?

6!
Answer: P (6, 4) = 2!
(c) onto (surjective)?

Answer: 0 since the cardinality of the sink set is greater than the cardinality
of the source set.

2
6. (2pts) (Generating functions:)
(a) What is the reduced formula for the generating function for the following
sequence:
(0, 0, 0, 1, 3, 9, 27, . . . )

x3
Answer: f (x) = 1−3x
.

(b) What is the closed formula for the nth term of the sequence whose generat-
1 1
2

ing function is given by x 1−3x + 1−2x ?

Answer: The nth term an of the sequence is given by


(
3n−2 + 2n−2 , n≥2
an =
0, n = 0, 1.

7. (1pt) (Linear Recurrence) The characteristic polynomial for the linear recursion
a0 = 0, an = 3an−1 + 2n−1 is equal to P (x) = (x − 3)(x − 2)
8. (1pt)(The principle of inclusion and exclusion.) How many positive integers not
exceeding 2017 that are divisible by 5 or 7?
Answer: Denote by A and B the sets of positive integers not exceeding 2016
divisible by 5 and divisible by 7 respectively. Hence, numbers divisible by 5 or 7
are in the set A or B. We need to find |A ∪ B|. Thus, by the PIE, we get
     
2017 2017 2017
|A ∪ B| = |A| + |B| − |A ∩ B| = + − = 634.
5 7 5.7

2 Applications: 05 questions
9. (1.5 pts) How many binary strings of length 2019 with at least 2017 occurrences
of 0 are there? Answer: C(2019, 2017) + C(2019, 2018) + C(2019, 2019).

10. (3pts) How many ways to choose 5 objects from the set of 8 distinct boxes of
objects (each box contains a large enough number of identical objects) if
(a) (1pt) the order of chosen objects does not matter, and all chosen objects are
different?

Answer: It is equal to the number of 5-combinations without repetition of


[8]. Hence, it is equal to C(8, 5).

3
(b) (1pt) the order of chosen objects is significant and chosen objects may be
identical?

Answer: It is equal to the number of 5-permutations with repetition of [8].


Hence, it is 85 .
(c) (1pt) the order of chosen objects does not matter, and chosen objects may
be identical?

Answer: It is equal to the number of 5-combinations with repetition of [8].


Hence, it is C(5 + 8 − 1, 5) = 12!
7!
5!.

11. (3pts)

(a) How many different words can be obtained by permuting the letters of the
word banana?
Answer:
it is equal to the number of permutations with repetition on the multiset
6!
{{b, a, n, a, n, a}} which gives 1!3!2! , where 6 is the cardinality of the multiset
and 1, 3, 2 are the number of occurrences of letters b, a, n respectively in the
multiset.
(b) Same question such that each obtained word does not contain two consecu-
tive n.
Answer:
Using the complementary rule:
6!
• The number of words with no restriction: 1!3!2!
• The number of words with two consecutive n is equal to the number
of permutations with repetition on the multiset {{b, a, nn, a, a}} which
5!
gives 1!3!1! , where 1, 3, 1 are the occurrence numbers of b, a, nn in the
multiset and 5 is the total number of occurrences.
• By the complementary rule: the number of words with no consecutive n
is
6! 5!
− .
1!3!2! 1!3!1!
(c) Same question such that each obtained word does not contain two consec-
utive n nor three consecutive a (Hint: Use the principle of inclusion and
exclusion).
Answer:

4
5!
• the number of words containing two consecutive n is 1!3!1!
4!
• the number of words containing 3 consecutive a is 1!2!1!
• the number of words containing 2 consecutive n and 3 consecutive a is
3!
1!1!1!
• by the PIE, the number of words not containing 2 consecutive n nor 3
6! 5! 4! 3!
consecutive a is 1!2!3! − 1!3!1! − 1!2!1! + 1!1!1! .
12. (5pts) Let An be the set of all tilings (or covers) of an n × 1 rectangle with three
kind pieces: a square one of size 1 × 1; a white one of size 2 × 1; and a black one
of size 2 × 1. For example, A1 = { }, A2 = { , , }

(a) Find A3 ;
Answer: On the white board!
(b) Let an = |An |. Give a recursive formula for an ;
Answer: an = an−1 + 2an−2 for n ≥ 2. Details are on the white board!
(c) Give a reduced form for the generating function of the sequence {an }∞
n=0 in
part (12b). By convention, a0 = 1.
Note: In case we cannot solve part (12b), please assume that an satisfies
the recursion
a0 = 0, an = 3an−1 + 3n−1 , for n ≥ 1.
1
Answer: f (x) = 1−x−2x2
. Details are on the white board!

(d) Find a closed formula for an .


1 2
Answer: We have f (x) = 3(1+x)
+ 3(1−2x)
. Hence, an = 13 (−1)n + 23 (2n ).

13. (1pt) Give a combinatorial proof for the following identity


   
2n n
=2 + n2 .
2 2
Answer: We will count the number of ways to choose 2 elements from 2n elements
by two different ways. Therefore, the two ways must give the same number.
2n

(a) Take directly 2 elements without order from 2n elements. There are 2
ways.
(b) Divide the set of 2n elements into two disjoint sets A and B, each set has n
elements. To choose 2 element from 2n elements there are 3 ways to do that
as follows
• choose 2 elements from n elements of A: There are n2 ways;


5
• choose 2 elements from n elements of B: There are n2 ways;


• choose 1 elements from n elements of A and 1 elements from n elements


of B: There are n2 ways.
By addition counting rule, there are 2 n2 + n2 ways.


Hence, 2n = 2 n2 + n2 .
 
2

You might also like