Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

EECS 203 Exam 1 Makeup Spring 2015, Exams of Algorithms and Programming

An exam for EECS 203 course taken in Spring 2015. It consists of 9 problems covering topics such as logic and sets, growth of functions and infinite sets, number theory, and proof by induction. The exam has a total of 100 points and students are allowed to use one page of notes. The document also includes instructions, honor code, and space for students to write their name and uniqname.

Typology: Exams

2014/2015

Uploaded on 05/11/2023

zeb
zeb ๐Ÿ‡บ๐Ÿ‡ธ

4.6

(26)

231 documents

1 / 10

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Page 1 of 10
*EXAM 1โ€”makeup*
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.
________________________________________________________________
Problem #
Points
1
/15
2&3
/10
4
/10
5
/15
6
/12
7
/16
8
/10
9
/12
Total
/100
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download EECS 203 Exam 1 Makeup Spring 2015 and more Exams Algorithms and Programming in PDF only on Docsity!

EXAM 1โ€”makeup

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.

________________________________________________________________

Problem # Points

Total /

  1. Logic and sets (15 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) Circle each of the following that is a tautology.

(๐’‚ โ†’ ๐’ƒ) โ†” (ยฌ๐’ƒ โ†’ a)

(๐’‚ โ†’ ๐’ƒ) โ†’ (ยฌ๐’ƒ โ†’ ยฌ๐’‚)

(๐’‚ โˆจ ๐’ƒ) โ†’ ๐’‚

(๐’‚ โˆง ๐’ƒ โˆง ๐’„) โ†’ (๐’‚ โˆจ ๐’„ โˆจ ๐’ƒ)

b) Circle each of the following that is satisfiable.

c) Circle each of the following which are tautologies.

(๐‘จ โŠ‚ (๐‘จ โˆฉ ๐‘ฉ) โ†’ (|๐‘ฉ| = |๐‘จ|))

|๐‘จ โˆช ๐‘ฉ| โ‰ฅ |๐‘จ| + |๐‘ฉ|

((๐‘จ โˆ’ ๐‘ฉ) = {๐“}) = (|๐‘จ| = |๐‘ฉ|)

(๐‘จ โˆ’ ๐‘ฉ = {๐Ÿ}) โ†’ ((๐Ÿ โˆˆ ๐‘จ) โˆจ (๐Ÿ โˆ‰ ๐) )

( ๐‘จ โˆ’ ๐‘ช = ๐‘ฉ โˆ’ ๐‘ช) โ†’ (๐‘จ = ๐‘ฉ)

  1. More Sets (4 points)

(No partial credit will be given on this problem.)

Shade the Venn diagram below to show (๐ต โˆช ๐ด) โˆฉ (๐ถ โˆช ๐ต) โˆฉ (๐ต โˆช ๐ถ)

  1. 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 |B|>|A| 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 A 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 B ๏ƒŒ A 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 A is greater than or equal to the cardinality of the range of f.

  1. 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) log(X)+X is:

๏‘ (X) O(X^2 ) ๏— (X) ๏‘ (log(X)) O(log(X))

b) Consider the following pseudo code:

for (i:=1 to n) x=1; while(x<n) x=x*2;

This algorithm has a run time of

๏‘ (n) ๏‘ (n^2 ) ๏— (log(n)) O(n^3 ) O(n/2+1)

c) X^4 +12X^2 log(X)+X is:

๏‘ (X^4 ) O(X^4 ) ๏— (X^4 ) ๏‘ (X^3 ) ๏— (X^3 )

d) If A and B are both countably infinite sets, then ๐ด โˆ’ ๐ต could be

Countably infinite Uncountably infinite Finite

e) If A and B are both uncountably infinite sets, then ๐ด โˆช ๐ต could be

Countably infinite Uncountably infinite Finite

  1. Proof by induction (12 points)

Use induction to prove Prove that 3 divides n^3 + 2n whenever n is a positive integer.

Theorem:

Proof:

Base case:

Induction step:

  1. Rules of logic (16 points)

Prove the following logical equivalence (in two different ways):

(๐‘ โ†’ (๐‘ž โ†’ ๐‘Ÿ)) โ‰ก ยฌ(๐‘ โˆง ๐‘ž โˆง ยฌ๐‘Ÿ)

(a) Use a truth table [6]

(b) Write a formal proof, justifying each line [10]

  1. Other techniques (12 points, 6 each)

a. Find a bijection from ๏ƒ‚+^ to ๏ƒ‚.

b. Prove that the product of any three consecutive integers is divisible by 6.