Cornell University
Computer Science 211
Second Preliminary Examination
18 April 2006
Solutions
1. True/false [24 pts]
(parts ah)
Each question is worth 3 points.
(a) The worst-case running time of quicksort is worse than that of mergesort.
True
(b) The jo

April 19, 2005
CS211 Prelim 2
Page 1 of 11
1. (15 points) Write a recursive binary search method to nd an object v in a sorted
array a of comparables. The procedure should return true if object v is found in
the array, and false if it is not found. Be sur

CSE541 MIDTERM 2 SOLUTIONS
(as submitted by Kuznetsova Polina)
Question 1
Given a set
S = cfw_(a b) b), (a b), a.
1. Show that S is consistent.
2. Show that a formula A = (a b) is not independent of S.
3. Find an innite number of formulas that are indepen

March 10, 2005
CS211 Prelim 1
1. (15 points) Prove by induction that for all n
n 1
X
0,
n3
i(i + 1) =
Page 1 of 9
n
3
i=0
.
Label clearly the parts of your proof. In the induction step, state the induction
hypothesis and indicate exactly where in your arg

COS 126
General Computer Science
Spring 2009
Exam 1 Solutions
1. Number systems.
(a) 4410 = 4 + 8 + 32.
(b) 2010 . Flipping the bits and adding one yields 0101002 (010011 + 1), which is 2010 (4
+ 16). Thus, 1011002 is 2010 .
(c) FFB316 . The binary repres

CS 70
Spring 2005
Discrete Mathematics for CS
Clancy/Wagner
MT 2 Solns
Problem 1. (8 points)
Consider the function a() dened as follows:
a(0) = 1
a(1) = 2
a(n) = (a(n 1) + 2a(n 2) mod 11
for n 2
(Corrections to the original version of the exam were made i

1. Number representation (10 points). Suppose that you have a 16-bit computer word, using
twos-complement representation for integers. In the blank spaces to the right, write the 4digit hexadecimal representation of each entity described on the left.
A. D

CS 70
Discrete Mathematics for CS
Spring 2005
Clancy/Wagner
MT 1 Soln
Problem 1. [True or false] (12 points)
(a) T RUE or False : The propositions P = Q and Q = P are logically equivalent.
(Converse error.)
(b) True or FALSE: The proposition Q P (P = Q) i

1. First, Double Trouble is clearly in NP; one need only guess a solution and check to see if it
meets the two requirements.
We will reduce Hamiltonian Circuit (HC) to Double Trouble (DT).
The easiest solution is to map a problem in HC into DT by assignin

NAME: _SAMPLE SOLUTIONS_
NETID: _XXXXXXX_
CS2110 Fall 2009 Prelim 1 October 15, 2009 Write your name and Cornell netid . There are 9 questions on 9 numbered pages. Check now that you have all the pages. Write your answers in the boxes provided. Use the ba

April 17, 2007
CS211 Prelim 2
Page 1 of 8
1. (20 points) The expression 8 23 evaluates to 2, since it is understood as 8 (23),
following the convention that multiplication has precedence over subtraction. If
we wish the operators to be evaluated in a dier