Uploaded by alexander.neblett

Discrete Math problems with solutions

advertisement
Problem 1 (5 points)
Determine if the following argument is valid. Use truth tables.
If this car is made in England, then parts are hard to get. This car is expensive, or it is not difficult to
obtain parts. But this car is not expensive. Hence, it is not made in England.
M - Made in England
P - Parts are hard to get
$ - Car Expensive
Answer
Considering the propositions ๐‘€, ๐‘ƒ and $ as given in the problem, we need to determine if the following
argument is valid:
๐‘€→๐‘ƒ
$ ∨ ¬๐‘ƒ
¬$
∴ ¬๐‘€
To verify if the argument is valid, we will check, with a truth table, if the following conditional
proposition is a tautology:
(๐‘€ → ๐‘ƒ) ∧ ($ ∨ ¬๐‘ƒ) ∧ (¬$) → ¬๐‘€
Table 1. Truth table for problem 1.
๐‘ฏ๐Ÿ
1
2
3
4
5
6
7
8
๐‘ฏ๐Ÿ
๐‘ฏ๐Ÿ‘
๐‘ฏ๐Ÿ’
๐‘ด ๐‘ท $ โž
โž โž
๐‘ด→๐‘ท โž
๐‘ฏ๐Ÿ ∧ ๐‘ฏ๐Ÿ ∧ ๐‘ฏ๐Ÿ‘
$ ∨ ¬๐‘ท ¬$
T T T
T
T
F
F
T T F
T
F
T
F
T F T
F
T
F
F
T F F
F
T
T
F
F T T
T
T
F
F
F T F
T
F
T
F
F F T
T
T
F
F
F F F
T
T
T
T
¬๐‘€
๐‘ฏ๐Ÿ’ → ¬๐‘€
F
F
F
F
T
T
T
T
T
T
T
T
T
T
T
T
The last column of our truth table shows that the argument is indeed a tautology, so it is therefore a
valid argumentโˆŽ
1 / 13
Problem 2 (3 points)
๐ด and ๐ต are ๐‘› × ๐‘› matrices such that ๐ด๐ต = ๐ต๐ด = ๐ŸŽ. Prove that (๐ด + ๐ต)๐‘˜ = ๐ด๐‘˜ + ๐ต ๐‘˜ for all ๐‘˜ in โ„ค+ .
Use any method of proof.
Answer
For this problem, we will use the fact that matrix multiplication is distributive. This is a basic property
of matrices that can be found in several resources on the internet and is also given in exercise 12 of
chapter 2.6 of the Rosen Textbook. We will also consider that matrix multiplication is associative, which
was given in the class lecture 03B. In this solution, when we write ๐ŸŽ, we mean the zero matrix.
Let us proceed with a proof by induction on ๐‘˜ and let us start by looking at some base cases.
For ๐‘˜ = 1, we have the trivial case (๐ด + ๐ต)๐‘˜ = (๐ด + ๐ต) = ๐ด + ๐ต, which is true.
For ๐‘˜ = 2, we consider the definition of matrix power and write (๐ด + ๐ต)2 = (๐ด + ๐ต)(๐ด + ๐ต)
Now we consider that the matrix multiplication is distributive, so
(๐ด + ๐ต)2 = (๐ด + ๐ต)(๐ด + ๐ต) = (๐ด + ๐ต)๐ด + (๐ด + ๐ต)๐ต
Distributing the multiplication again, we obtain:
(๐ด + ๐ต)2 = ๐ด๐ด + ๐ต๐ด + ๐ด๐ต + ๐ต๐ต
But we know that ๐ด๐ต = ๐ต๐ด = 0, so this means that
(๐ด + ๐ต)2 = ๐ด2 + 0 + 0 + ๐ต 2 = ๐ด2 + ๐ต 2
Which proves that the property is also true for ๐‘˜ = 2.
For ๐‘˜ = 3, we have that (๐ด + ๐ต)3 = (๐ด + ๐ต)(๐ด + ๐ต)2, but we just proved that (๐ด + ๐ต)2 = ๐ด2 + ๐ต 2, so
(๐ด + ๐ต)3 = (๐ด + ๐ต)(๐ด2 + ๐ต 2 ). Again, we apply the distributive property of the matrix multiplication to
obtain
(๐ด + ๐ต)3 = (๐ด + ๐ต)(๐ด2 + ๐ต 2 ) = (๐ด + ๐ต)๐ด2 + (๐ด + ๐ต)๐ต2 = ๐ด๐ด2 + ๐ต๐ด2 + ๐ด๐ต 2 + ๐ต๐ต 2
Now we use the definition of matrix power and the associative property to write
(๐ด + ๐ต)3 = ๐ด๐ด2 + (๐ต๐ด)๐ด + (๐ด๐ต)๐ต + ๐ต๐ต 2 = ๐ด3 + (0)๐ด + (0)๐ต + ๐ต 3 = ๐ด3 + ๐ต 3
And this equality proves that the property is also true for ๐‘˜ = 3.
Let us now assume that the property is true for some positive integer ๐‘›, i.e., (๐ด + ๐ต)๐‘› = ๐ด๐‘› + ๐ต ๐‘› . Now
we consider (๐ด + ๐ต)๐‘›+1 and apply the definition of matrix power to write
(๐ด + ๐ต)๐‘›+1 = (๐ด + ๐ต)(๐ด + ๐ต)๐‘›
By our hypothesis of induction, we have that (๐ด + ๐ต)๐‘› = ๐ด๐‘› + ๐ต ๐‘› , which means that
(๐ด + ๐ต)๐‘›+1 = (๐ด + ๐ต)(๐ด + ๐ต)๐‘› = (๐ด + ๐ต)(๐ด๐‘› + ๐ต ๐‘› )
Now we apply again the distributive property to rewrite this expression as
(๐ด + ๐ต)๐‘›+1 = (๐ด + ๐ต)๐ด๐‘› + (๐ด + ๐ต)๐ต๐‘› = ๐ด๐ด๐‘› + ๐ต๐ด๐‘› + ๐ด๐ต ๐‘› + ๐ต๐ต ๐‘›
Lastly, we use the associative property in the following manner
(๐ด + ๐ต)๐‘›+1 = ๐ด๐ด๐‘› + (๐ต๐ด)๐ด๐‘›−1 + (๐ด๐ต)๐ต ๐‘›−1 + ๐ต๐ต ๐‘› = ๐ด๐‘›+1 + (0)๐ด๐‘›−1 + (0)๐ต ๐‘›−1 + ๐ต ๐‘›+1
And with this, we have shown that (๐ด + ๐ต)๐‘›+1 = ๐ด๐‘›+1 + ๐ต ๐‘›+1.
This concludes the proof by induction that, for all ๐‘˜ ∈ โ„ค+ , (๐ด + ๐ต)๐‘˜ = ๐ด๐‘˜ + ๐ต ๐‘˜ โˆŽ
2 / 13
Problem 3 (4 points)
For all sets ๐ถ and ๐ท, Prove or disprove: ๐‘ท(๐ถ × ๐ท) = ๐‘ท(๐ถ) × ๐‘ท(๐ท). (๐‘ท(๐‘‹) is the power set of ๐‘‹).
Answer
We will disprove that ๐‘ท(๐ถ × ๐ท) = ๐‘ท(๐ถ) × ๐‘ท(๐ท) by providing a counterexample.
Let ๐ถ = {1} and ๐ท = {2, 3}
Cartesian product ๐ถ × ๐ท = {(1, 2), (1, 3)}
Power set of ๐ถ, ๐‘ท(๐ถ) = {∅, {1}}
Power set of ๐ท, ๐‘ท(๐ท) = {∅, {2}, {3}, {2,3}}
Powerset of cartesian product:
๐‘ท(๐ถ × ๐ท) = {Ø, {(1, 2)}, {(1, 3)}, {(1, 2), (1, 3)}}
Cartesian product of power sets:
๐‘ท(๐ถ) × ๐‘ท(๐ท) = {(Ø, Ø), (Ø, {2}), (Ø, {3}), (Ø, {2, 3}), ({1}, Ø), ({1}, {2}), ({1}, {3}), ({1}, {2, 3})}
We notice that ๐‘ท(๐ถ × ๐ท) and ๐‘ท(๐ถ) × ๐‘ท(๐ท) are different sets. In fact, they do not even have the same
cardinality in this example.
In general, we notice that |๐‘ท(๐ถ × ๐ท)| = 2|๐ถ|⋅|๐ท|
And, on the other hand, |๐‘ท(๐ถ) × ๐‘ท(๐ท)| = (2|๐ถ| )(2|๐ท| ) = 2|๐ถ|+|๐ท|
So the cardinality of the two sets are not necessarily equal. Therefore, it is not true that for all sets ๐ถ
and ๐ท, ๐‘ท(๐ถ × ๐ท) = ๐‘ท(๐ถ) × ๐‘ท(๐ท).
3 / 13
Problem 4 (5 points)
For some set ๐‘†, let ๐ด, ๐ต be elements of ๐‘ท(๐‘†). Define ๐ด ๐‘… ๐ต if the symmetric difference of sets ๐ด and ๐ต
is finite. Prove that ๐‘… is an equivalence relation.
Answer
We will prove that ๐‘… is reflexive, symmetric and transitive.
Reflexive
Suppose that ๐ด is an element of ๐‘ท(๐‘†). We note that the symmetric difference of ๐ด with itself is:
๐ด ⊕ ๐ด = (๐ด\๐ด)โ‹ƒ(๐ด\๐ด) = ∅โ‹ƒ∅ = ∅
And the empty set is clearly a finite set. Thus, (๐ด, ๐ด) ∈ ๐‘…. This proves that ๐‘… is reflexive.
Symmetric
Suppose that ๐ด and ๐ต are elements of ๐‘ท(๐‘†) such that (๐ด, ๐ต) ∈ ๐‘…. By definition of the relation, this
means that ๐ด ⊕ ๐ต is a finite set. Now we look at the definition of symmetric difference:
๐ด ⊕ ๐ต = (๐ด\๐ต)โ‹ƒ(๐ต\๐ด)
But the set union is commutative, so ๐ด ⊕ ๐ต = (๐ด\๐ต)โ‹ƒ(๐ต\๐ด) = (๐ต\๐ด)โ‹ƒ(๐ด\๐ต) = ๐ต ⊕ ๐ด. This means
that the symmetric difference is also commutative. Hence, ๐ด ⊕ ๐ต and ๐ต ⊕ ๐ด are the same set, so if one
is finite, the other one is also finite. Since ๐ต ⊕ ๐ด is a finite set, then (๐ต, ๐ด) ∈ ๐‘…. This proves that ๐‘… is
symmetric.
Transitive
Suppose that ๐ด, ๐ต and ๐ถ are elements of ๐‘ท(๐‘†) such that (๐ด, ๐ต) ∈ ๐‘… and (๐ต, ๐ถ) ∈ ๐‘…. By definition of the
relation, this means that ๐ด ⊕ ๐ต and ๐ต ⊕ ๐ถ are finite sets.
Recall that if ๐‘‹ and ๐‘Œ are two sets, then |๐‘‹โ‹ƒ๐‘Œ| = |๐‘‹| + |๐‘Œ| − |๐‘‹โ‹‚๐‘Œ|. It follows that if ๐‘‹ and ๐‘Œ are both
finite sets, then |๐‘‹โ‹ƒ๐‘Œ| ≤ |๐‘‹| + |๐‘Œ| so ๐‘‹โ‹ƒ๐‘Œ is also a finite set.
We will prove that ๐ด ⊕ ๐ถ ⊆ (๐ด ⊕ ๐ต)โ‹ƒ(๐ต ⊕ ๐ถ), which suffices to conclude that ๐ด ⊕ ๐ถ is a finite set.
Let ๐‘ฅ ∈ (๐ด ⊕ ๐ถ). By definition of symmetric difference, ๐‘ฅ is an element of ๐ด or ๐‘ฅ is an element of ๐ถ,
but not both simultaneously.
•
•
Case 1: ๐‘ฅ ∈ ๐ด, ๐‘ฅ ∉ ๐ถ
o If ๐‘ฅ ∈ ๐ต, then ๐‘ฅ ∈ (๐ต ⊕ ๐ถ), so ๐‘ฅ ∈ (๐ด ⊕ ๐ต)โ‹ƒ(๐ต ⊕ ๐ถ)
o If ๐‘ฅ ∉ ๐ต, then ๐‘ฅ ∈ (๐ด ⊕ ๐ต), so ๐‘ฅ ∈ (๐ด ⊕ ๐ต)โ‹ƒ(๐ต ⊕ ๐ถ)
Case 2: ๐‘ฅ ∉ ๐ด, ๐‘ฅ ∈ ๐ถ
o If ๐‘ฅ ∈ ๐ต, then ๐‘ฅ ∈ (๐ด ⊕ ๐ต), so ๐‘ฅ ∈ (๐ด ⊕ ๐ต)โ‹ƒ(๐ต ⊕ ๐ถ)
o If ๐‘ฅ ∉ ๐ต, then ๐‘ฅ ∈ (๐ต ⊕ ๐ถ), so ๐‘ฅ ∈ (๐ด ⊕ ๐ต)โ‹ƒ(๐ต ⊕ ๐ถ)
With this, we have shown that ๐ด ⊕ ๐ถ ⊆ (๐ด ⊕ ๐ต)โ‹ƒ(๐ต ⊕ ๐ถ). Therefore, ๐ด ⊕ ๐ถ is a finite set and
(๐ด, ๐ถ) ∈ ๐‘…. This proves that ๐‘… is transitive.
We have proven that ๐‘… is reflexive, symmetric and transitive, so it is an equivalence relationโˆŽ
4 / 13
Problem 5 (4 points)
We draw cards from an ordinary deck of 52 playing cards. The cards are to be drawn successively at
random and without replacement. What is the probability that the second heart appears on the seventh
draw?
Let: H = event that 1 heart appears in the first 6 cards drawn.
J = event that it is a heart in the 7th draw.
Answer
Let ๐ป and ๐ฝ be the events as defined in the problem. We need to obtain ๐‘ƒ(๐ฝโ‹‚๐ป), that is, the probability
that exactly 1 heart appears within the first 6 draws and that a heart appears in the 7th draw.
For this calculation, we will use the definition of conditional probability (ZyBooks 7.3.1).
๐(๐‘ฑ|๐‘ฏ) =
[1]
๐(๐‘ฑโ‹‚๐‘ฏ)
๐(๐‘ฏ)
๐(๐‘ฑโ‹‚๐‘ฏ) = ๐(๐‘ฑ|๐‘ฏ) ๐(๐‘ฏ)
Now we will look at the event ๐‘ฏ. To count the number of ways in which exactly 1 heart appears in the
first 6 cards drawn, we will consider the number of ways in which a heart can be the first card drawn and
then the other 5 cards are not hearts. For the first card, there are 13 different ways to draw a heart, for
the second card, there are 39 different ways to draw a non-heart, for the third card, there are 38 different
ways to draw a non-heart, and so on. Then, we have to consider that the heart could be in any of the six
positions of cards drawn. Hence, the cardinality is
|๐‘ฏ| = ๐Ÿ๐Ÿ‘(๐Ÿ‘๐Ÿ—)(๐Ÿ‘๐Ÿ–)(๐Ÿ‘๐Ÿ•)(๐Ÿ‘๐Ÿ”)(๐Ÿ‘๐Ÿ“)(๐Ÿ”)
The total number of ways in which the 6 cards can be drawn is (๐Ÿ“๐Ÿ)(๐Ÿ“๐Ÿ)(๐Ÿ“๐ŸŽ)(๐Ÿ’๐Ÿ—)(๐Ÿ’๐Ÿ–)(๐Ÿ’๐Ÿ•). Thus, the
probability of the event ๐‘ฏ is:
๐Ÿ๐Ÿ‘(๐Ÿ‘๐Ÿ—)(๐Ÿ‘๐Ÿ–)(๐Ÿ‘๐Ÿ•)(๐Ÿ‘๐Ÿ”)(๐Ÿ‘๐Ÿ“)(๐Ÿ”)
๐‘ท(๐‘ฏ) =
≈ ๐ŸŽ. ๐Ÿ‘๐Ÿ”๐Ÿ•๐Ÿ”๐Ÿ“
(๐Ÿ“๐Ÿ)(๐Ÿ“๐Ÿ)(๐Ÿ“๐ŸŽ)(๐Ÿ’๐Ÿ—)(๐Ÿ’๐Ÿ–)(๐Ÿ’๐Ÿ•)
Now we will look at ๐‘ท(๐‘ฑ|๐‘ฏ). If one heart has been drawn in the first six cards, then there are 12 hearts
left in the deck of a total of 46 cards left. We can calculate the probability as:
๐Ÿ๐Ÿ
๐‘ท(๐‘ฑ|๐‘ฏ) =
≈ ๐ŸŽ. ๐Ÿ๐Ÿ”๐ŸŽ๐Ÿ–๐Ÿ•
๐Ÿ’๐Ÿ”
Finally, the probability we seek to calculate can be obtained using formula [1]
๐(๐‘ฑโ‹‚๐‘ฏ) = ๐(๐‘ฑ|๐‘ฏ) ๐(๐‘ฏ) ≈ (๐ŸŽ. ๐Ÿ๐Ÿ”๐ŸŽ๐Ÿ–๐Ÿ•)(๐ŸŽ. ๐Ÿ‘๐Ÿ”๐Ÿ•๐Ÿ”๐Ÿ“) ≈ ๐ŸŽ. ๐ŸŽ๐Ÿ—๐Ÿ“๐Ÿ—๐Ÿ = ๐Ÿ—. ๐Ÿ“๐Ÿ—๐Ÿ%
The probability that the second heart appears on the seventh draw is (approximately) 9.591%.
5 / 13
Problem 6 (4 points)
When is the sum of ๐‘› consecutive integers divisible by ๐‘›? Prove your answer.
Answer
Let ๐‘† be the sum of ๐‘› consecutive integers, starting at some integer ๐‘Ž.
๐‘† = ๐‘Ž + (๐‘Ž + 1) + (๐‘Ž + 2) + โ‹ฏ + (๐‘Ž + ๐‘› − 1)
๐‘† = ๐‘Ž๐‘› + (1 + 2 + 3 + โ‹ฏ + (๐‘› − 1))
Here we recognize the Gaussian sum 1 + 2 + 3 + โ‹ฏ + (๐‘› − 1) =
(๐‘›−1)๐‘›
2
, so
๐‘›(๐‘› − 1)
2
We notice that the first term ๐‘Ž๐‘› is a multiple of ๐‘›, so it is always divisible by ๐‘›. If the second term is
divisible by ๐‘›, then so is ๐‘†. Inversely, if the second term is not divisible by ๐‘›, then ๐‘† is not divisible by
๐‘› either. We will look at the following two cases.
๐‘† = ๐‘Ž๐‘› +
•
Case 1: ๐‘› is even. Then, there exists an integer ๐‘š such that ๐‘› = 2๐‘š
2๐‘š(๐‘› − 1)
= ๐‘Ž๐‘› + ๐‘š(๐‘› − 1)
2
We have that ๐‘› and (๐‘› − 1) are relatively prime (gcd(๐‘› − 1, ๐‘›) = 1), so they share no factors in
common. Furthermore, ๐‘š is a submultiple of ๐‘›, so ๐‘› cannot divide ๐‘š. Hence, ๐‘› does not divide
๐‘š(๐‘› − 1), which means that ๐‘› does not divide ๐‘†.
๐‘† = ๐‘Ž๐‘› +
•
Case 2: ๐‘› is odd. Then, there exists an integer ๐‘š such that ๐‘› = 2๐‘š + 1
๐‘›(2๐‘š + 1 − 1)
= ๐‘Ž๐‘› + ๐‘›๐‘š = ๐‘›(๐‘Ž + ๐‘š)
2
Since ๐‘Ž and ๐‘š are both integers, it is clear that ๐‘›(๐‘Ž + ๐‘š) is an integer that is a multiple of ๐‘›. Therefore,
๐‘† is divisible by ๐‘›.
๐‘† = ๐‘Ž๐‘› +
It follows that the sum of ๐‘› consecutive integers is divisible by ๐‘› only when ๐‘› is oddโˆŽ
6 / 13
Problem 7 (4 points)
Is the number 1625 + 2516 divisible by 8? Is it divisible by 17? Justify your answer. Do not solve just
by doing the division. No calculators are allowed for this question. You must show all your work,
including details of any non-trivial multiplications, additions, etc. You must convince me that you can
do the calculations and find the answer without a calculator.
Answer
Let ๐‘† = 1625 + 2516 .
We note that 1625 is a power of 2, so it is even, but 2516 does not have 2 as a factor, so ๐‘† is the sum of
an even number and an odd number. Therefore, ๐‘† is an odd number. Since ๐‘† is an odd number, it is not
divisible by 2, so it is clearly not divisible by 23 = 8.
We will now use congruences modulo 17 to find the residual of ๐‘† when divided by 17.
๐‘† ≡ 1625 + 2516 (๐‘š๐‘œ๐‘‘ 17)
๐‘† ≡ 1625 + 2516 ≡ (17 − 1)25 + (17 + 8)16 ≡ (0 − 1)25 + (0 + 8)16 ≡ (−1)25 + 816
๐‘† ≡ −1 + ((8)2 )8 ≡ −1 + (64)8 ≡ −1 + (17 ⋅ 3 + 13)8 ≡ −1 + (0 + 13)8
๐‘† ≡ −1 + ((13)2 )4 ≡ −1 + (169)4 ≡ −1 + (17 ⋅ 10 − 1)4 ≡ −1 + (0 − 1)4
๐‘† ≡ −1 + (−1)4 ≡ −1 + 1 ≡ 0 (๐‘š๐‘œ๐‘‘ 17)
The residual modulo 17 of ๐‘† is zero, so it is divisible by 17.
We conclude that ๐Ÿ๐Ÿ”๐Ÿ๐Ÿ“ + ๐Ÿ๐Ÿ“๐Ÿ๐Ÿ” is not divisible by 8, but it is divisible by 17.
7 / 13
Problem 8 (4 points)
Solve this instance of Instant Insanity by providing the correct two subgraphs.
We will solve the puzzle by following these steps:
1. Number the cubes from 1 to 4.
2. Draw a graph with each vertex representing a color.
3. For each of the three pairs of opposite faces on each cube, draw an edge between the two vertices
of the corresponding colors, labeling that edge by the number of that cube.
4. Look for a loop that visits each color once, with a different label on each edge and mark the loop
on the graph.
This loop will represent the top edges of the arrangement of cubes.
5. Look for a second loop with a different label on each edge that does not use any of the edges in
the first loop and mark it on the graph.
This loop will represent the front/back edges of the arrangement of cubes.
4
2
1
1
3
2
3
4
2
3
4
1
Figure 1. Graph of the insanity cubes.
Solution: The first loop is R-4-G-2-B-1-W-3-R and is colored in orange.
The second loop is R-2-R, W-3-B-4-W, G-1-G, and is colored in purple.
8 / 13
Problem 9 (4 points)
Given an acyclic graph ๐บ with ๐‘› vertices and ๐‘˜ ≥ 1 connected components. Find and prove how many
edges in ๐บ.
Answer
We will use the fact that a tree (connected, acyclic graph) with ๐‘› vertices has ๐‘› − 1 edges. This was
given in lecture 13B.
Let ๐บ be an acyclic graph with ๐‘› vertices and ๐‘˜ ≥ 1 connected components as given. Let ๐บ1 , ๐บ2 , … , ๐บ๐‘˜
be the ๐‘˜ connected component of ๐บ. Since each of the ๐บ๐‘– is acyclic (because it is part of ๐บ) and is a
connected component, then it follows that each ๐บ๐‘– is a tree. Let us also call ๐‘›๐‘– the number of nodes in ๐บ๐‘– .
As per the theorem given in lecture 13B, each ๐บ๐‘– has ๐‘›๐‘– − 1 edges. The ๐บ๐‘– are different connected
components, so there is no edge that belongs to two of them at the same time. Therefore, the total
number of edges in ๐บ is the sum of the total number of edges in the connected components. Likewise,
each node belongs to only one connected component, so the total number of nodes is the sum of the total
number of nodes in the connected components.
๐‘’๐‘‘๐‘”๐‘’๐‘  = (๐‘›1 − 1) + (๐‘›2 − 1) + โ‹ฏ + (๐‘›๐‘˜ − 1)
๐‘˜ ๐‘ก๐‘–๐‘š๐‘’๐‘ 
(1 + 1 + โ‹ฏ + 1)
๐‘’๐‘‘๐‘”๐‘’๐‘  = (๐‘›1 + ๐‘›2 + โ‹ฏ + ๐‘›๐‘˜ ) − โž
๐‘’๐‘‘๐‘”๐‘’๐‘  = ๐‘› − ๐‘˜
Thus, we have proven that the number of edges in ๐‘ฎ is ๐’ − ๐’ŒโˆŽ
9 / 13
Problem 10 (3 points)
Suppose that the adjacency matrix for some graph is nilpotent. Recall that a nilpotent matrix ๐‘จ is one
for which ๐‘จ๐’Œ = ๐ŸŽ (zero matrix) for some ๐’Œ. What does that tell you about the graph? Be specific and
detailed. Include two useful examples.
Answer
Let ๐บ be the graph and let ๐‘ข and ๐‘ฃ be two vertices in ๐บ. The Graph Power Theorem (ZyBooks 12.6.1)
tells us that there is an edge from ๐‘ข to ๐‘ฃ in ๐บ ๐‘˜ if and only if there is a walk of length ๐‘˜ from ๐‘ข to ๐‘ฃ in ๐บ.
Furthermore (ZyBooks 12.71.1), if ๐ด is the adjacency matrix for ๐บ, then for any ๐‘˜ ≥ 1, ๐ด๐‘˜ is the
adjacency matrix of ๐บ ๐‘˜ , where Boolean addition and multiplication are used to compute ๐ด๐‘˜ .
Suppose that ๐ด is nilpotent, so there exists some positive integer ๐‘› for which ๐ด๐‘› = ๐ŸŽ. This means that
there is no walk between any two points in ๐บ of length ๐‘› or more.
Now let us consider a graph ๐บ1 that is an undirected graph and has at least one edge. Let ๐‘ข1 and ๐‘ฃ1 be
the vertices connected by an edge in ๐บ1 . Since ⟨๐‘ข1 , ๐‘ฃ1 ⟩ is a valid walk and ⟨๐‘ฃ1 , ๐‘ข1 ⟩ is also a valid walk,
then for any positive integer ๐‘š, it is always possible to form a walk of length ๐‘š by simply walking back
and forth between ๐‘ข1 and ๐‘ฃ1 ๐‘š times. Therefore, by the cited theorem, the adjacency matrix of an
undirected graph with at least one edge is not nilpotent, because there is always a walk between two
points of length ๐‘š for any positive integer ๐‘š.
Now let us consider a directed graph ๐บ2 that has at least one cycle. Given any positive integer ๐‘š, it is
always possible to traverse the vertices in the cycle to form a walk of length ๐‘š, walking around the
cycle many times if needed. Therefore, by the cited theorem, the adjacency matrix of a directed graph
with a cycle is not nilpotent, because there is always a walk between two points of length ๐‘š for any
positive integer ๐‘š.
It is then concluded that if ๐ด is nilpotent, then ๐บ cannot be undirected and cannot have a cycle, i.e., ๐บ is
a directed acyclic graph.
Example 1
Rooted tree with four vertices.
a
b
c
d
๐‘Ž
๐ด= ๐‘
๐‘
๐‘‘
๐‘Ž
0
0
0
0
๐‘
1
0
0
0
๐‘
1
0
0
0
๐‘‘
0
0
0
0=[
0
1
0
0
0 0 0 1
0 0 0 0
๐ด2 = [
]
0 0 0 0
0 0 0 0
The graph is directed acyclic and ๐ด is nilpotent.
1
0
0
0
1
0
0
0
0
0
]
1
0
0
0
๐ด3 = [
0
0
0
0
0
0
0
0
0
0
0
0
].
0
0
10 / 13
Example 2
Directed graph that consists of a single cycle of 4 vertices.
b
a
d
c
๐‘Ž
๐ด= ๐‘
๐‘
๐‘‘
๐‘Ž
0
0
0
1
๐‘
1
0
0
0
๐‘
0
1
0
0
๐‘‘
0
0
0
0=[
0
1
1
0
1
0
0
0
0
1
0
0
0
0
]
1
0
0 0 1 0
0 0 0 1
1 0 0 0
0 1 0 0
0 0 0 1
1 0 0 0
0 1 0 0
0 0 1 0
๐ด2 = [
] ๐ด3 = [
] ๐ด4 = [
] ๐ด5 = [
]
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
0 1 0 0
0 0 1 0
0 0 0 1
1 0 0 0
5
Notice that ๐ด = ๐ด, so the powers of ๐ด repeat in cycles of 4. Hence ๐ด is not nilpotent in this directed
graph with a cycle.
11 / 13
Problem 11 (8 points)
Use induction to prove the number of nodes in rooted 5-ary tree with ๐‘˜ levels, when all possible nodes
are present.
Answer
We will use induction over the non-negative integer ๐‘˜ to prove that the number of nodes is ๐‘๐‘˜ =
Let us first look at some base cases.
For ๐‘˜ = 0, the tree is a single vertex, and ๐‘0 =
for ๐‘˜ = 0.
50+1 −1
5−1
5๐‘˜+1 −1
5−1
.
4
= 4 = 1. This shows that our formula is correct
For ๐‘˜ = 1, the 5-ary tree is as shown in Figure 2.
1
2
3
4
6
5
Figure 2. 5-ary tree with 1 level when all possible nodes are present.
The nodes have been labeled sequentially and it is evident that there are 6 nodes. Using our proposed
formula, we get ๐‘1 =
51+1 −1
5−1
=
24
4
= 6. This shows that our formula is correct for ๐‘˜ = 1
For ๐‘˜ = 2, the 5-ary tree is as shown in Figure 3.
7
1
2
3
4
8
5
6
12 13 14 15 16
9
10
11
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Figure 3. 5-ary tree with 2 levels when all possible nodes are present.
Counting one by one, we find that there is a total of 31 nodes. Using our proposed formula, we get
๐‘2 =
52+1 −1
5−1
=
124
4
= 31. This shows that our formula is correct for ๐‘˜ = 2.
Now let us assume that the number of nodes in a rooted 5-ary tree with ๐‘› levels, when all possible nodes
are present, is given by ๐‘๐‘› =
5๐‘›+1 −1
5−1
.
We will construct a 5-ary tree with ๐‘› + 1 levels in the following manner:
i.
Take one 5-ary tree with ๐‘› levels that has all possible nodes present and copy it 5 times, all at the
same level. This gives us a forest of 5 rooted 5-ary trees.
12 / 13
ii.
iii.
Add one new node above the 5 rooted trees.
Add one directed edge from this new node to the root of each of the five 5-ary trees.
The new node becomes the only root of the newly constructed tree, which has ๐‘› + 1 levels. Since each
of the 5-ary trees with ๐‘› levels that we used has all their possible nodes, and the root of the new tree has
5 children, then the new tree with ๐‘› + 1 levels has all its possible nodes.
To count the number of nodes in the new tree with ๐‘› + 1 levels, we will consider that our hypothesis of
induction is true for each of the five 5-ary trees with ๐‘› levels that we used, and then we added just one
additional node, so the total number of nodes is given by:
๐‘๐‘›+1 = 5๐‘๐‘› + 1 = 5 (
๐‘๐‘›+1 =
5๐‘›+2 −5
5−1
+1=
5๐‘›+1 −1
5(5๐‘›+1 )−5
5−1
5−1
)+1=
5๐‘›+2 −5+5−1
5−1
=
+1
5๐‘›+2 −1
5−1
And this formula matches our proposed formula of ๐‘๐‘˜ when ๐‘˜ = ๐‘› + 1. This concludes our proof by
induction. With this, we have proved that the number of nodes in a rooted 5-ary tree with ๐‘˜ levels, when
all possible nodes are present is ๐‘๐‘˜ =
5๐‘˜+1 −1
5−1
โˆŽ
13 / 13
Download