CS/MATH 111 Winter 2011
Final Test
The test is 2 hours and 30 minutes long, starting at 8:10AM and ending at 10:40AM
There are 8 problems on the test. Each problem is worth 10 points.
Write legibly. What cant be read wont be credited.
Before you start
CS/MATH 111 FALL 2013
Final Test
The test is 2 hours and 30 minutes long, starting at 8:00AM and ending at 10:30AM
There are 8 problems on the test. Each problem is worth 10 points.
Write legibly. What cant be read wont be credited.
Calculators are no
CS/MATH 111 SPRING 2011
Final Test
The test is 2 hours and 30 minutes long, starting at 8:10AM and ending at 10:40AM
There are 8 problems on the test. Each problem is worth 10 points.
Write legibly. What cant be read wont be credited.
Before you start
NAME:
SID:
Problem 1: Find a general solution of the recurrence An = 4An1 4An2 + 3n. Show
your work.
CS111-S16 QUIZ 4A, May. 19, 9-9:30AM
Problem 2: (a) Give the definition of Eulers totient function (n).
(b) Give the formula for Eulers totient function.
CS/MATH111 ASSIGNMENT 2 (Revised Oct. 20)
Due date: 8AM, Tuesday, October 25 (Extended to 8AM, Thursday, October 27)
Individual assignment: Problems 1 and 2.
Group assignment: Problems 1,2 and 3.
Problem 1: Prove the following statement: If x, y are two n
NAME:
SID:
Problem 1: Use the -notation to determine the rate of growth of the following functions:
Function
estimate
11n + 2 + 1/n2
(n)
n2 + 0.01n3 + 3
(n3)
23n + 2n2 log n
(n2 log n)
3 log5 n + 2 n
( n)
11n log5 n + 3n2 + 5 log9 n (n2)
3/(2 log n) + 3/
NAME:
SID:
Problem 1: Use the -notation to determine the rate of growth of the following functions:
Function
estimate
n2 + 0.01n3 + 3
(n3)
23n + 2n2 log n
(n2 log n)
11n log5 n + 3n2 + 5 log9 n (n2)
11n + 2 + 1/n2
(n)
3/(2 log n) + 3/n + 5
(1)
n74n + n5n
NAME:
SID:
Problem 1: For each question (a), (b), (c) below, give the formula for the number of lottery
draws and a brief justification (at most 15 words). You do not need to compute the numerical
value.
(a) A draw of MegaLoser lottery consists of 5 diffe
NAME:
SID:
Problem 1: For each question (a), (b), (c) below, give the formula for the number of lottery
draws and a brief justification (at most 15 words). You do not need to compute the numerical
value.
(a) A draw of MegaLoser lottery consists of 5 diffe
CS/MATH111 ASSIGNMENT 1
Due date: 8AM, Tuesday, October 11
Individual assignment: Problems 1 and 2.
Group assignment: Problems 1,2 and 3.
Problem 1: (a) Give an exact formula (as a function of n) for the number of letters Z printed by
Algorithm PrintZs be
CS/MATH111 ASSIGNMENT 1 SOLUTIONS
Solution 1: (a) We first determine the number of letters printed by the first nested for-loop. The j-th
iteration of the outer loop prints 3j + 1 letters, and we need to add these values for j ranging from 1 to n2 .
Pn2
T
CS/MATH 111 FALL 2013
SOLUTIONS
The test is 2 hours and 30 minutes long, starting at 8:00AM and ending at 10:30AM
There are 8 problems on the test. Each problem is worth 10 points.
Write legibly. What cant be read wont be credited.
Calculators are not
CS/MATH 111 Winter 2013
Final Test
The test is 2 hours and 30 minutes long, starting at 7PM and ending at 9:30PM
There are 8 problems on the test. Each problem is worth 10 points.
Write legibly. What cant be read wont be credited.
Before you start:
M
NAME:
SID:
Problem 1: Below you are given ve choices of parameters p, q, e, d of RSA. For each choice
tell whether these parameters are correct1 (write YES/NO). If not, give a brief justication
(at most 10 words).
p
q
e
d
correct? justify if not correct
3
NAME:
SID:
Problem 1: For each pseudo-code below, tell what is the number of words printed if the
input is n. Give a recurrence and then its solution (expressed using the Big-Theta notation.)
Pseudo-code
Recurrence and solution
procedure Hola(n )
if n > 1
NAME:
SID:
Problem 1: Find the general solution of the recurrence Un = 3Un1 + 4Un2 + 3n . Show
your work.
(i) Characteristic equation and its solution:
(ii) General solution of the homogeneous equation:
(iii) Find particular solution of the non-homogeneou
NAME:
SID:
Problem 1: (a) Complete the statement of the Master Theorem by lling in the blanks.
Assume that a
,b>
,c>
and d
,
and that T (n) satises the recurrence T (n) = aT (n/b) + cnd.
Then
if
T (n ) =
if
if
(b) Give asymptotic solutions for the follo
NAME:
SID:
Problem 1: (a) Give a complete statement of the Master Theorem.
(b) Give asymptotic solutions for the following recurrences:
f (n) = 3f (n/3) + n
f (n) = 2f (n/3) + n
f (n) = 4f (n/3) + n
CS111 Quiz 4 Sample
Problem 2: We have a group of people
Problem 1: (a) Complete the statement of the Master Theorem by lling in the blanks.
See the lecture notes .
(b) Give asymptotic solutions for the following recurrences:
f (n) = 4f (n/2) + 3n
f (n) = 4f (n/2) + 5n2
f (n) = 4f (n/2) + n3
f (n) = (n2 )
f (n)
NAME:
SID:
Problem 1: We have two shapes of dominoes, 1 1 squares and 2 1
rectangles. Each domino can be of one of two colors (in the gure below,
dark grey or light grey.) Determine the number of ways to fully cover a
n 1 rectangle with such dominoes. Dom
T oT
6qU VP SQPq P D DX SQ A i 6 8 XVU 6 cUV SQPq 8
Rbs@RE7RbrbitAF8bfq757bP5T8bfU9ht47b9ebp7RbHQ
A i S iU AU4iUV SQPq 8U 8 S A 6
eBcF67R@PhewfibHbW57Rb5Wt4v@6h@Q9bbU
T8WsUT8Rbcfw_~Iz1
S A QPq |cfw_ y
D e 6 tVP g X S 6 tV e 8U4 p i D i S p
wBX@6F87fX
CS/MATH 111 Winter 2013
Final Test
The test is 2 hours and 30 minutes long, starting at 7PM and ending at 9:30PM
There are 8 problems on the test. Each problem is worth 10 points.
Write legibly. What cant be read wont be credited.
Before you start:
M
NAME:
SID:
Problem 1: For each pseudo-code below, tell what is the number of words printed if the
input is n. Give a recurrence and then its solution (expressed using the Big-Theta notation.)
Pseudo-code
Recurrence and solution
procedure Hola(n )
if n > 1