UMBC CMSC203, Discrete Structures, Spring 2009
Homework Assignments
Notation:
Throughout, we will use these references:
 Rosen 6/e, Rosen 5/e and Rosen 4/e indicate
respectively the sixth, fifth and fourth editions of
Discrete Mathematics and Its Applications, Kenneth Rosen,
McGrawHill.
 Epp 3/e and Epp 2/e indicate respectively the
third and second editions of
Discrete Mathematics with Applications, Susanna S. Epp, Thomson
Publishing.
 [Adapted from Rosen 6/e]
State whether each of the following relationships between
sets is true or false. Justify your answer briefly.
(Here, ∅ is the empty set.)
 ∅ ∈ ∅
 {∅} ∈ {∅}
 ∅ ∈ {∅}
 {∅} ⊆ {∅}
 ∅ ⊆ ∅
 [Adapted from Epp 3/e]
Let R be the set of all real numbers and let
A indicate
the complement of the set A. We define the sets A,
B and C as follows:
A = { x ∈ R  3 ≤ x ≤ 0 }
B = { x ∈ R  1 < x < 2 }
C = { x ∈ R  6 < x ≤ 8 }
Describe the following sets:
 A ∪ B
 A ∩ C

A
∪
B
 A ∩
B

A ∪ B
 For each of the following functions, state whether the function
is onetoone, whether the function is onto and whether the function
is a bijection. Pay close attention to the domain and codomain
of each function. Briefly justify your answer.
 f : N → N,
f (n) = n^{2} + 5.
 f : Z → Z,
f (n) = n^{2} + 5.
 f : N → N,
f (n) = 2 n + 7.
 f : R → R,
f (x) = 2 x + 7.
 f : R → R,
f (x) = 2 x^{3} + 1.
Note: N, Z and R denote the set of natural numbers,
integers and real numbers respectively.
 Questions 4, 5 and 6 are on this handout: hw1456.pdf.
 Questions 4, 5 and 6 are on this handout: hw1456.pdf.
 Questions 4, 5 and 6 are on this handout: hw1456.pdf.
 Real Maps.
Theoretically, the Four Color Theorem tells us that
every map can be colored with 4 colors so that every
region is colored differently from a neighboring region.
However, real maps have "real considerations" and might
require 5 colors. Name one such consideration. Give
an example of a "real" map that requires 5 colors.
 Hamiltonian Circuits.
[Adapted from Problem Solving Through Recreational Mathematics by
Averbach & Chein, 1980.]
A graph has a Hamiltonian circuit if there is a path in the
graph that visits every vertex exactly once and returns to the first vertex
in the path. Does the graph below have a Hamiltonian
circuit? Justify your answer.
 Regular Graphs.
In a dregular graph, every vertex in the graph has degree d.
Recall that the degree of a vertex is the number of edges incident on the
vertex. (I.e., count the number of edges coming out of a vertex and that is
its degree.)
 Draw a 3regular graph with 6 vertices.
 Draw a 3regular graph with 8 vertices.
 Draw a 3regular graph with 10 vertices.
 Are there any 3regular graphs with 9 vertices?
why or why not?
 Tautologies. Use a truth table to show that the following
proposition is a tautology. You must show the intermediate steps in
the truth table.
(¬ (p ∨ q)) ⊕
( (¬p) → q)
 Knights and Knaves.
[From "A Whole Slew of ComputerGenerated Knights and Knaves Puzzles"
by Zac Ernst, 1999.]
Statements made by knights are true. Statements made by knaves are
false. You meet three people, Joe, Zippy and Alice. You know that
each is either a knight or a knave. This is what they said:
Joe: "Alice is a knave and Zippy is a knight."
Zippy: "I am a knight or Joe is a knave."
Alice: "Zippy is a knave."
Which of Joe, Zippy and Alice are knights? which are knaves?
Show your reasoning.
 Robins on Thursday.
[Adapted from Problem Solving Through Recreational Mathematics by
Averbach & Chein, 1980.]
Suppose that we know the
following statement is true:
If today is Thursday and the sun is shining, then
either the robins are singing or it is not summer.
Let p = "Today is Thursday", q = "the sun is shining",
r = "the robins are singing" and s = "it is summer".

Rewrite the statement above using logic operators and the
variables p, q, r and s.
 If you find out that "It is summer and the robins are not
singing", what can you conclude?
Show your reasoning.
 If you find out that "Today is Thursday and the robins are singing",
what can you conclude?
Show your reasoning.
 If you find out that "Today is Thursday and the robins are not
singing", what can you conclude?
Show your reasoning.
For this homework assignment, you are asked to provide 4 proofs.
Remember that proofs are written in English. You proof should
not be a sequence of arithmetic equations. There must be a narrative
composed of complete English sentences, correctly punctuated, with
math symbols mixed in as appropriate, which convinces the reader
that the claim is correct.
 Indirect Proof.
Give an indirect proof for the following claim:
If n^{3} + 13 is an odd integer, then n is an even integer.
 Proof by Contradiction.
Prove by contradiction that the Grötzsch Graph shown below is not
3colorable. Hint: Note that the graph has a 5way symmetry.
Another Hint: Look at the cycle adkjba. How many colors does it
take to color this cycle? How many times does each color appear?
 Proof by Cases.
Prove that the 5clique (a.k.a. K_{5}) shown below
is not planar. Make your argument by cases. Pictures are helpful.
 Equivalence Proof. [Adapted from Rosen 5/e]
Prove the equality of the two sets below by showing that every element of
the set on the left hand side of the equality is also an element of the set
on the right hand side, and vice versa. (I.e., do not prove this using
algebraic identities.)
(B − A) ∪ (C − A)
=
(B ∪ C) − A
 Arithmetic with mod. Use the repeated squaring technique
to compute 26^{37} % 77. Show all of your work. Your work
should not have any numbers bigger than 77^{2} = 5929.
 Inverses mod 23. For each integer x,
1 ≤ x < 23, find an integer y,
1 ≤ y < 23, such that
x ⋅ y ≡ 1 (mod 23).
In other words, x ⋅ y % 23 = 1.
Then, x and y are called inverses modulo 23.
 A Shortcut. Fermat's Little Theorem states that
if p is prime, then for any integer a not divisible
by p,
a^{ p − 1} ≡ 1 (mod p).
Take advantage of Fermat's Little Theorem to compute the value
9^{5282} % 17 by noticing that 9^{16} ≡ 1 (mod
17).
Show your work.
 Euclid's Algorithm.
Use Euclid's algorithm to compute the greatest common divisor of
1413828 and 551655. Show all your work.
Note: Do not use a computer program to do this computation.
 RSA Key Generation.
Suppose that you picked p = 1307 and q = 1129 for your
RSA keys. Then, n = 1475603 and φ(n) =
(p  1)(q  1) = 1473168. You still need to find
e and d such that e ⋅ d %
φ(n) = 1. Use the Extended Euclid Algorithm to
help you find an e and a d. Make sure you report
e and d as positive values less than φ(n).
Show your work using the Extended Euclid Algorithm.
(See notes on the Extended Euclid Algorithm.)
Note: Do not use a computer program to do this computation.
Additional Note: You need to pick an e such that
gcd(e,φ(n)) = 1. The usual recommendation
is to pick a prime number. However, you must still check that
gcd(e,φ(n)) = 1 when e is prime,
because it is possible that e divides φ(n).
For example, in this problem picking e = 3 doesn't work
because φ(n) = 1473168 is divisible by 3 and so
gcd(3,1473168) = 3. There are no inverses of 3 modulo 1473168.
Another Additional Note: You are not allowed to pick e = 1.
 A System of Congruences.
Use the Chinese Remainder Theorem to find an integer x such that
0 ≤ x < 1456 and the following congruences hold:
x ≡ 3 (mod 7)
x ≡ 6 (mod 13)
x ≡ 12 (mod 16)
Note that 7 ⋅ 13 ⋅ 16 = 1456 and recall that the notation
a ≡ b (mod n)
means that a % n = b % n, where
% is the remainder operator. Show your work.
(See notes on the Chinese Remainder Theorem.)
For better typesetting, you can download this homework set in PDF:
hw7.pdf (31.8 kbytes).
In the following questions you are asked to use proof by induction.
Your proof must not simply be a sequence of equations, even if the
statement you are proving is arithmetic in nature. Clearly indicate
using complete English sentences:
1) what you are allowed to assume from the induction hypothesis,
2) what you need to show to establish the induction step, and 3)
which steps of the proof uses the induction hypothesis.
 Prove by induction that for all integers n ≥ 1
1^{3} +
2^{3} +
3^{3} +
⋅⋅⋅
n^{3} = [ n (n+1) / 2]^{2}
 Prove by induction that for all integers n ≥ 1
 Prove by induction that for all integers n ≥ 2
(1 − 2 ^{−2})
⋅
(1 − 3 ^{−2})
⋅
(1 − 4 ^{−2})
⋅⋅⋅
(1 − n ^{−2})

= 

. 
In the following questions you are asked to use proof by induction.
Your proof must not simply be a sequence of equations, even if the
statement you are proving is arithmetic in nature. Clearly indicate
using complete English sentences:
1) what you are allowed to assume from the induction hypothesis,
2) what you need to show to establish the induction step, and 3)
which steps of the proof uses the induction hypothesis.
 Fibonnaci Numbers. [Adapted from Rosen 5/e]
The Fibonacci numbers
f_{0}, f_{1},
f_{2}, ...
are defined recursively by
f_{0} = 0,
f_{1} = 1,
f_{2} = 1 and for all n ≥ 3,
f_{n} = f_{n − 1} +
f_{n − 2 }.
Use structural induction to show that
( f_{1} )^{2} +
( f_{2} )^{2} +
⋅⋅⋅ +
( f_{n} )^{2}
=
f_{n}
f_{n+1}
 String Reversal. [Adapted from Rosen 5/e]
In this problem, we consider only strings over {0, 1} of length
greater than or equal to 0. For example, the string 01001 is a
string of length 5. We use λ to denote the empty string.
For a string w we can define the reversal of the string,
written w^{R}, as follows:
 λ^{R} = λ
 for a string x, ( 0 x )^{R} =
x^{R} 0.
 for a string x, ( 1 x )^{R} =
x^{R} 1.
For example, we can unwind the recursive definition of 01001^{R}
by:
01001^{R}
= 1001^{R}0
= 001^{R}10
= 01^{R}010
= 1^{R}0010
= λ^{R}10010
= λ10010
= 10010.
Use structural induction to prove that for all strings
w and x, (w x)^{R}
= x^{R} w^{R}.
Additional Note:
For this problem, you may assume without proof that
string concatenation is associative. So, given 3 strings
x, y and z,
( x y ) z
=
x ( y z ).
 Partition.
Consider the following function written in the C programming language:
int partition(int A[], int n) {
int i, j ; /* array indices */
int x ; /* pivot item */
int temp ;
x = A[0] ;
i = 1 ;
j = n ;
while (1) {
do {
j ;
} while (A[j] > x) ;
do {
i++ ;
} while (A[i] < x) ;
if (i < j) {
temp = A[i] ; /* swap A[i] and A[j] */
A[i] = A[j] ;
A[j] = temp ;
} else {
return j ;
}
}
}

Suppose that partition(A, n) is called with an
array A holding the 12 items
16, 22, 12, 8, 15, 11, 10, 7, 14, 5, 9, 24
and with n equal 12. How is A rearranged when
partition returns? What is the meaning of the value
returned by partition? (Hint: the partition()
function might be used in Quicksort.)

Develop a loop invariant for the outer while loop that
can be used to prove that partition() does what you say it
does. Argue that the loop invariant holds initially and for each
iteration of the outer while loop.

What does the loop invariant say when the outer while loop
terminates (using the return statement in the else
part of the if statement)?
Note: you MUST show your work and explain your answer for these questions.
Answers that consist of a single number will not receive very much credit.
 Burritos.
At Mr. Cheap O'Tillay's Restaurant, customers can order a
burrito with a choice of 2 types of tortillas (flour, whole wheat),
3 types of beans (refried, black, red), 4 types of cheese (cheddar,
nacho, Monterrey Jack, Colby) and 3 types of meat (beef, chicken,
pork). How many different burritos can the customers order if
each burrito must include 1 tortilla, 2 or fewer choices of
beans, 2 or fewer choices of cheese, and 1 or fewer choice of
meat?
 Colored Balls.
A bin has 29 balls that are either red, green or orange.
 Argue that the bin must contain 10 red balls, 10 green
balls or 10 orange balls.
 Argue that the bin must contain 8 red balls,
7 green balls or 15 orange balls.
 Dog Sled Team.
We wish to form a sled dog team with 7 dogs chosen from
a group of 14 Siberian Huskies and 9 Alaskan Malamutes.
How many different teams can be formed if we must
have more Siberian Huskies than Alaskan Malamutes?
Note: in this question the dogs are considered
individuals and are distinguishable.
Note: you MUST show your work and explain your answer for these questions.
Answers that consist of a single number will not receive very much credit.
 Car Park.
There are 4 red cars and 7 blue cars parked in 11 consecutive spots
of a parking lot. Each car is distinguishable by its license plate.

How many ways can the cars be parked in these 11 spots
so the 4 red cars are adjacent to each other?

How many ways can the cars be parked in these 11 spots so
none of the 4 red cars is adjacent to another red car?
 Marble Placement.
In a board game, you have 19 indistinguishable marbles that you
can place in 5 distinguishable locations. You must place
at least 2 marbles at each location, but are otherwise allowed to
place as many or as few marbles at each location. How many
different ways can you make these placements?
 Balls & Bins.
You have 13 balls that you throw at 5 bins labeled A, B,
C, D and E. Our assumption is that when a ball is thrown at the
bins, there is an equal probability that the ball lands in any
particular bin. Also, the ball will always land in one of the
bins. Each bin is large enough to hold any number of balls.

You throw the 13 balls, one at a time, at the bins. What is
the probability that exactly 3 balls land in bin A? Justify
your answer.

You throw the 13 balls, one at a time, at the bins. What is
the probability that 4 or fewer balls land in bin B? Justify
your answer.
Note: you MUST show your work and explain your answer for these questions.
Answers that consist of a single number will not receive very much credit.
 Two Urns. [Adapted from Epp, 3/e.]
You have two urns. One urn holds 5 red balls and
13 yellow balls. The second urn holds 9 red balls and
11 yellow balls. You pick one ball using this procedure:
randomly pick one of the two urns with equal probability, then
pick a ball from the chosen urn so that each ball is chosen
with equal probability.
 What is the probability that the chosen ball
is red?
 If the chosen ball is red, what is the
probability that the chosen ball came from the first urn?
 Animal Crackers.
A jar of animal crackers contains 13 crackers depicting
reptiles and 29 crackers depicting mammals. Two crackers
are chosen from the jar, one after the other without replacement.

What is the probability that both crackers are mammals?

What is the conditional probability that the second cracker is
a mammal given that the first one is a reptile?

What is the probability that the second cracker is
a mammal?

What is the probability that at least one of the two crackers
is a mammal?
 Threebit Strings. [Adapted from Rosen 5/e.]
We generate a 3bit string w randomly so that each bit of
w has an equal chance of being 0 or 1.
Let E be the event that w has an odd number of
1's and let F be the event that the last bit of
w is a 1. Are E and F independent?
Show your calculations and explain your answer.
Note: you MUST show your work and explain your answer for these questions.
Answers that consist of a single number will not receive very much credit.
 4 and 8sided Die.
You have a fair 4sided die and a fair 8sided die.
(Here a die is fair if when the die is rolled, there
is an equal probability for any particular side to be on top.)
The sides of the 4sided die are labeled with 2, 7, 7 and 9.
The sides of the 8sided die are labeled with 1, 1, 2, 3, 3, 4, 5
and 5.
 What is the expected value of the number on top
when you roll the 4sided die?
 What is the expected value of the number on top
when you roll the 8sided die?
 What is the expected value of the sum
of the numbers on top when you roll both dice?
 Rolling for 10+.
You have two normal 6sided dice (with sides labeled 1, 2, 3,
4, 5 and 6). Assume that the dice are fair. Suppose that you
keep rolling the two dice until the sum of the numbers on the
dice is greater than or equal to 10. What is the expected number
times that you will roll the dice?
 Two Aces.
You select 6 cards from a standard deck of playing
cards. Of the 6 cards, 2 are Aces and 4 are not. You shuffle
the cards well (so each permutation of the 6 cards is equally
likely). Then, you deal out the selected cards (without replacement)
face up until two Aces are shown. What is the expected number
of cards dealt?
Hint: To calculate the probability that exactly
4 cards are dealt until two Aces are shown, consider the
fact that the first Ace could be the first card, the
second card or the third card. The fourth card is, of
course, the second Ace. Then no more cards are dealt.
 Relation Properties.
For each of the following relations, state whether
relation is reflexive, symmetric, antisymmetric and transitive.
Briefly justify your response in each case.
Note: a relation R on A
is antisymmetric if for all (a, b) ∈ A
× A, (a, b) ∈ R and
(b, a) ∈ R implies that a =
b.

R_{1} = { (a, b) 
a and b are integers and a = 3b }

R_{2} = { (a, b) 
a and b are integers and a − b
is even }

R_{3} = { (a, b) 
a and b are integers and a b = 0 }
 Two Equivalence Relations.
Suppose that R_{1} and R_{2}
are both equivalence relations on A.
 Must R_{1} ∩ R_{2}
be an equivalence relation? Give a proof or a counterexample.
 Must R_{1} ∪ R_{2}
be an equivalence relation? Give a proof or a counterexample.
 Partial Orders.
Consider the set A = { 2, 3, 6, 8, 24, 30, 32 } and the relation
R on A defined by:
R = { (a, b)  a divides b }.
Since R is reflexive, antisymmetric and transitive, it is a partial order.
 Draw a Hasse diagram for R.
 List two incomparable elements in R
 What are the minimal and maximal elements of this partial order?
 Does R have a greatest element? Why or why not?
Last Modified:
5 May 2009 11:48:38 EDT
by
Richard Chang
to Spring 2009 CMSC 203 Homepage