{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

C__Documents_and_Settings_raghu_Desktop_CS_2800_Midterm_sample

C__Documents_and_Settings_raghu_Desktop_CS_2800_Midterm_sample

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 280 – MIDTERM FALL 2007 Name: Netid: Instructions: There are four questions in all. They are of varying difficulty, so be sure to read them all before starting. For the induction problems, CLEARLY state your base case, inductive hypothesis and how it is used in your inductive step. For the workout-style problems, please be sure to show all your work to be eligible for partial credit. You are allowed one two-sided sheet of notes. Problem 1 2 3 4 Total (/40) Score Grader 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
1. Short Answers [14 points] (a) If f ( x ) is O ( g ( x )) and g ( x ) is O ( f ( x )), then f ( x ) is Θ( x ). True or false? [Ans] True. (b) [2pts] We define the function f : Z + Z + as f ( n ) = ( n + 0 . 5) + ( n + 0 . 5) . Is f one-to-one? Is it onto? [Ans] The function is one-to-one (since f ( n ) = 2 n + 1), but it is not onto (the even integers do not have a pre-image). (c) [2pts] The GCD of two numbers is 3. Their LCM is 180. One of the numbers is 45. What is the other? [Ans] 12. (d) [2pts] What is 7 452 mod 11? [Ans] 5. 2
Background image of page 2
(e) [2pts] In the questions below, assume that A = { a, b, c } and B = { b, { c }} .
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}