






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Name:
NetID:
Section Leader:
General Directions
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
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
c
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
b
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.
d
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
c
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
a
A set M of numbers is defined inductively by
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.
a
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.
e
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.
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.
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?
T (n) = O(mn)
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.
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.