EXAM 1 : EECS 203 Spring 2015
EXAM 1 : EECS 203 Spring 2015
EXAM 1 : EECS 203 Spring 2015
EECS 203
Spring 2015
Instructions. You have 110 minutes to complete this exam. You may have one page of notes
(8.5x11.5 two-sided) but may not use any other sources of information, including electronic
devices, textbooks, or notes. Leave at least one seat between yourself and other students. Please
write clearly. If we cannot read your writing, it will not be graded.
Honor Code. This course operates under the rules of the College of Engineering Honor Code. Your
signature endorses the pledge below. After you finish your exam, please sign on the line below:
I have neither given nor received aid on this examination, nor have I concealed any
violations of the Honor Code.
________________________________________________________________
Page # Points
2&3 /21
4 /10
5 /7
6 /10
7 /12
8 /10
9 /8
10 /10
11 /12
Total /100
Page 1 of 11
1. Logic and sets (21 points)
In this section, each question will have zero or more correct answers. You are to circle each
correct answer and leave uncircled each incorrect answer.
[3 points each, -1 per incorrect circle/non-circle, minimum 0 points per problem]
The sentence "When I work nights and I work at Burger King, I don't walk to work" could be
written using propositions and logical connectives as:
Page 2 of 11
e) We define the following predicates:
C(x): x is a car
F(x,y): x is faster than y
B(x): x has brakes
Consider the statement “Any car with brakes is faster than at least one car that doesn’t have
brakes.”
Zero or more of the expressions below are accurate translations of this statement. Circle each of the
following that are correct.
g) Circle each of the following which are tautologies (note: is the empty set)
{1, 2}
Page 3 of 11
2. More Sets (4 points)
(No partial credit will be given on this problem.)
3. Functions (6 points)
In this section, each question will have zero or more correct answers. You are to circle each
correct answer and leave uncircled each incorrect answer.
[3 points each, -1 per incorrect circle/non-circle, minimum 0 points per problem]
a) Say that f is a function from where A and B are both subsets of (the natural numbers). If
|A|>|B| then you can conclude that
f is not onto
f is not one-to-one
f is a bijection
f is not a bijection
b) Say that f is a function from where A and B are both subsets of (the natural numbers). If
A B then you can conclude that
f is not onto
f is not one-to-one
f is a bijection
f is not a bijection
For each of the following mappings indicate what type of function they are (if any). Use the
following key:
i. Not a function
ii. A function which is neither onto nor one-to-one
iii. A function which is onto but not one-to-one
iv. A function which is one-to-one but not onto
v. A function which is both onto and one-to-one
Page 5 of 11
5. Growth of functions and infinite sets (10 points)
In this section, each question will have zero or more correct answers. You are to circle each
correct answer and leave uncircled each incorrect answer.
Each problem is worth 2 points and you only get the points if you circle all of the correct
answers and none of the wrong ones.
a) 12X2log(X)+X is:
(X2) O(X2) (X2) (X3) O(X3)
c) X4+12X2log(X)+X is:
(X4) O(X4) (X4) (X3) (X3)
Page 6 of 11
6. Number theory questions (12 points)
Provide your answers below and provide work when requested. Partial credit will not be given for
incorrect answers (though it might be if you get the right answer without clear work where it is
required).
7^1 = 7 mod 10
7^2 = 9 mod 10
7^4 = 1 mod 10
7^8 = 1 mod 10
11 = 8+2+1
7^11 = 7^8 * 7^2 * 7^1 mod 10 = 1*9*7 mod 10 = 63 mod 10 = 3 mod 10
25D
c. How many zeros are at the end of 50!? (50 factorial) Show your work. [3]
50! has 12 5 factors in its prime factorization (8 from 8 multiples of 5 between 1 and 50 that
are not multiples of 5^2, and 4 from 2 multiples of 25 between 1 and 50) and it has at least 25
factors of 2 considering every even number between 1 and 50 contributes 1. So 10^12 divides
50!, but 10^13 does not since 50! doesn’t have enough 5’s in its prime factorization.
e. Which of the positive integers less than 9 are relatively prime to 9? [2]
1, 2, 4, 5, 7, 8 (for 8: 1, 3, 5, 7)
Page 7 of 11
7. Proof by induction (10 points)
Theorem:
=
Proof:
Base case:
The left hand side is 1^2 = 1, and the right hand side is 1(2)(2(1) + 1)/6 = 1*2*3/6 = 1
Induction step:
Suppose that the sum of the first n squares is n(n+1)(2n+1)/6 for some n at least 1. We consider the
sum of the first n+1 squares; this by our inductive hypothesis is n(n+1)(2n+1)/6 + (n+1)^2, which is equal to
n(n+1)(2n+1)/6 + (6(n+1)^2)/6 = (n+1)(n*(2n+1) + 6(n+1))/6 = (n+1)(2n^2 + 7n + 6)/6 = (n+1)(n+2)(2n+3)/6 =
(n+1)((n+1)+1)(2(n+1)+1)/6, which is the formula on the right with (n+1) substituted in. This proves our IH.
Page 8 of 11
8. Deductive proofs (8 points)
Provide a deductive proof to show that from the premises
That we can conclude
(1) | Premise
| Premise
| Definition of implication(1)
| Resolution (3, 4)
| Premise
| Modus ponens(5, 6)
| Premise
Page 9 of 11
9. Rules of logic (10 points)
Prove that is a tautology using the rules of logic.
| Def. of imp.
| Negation of an implication
| Demorgan’s
| Demorgan’s
| Negation laws
| Identity laws
| Negation laws
Page 10 of 11
10. Other techniques (12 points)
p q r
T T T T T T F
T T F F T T T
T F T T T T T
T F F T F T T
F T T T T T F
F T F T F T T
F F T T T F T
F F F T F F T
a)
The only row with all 4 premises true is the highlighted one, and in it p = T.
Page 11 of 11