Docsity

Sample Final Exam | Discrete Structures | CS 173, Exams of Discrete Structures and Graph Theory

Toggle sidebar
bg1
CS 173: Sample Final Exam
Fall 2007
Name:
NetID:
Section Leader:
General Directions
1. Make sure your name is on every page.
2. There are 10 pages. Make sure that you answer all 18 questions.
3. Remember to write clearly and legibly. Unreadable answers will receive no credit.
4. This is a closed book exam. On the regular version of the exam, 2 pages of notes will be given to you. Those
notes will be available on the course web page within the next few days.
5. Remember to time yourself.
Question Points Out of
1 5
2 5
3 5
4 5
5 5
6 5
7 5
8 5
9 5
10 5
11 5
12 5
13 15
14 15
15 15
16 15
17 15
18 15
Total 150
Page 1 of 10
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Sample Final Exam | Discrete Structures | CS 173 and more Exams Discrete Structures and Graph Theory in PDF only on Docsity!

CS 173: Sample Final Exam

Fall 2007

Name:

NetID:

Section Leader:

General Directions

  1. Make sure your name is on every page.
  2. There are 10 pages. Make sure that you answer all 18 questions.
  3. Remember to write clearly and legibly. Unreadable answers will receive no credit.
  4. This is a closed book exam. On the regular version of the exam, 2 pages of notes will be given to you. Those notes will be available on the course web page within the next few days.
  5. Remember to time yourself.

Question Points Out of

1 5 2 5 3 5 4 5 5 5 6 5 7 5 8 5 9 5 10 5 11 5 12 5 13 15 14 15 15 15 16 15 17 15 18 15

Total 150

Multiple Choice

Problem 1 (5pts)

Which one of the following propositions is NOT a tautology?

a) ¬p → (p → q)

b) ((p ∨ q) ∧ ¬p) → q

c) [(p ∨ q) ∧ (¬p ∨ r)] → (q ∧ r)

d) [(p ∨ q) ∧ (p → r) ∧ (q → r)] → r

Solution

c

Problem 2 (5pts)

If A and B are two sets and |A| = 17, |B| = 12, and |A ∩ B| = 5, then which of the following is true?

a) |A ∪ B| = 29

b) |A ∪ B| = 24

c) |A ∪ B| = 22

d) |A ∪ B| = 21

Solution

b

Problem 3 (5pts)

Which of the following is NOT true? Note that Z is the set of integers, N is the set of positive integers, Q is the set of rational numbers, and R is the set of real numbers.

a) f : N → N, f (x) = d x 2 e. f (x) is an onto function.

b) f : Z × N → Q, f (x, y) = xy. f (x) is an onto function.

c) f : R × R → R × R, f (x, y) = (y + 1, x + 1) is a bijection.

d) f : R → R, f (x) = dxe. g : R → R, g(x) = bxc. Then f ◦ g = dxe, and it is a function defined on R → R.

Solution

d

Problem 7 (5pts)

Let A and B be two sets. Which of the following implies A = B?

a) A ∪ B = A

b) A − B = ∅

c) (A − B) ∪ (B − A) = ∅

d) (A − B) ∪ (B − A) = A − B

Solution

c

Problem 8 (5pts)

When sorted in decreasing order of growth rate, which one of the following functions would be first?

a) f (x) = 2x + x^2 log x

b) f (x) =

x^4 + 10

c) f (x) = x^2 / log x

d) f (x) = (log x)^10

e) f (x) = x log x^2

Solution

a

Problem 9 (5 pts)

A set M of numbers is defined inductively by

  • 2 and 3 belong to M.
  • If X and Y belong to M , so does the product of X and Y.
  • Nothing else belongs to M.

Which of the following is a subset of M?

a) { 6 , 54 , 180 }

b) { 9 , 36 , 108 }

c) { 16 , 27 , 336 }

d) { 10 , 24 , 324 }

e) None of these is a subset of M.

Solution

a

Problem 10 (5pts)

Which of the following relations on { 1 , 2 , 3 , 4 } is the smallest one containing the relation R = {(1, 2), (1, 4), (3, 3), (4, 1)} that is a POSet?

a) {(1,2),(1,4),(2,1),(2,4),(3,3),(4,1),(4,2)}

b) {(1,1),(1,2),(1,4),(2,1),(2,2),(3,3),(4,1),(4,4)}

c) {(1,1),(1,2),(1,4),(2,1),(2,2),(2,4),(3,3),(4,1),(4,2),(4,4)}

d) {(1,1),(1,2),(2,2),(3,3),(4,1),(4,2),(4,4)}

e) No relation containing R is a POSet.

Solution

e

Problem 11 (5pts)

Which one of the following cannot be properly colored with two colors? (A graph can be “colored” with k colors if there exists a labeling of all the vertices using no more than k colors in such a way that no two adjacent vertices are labeled with the same color. )

a) A cycle of length 17

b) K 12 , 9

c) A cycle of length 32,

d) every tree with at most 32,000 vertices

b) Using rules of inferences, prove that if John is a member of the board, he is in favor of the motion. Please clearly list each step and the name of the inference rule you are using.

Solution

Please use the given sheet to figure out the rules of inference.

Suppose that John is a member of the board, (M(John)). Then by rule 1, he is either from industry or government (I(x) ∨ G(x)). By rule 3, he is not from industry, so he is from government. Next, step 2 gives us: If he is from government, then if he has a law degree then he is in favor of the motion. Good news! Since John is a lawyer we can apply modus ponens again to conclude that he’s in favor.

Problem 14 (15pts)

Consider the following pseudocoded algorithm:

Function F Inputs: n, m, integers A = (a 1 , a 2 ,... , an), and B = (b 1 , b 2 ,... , bm), arrays f : A → B, a function For i = 1 to m { s = 0 For j = 1 to n { If f (aj ) = bi then s = s + 1 } If s 6 = 1 then return F alse } return T rue

a) What does F do? F determines whether or not the function f is one to one.

b) Suppose function f is computed in constant time. What is the complexity of F in terms of m and n?

Solution

T (n) = O(mn)

Problem 15 (15pts)

In a car-crash resilience experiment your goal is to determine the lowest speed at which a car, when crashed into a brick wall, is no longer functional. We call this least speed “the breaking speed.” Only integer speed velocities need to be tested. If you drive a car into the wall with velocity X mph, and the car doesn’t break, you can use it in future tests, but if it breaks, you must trash it. You can safely assume that a car breaks if the impact speed is 65mph or higher.

a) If you have only one car, what is the worst-case number of experiments you have to perform in order to find the breaking speed? (Note that this one car does not have to survive the testing.) Solution: If the break speed is k, then we will have to perform k experiments.

b) Describe an algorithm for determining the breaking speed of a car if you have an unlimited number of cars to use, but you wish to use as few crashes as possible. Solution: This is just binary search.

  1. Describe the equivalence classes of the relation B. Is the set of equivalence classes of B countable? Why or why not? Solution: The set of equivalence classes correspond to the circles of integer radius. There are countably many equivalence classes, since there are countably many integer radii.
  2. Is the set of all elements in each equivalence class countable? Why or why not?

Solution: For any n, the equivalence class corresponding to n consists of all the points on the circle of radius n. That set of points is uncountable.