






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
During the study of discrete mathematics, I found this course very informative and applicable.The main points in these lecture slides are:Increasing Order of Growth Rate, Two Basic Rules, Relation Between Functions, Definition of Big- O, Set of Positive Integers, Overlapping in Uence, Real Numbers, Exponent, Cantor's Diagonalization Method
Typology: Exams
1 / 10
This page cannot be seen from the preview
Don't miss anything!
CS 173: Midterm Exam II Solutions
Spring 2004
Name:
NetID:
Lecture Section:
General Directions
Question Points Out of
1 6
2 6
3 6
4 6
5 6
6 6
7 6
8 6
9 10
10 10
11 10
12 10
13 12
Total 100
Multiple Choice
Problem 1 (6pts)
When sorted in increasing order of growth rate, which one of the following functions would be second?
a)
b)
c)
d)
Solution
(c) is second. The growth rate in these problems can be determined by two basic rules:
&%#) is *,+&-/. "0. 1 .% 0. $.
Applying our rules, we can work the problem as follows:
a)
b)
c)
d)
Problem 2 (6pts)
Which of the following equalities describe(s) the relation between functions @
and
? (Choose all that apply)
a) @
b)
c) @
d)
Problem 4 (6pts)
Given (
(a
, &b is:
a)
c
b)
d%
c)
b
d%
d)
fe$g
Solution
(d) is correct.
f` % a
5 <h
a
i
d%
i
a
`h b
e fg
&b
kj b a
l 4m
e
fe$g
Problem 5 (6pts)
The set n is defined by oqpCn and rts#utpCn , whenever rvpCn and utpCn. Which of the following elements does NOT
belong to n? (Choose all that apply)
a) 7 #w
b)
x
c) w&o
d)
x y w
Solution
(b) does not belong to n.
All the elements of n can constructed using o, which happens to be
x
. Thus, all elements of n must have the form
x% , where
is a positive integer.
a) 7 #w
Ex&G
. Alternatively, we can construct it using ozs0o.
b)
x65Ex b
. The exponent is odd, so it cannot belong to n.
c) w&o
Ex e
. Using our result from (a), we can construct it using ozs(7#w.
d)
x y w
5 Ex
c
. Using our result from (a), we can construct it using 7 #w{s7#w.
Problem 6 (6pts)
The function F
is big- of which of the following functions? (Choose all that apply)
a) ^
b)
c)
d)
Solution
(b), (c), (d) are all correct.
x
x | ~
. Furthermore, if @
| ~ , then it is also
of any function that grows faster than | ~. This means that is also
and
Problem 7 (6pts)
Which of the following sets is/are countable?
a) The set of integers.
b) The set of real numbers.
c) The set of rationals.
d) The set of natural numbers.
Solution
(a), (c), (d) are all countable.
a) The set of integers. We can count these by mapping the non-negative integers to the even natural numbers, and
the negative integers to the odd numbers.
b) The set of real numbers. The set of reals is uncountable by Cantor’s Diagonalization method.
c) The set of rationals. The set of rationals is countable by the chart constructed on page 235, shown below without
guiding arrows.
Short Answer Problems
Problem 9 (10pts)
Use the pigeonhole principle to argue that any set of 10 nonempty strings over X1/Z#1/J0 have two different strings
whose starting letters agree and ending letters agree.
Solution
Nonempty strings over X1/Z#1/J# can be any size greater than 0, can use any combination of letters, and can have any
order. Fortunately, we are only concerned with the starting and ending letters of the strings. There are 9 possible
combinations of starting and ending letters for strings. We use * to denote the interior of the string. We also note that
if a string is of length 1, then it’s single letter is both the starting and ending letter.
Since there are only 9 possible combinations, and 10 strings, by the pigeonhole principle, at least two of the strings
must have the same starting and ending letter.
Problem 10 (10pts)
Let [1/%1[0[ be a sequence of countable sets. Show that
is countable.
Solution
We can show that ,!^
(^) is countable by constructing a bijection from the set to the natural numbers. We can do this
by enumerating the members of the sets as follows:
X$01/Xd%1/X 1 fX G 1 0 %
#X"%)[1/XM%f%1/X"% 1 /XM% G 1 0
Then we can construct a bijection like the one used to count the rationals on page 235 of the textbook:
X$ Xd% X (^) X (^) G
X"%2 X"%f% X"% (^) X"% (^) G
X G XG% XGf X G$G
d) Yes. Suppose we have an arbitrary element X¨pW. Then YX"
X¥ is also an element of . But then we have
X, so every element in has an element that maps to it.
e) No. As a counterexample, X"Z)Z/X and XMZ)Z)Z will both map to Z2Z2X.
f) Yes. is onto, and so is. This means that will map to all elements of , and will map to all elements of
. Suppose we have an element Jp©. Then there is an element ª«p¦ that will map to it, since is onto.
Furthermore, there is an element ¬6pW that will map to ª under , since is onto. Therefore 'F$ is onto.
Long Problem
Problem 13 (12pts)
We will use mathematical induction to show that a
x &