EXAM 1 : EECS 203 Spring 2015

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

*EXAM 1*

EECS 203
Spring 2015

Name (Print): ________________________________________________

uniqname (Print): ________________________________________________

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]

a) Let w, b and n be propositions where


 w is “I walk to work”
 b is “I work at Burger King”
 n is “I work at night”

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:

b) The circuit on the performs an operation that is equivalent to:

c) Circle each of the following that is a tautology.

d) Circle each of the following that is satisfiable.

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.

f) Circle each of the following which are tautologies.

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.)

Shade the Venn diagram below to show

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

The cardinality of B is greater than or equal to the cardinality of the range of f.

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

The cardinality of B is greater than or equal to the cardinality of the range of f.


Page 4 of 11
4. More functions (7 points)
Each part has one correct answer. (-2 for each wrong or blank answer, minimum 0)

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

a) The mapping f from .


i ii iii iv v

b) The mapping f from .


i ii iii iv v

c) The mapping f from .


i ii iii iv v

d) The mapping f from .


i ii iii iv v

e) The mapping f from .


i ii iii iv v

f) The mapping f from .


i ii iii iv v

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)

b) Consider the following pseudo code:


for (i:=1 to 3)
for (j:= 1 to n)
if(A[i]>A[j])
swap(A[i],A[j]); //Takes (1) time.

This algorithm has a run time of


(n)  (n2)  (log(n)) O(n3) O(n/2+1)

c) X4+12X2log(X)+X is:
(X4) O(X4) (X4) (X3) (X3)

d) If A and B are both countably infinite sets, then AB could be


Countably infinite Uncountably infinite Finite

e) If A and B are both uncountably infinite sets, then AB could be


Countably infinite Uncountably infinite Finite

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).

a. Compute 711 mod 10. Show your work. [3]

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

b. Convert 10010111012 to base 16. [2]

25D

c. How many zeros are at the end of 50!? (50 factorial) Show your work. [3]

50! has 12 zeros.

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.

d. What is gcd(5454,2700)? [2]

gcd(5454,2700) = gcd(54,2700) = gcd(54,0) = 54

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)

Use induction to prove that is equal to

Theorem:

=
Proof:

The base case and induction step below imply this.

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)

(4) | Definition of implication(2)

| Resolution (3, 4)

| Premise

| Modus ponens(5, 6)

| Premise

| Disjunctive syllogism (7, 8)

Page 9 of 11
9. Rules of logic (10 points)
Prove that is a tautology using the rules of logic.

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)

a) Redo problem 8 but prove it using truth tables. [6 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.

b) Find a bijection from [0,1] to (0,1). [6 points]

Let and and we let and .

Our function is defined as follows:

f(0) = , f(1) = , for all , and for all other numbers,


.

Page 11 of 11

You might also like