
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

CMSC 203 - Fall 2005 - Exam 2
1. Circle T if the corresponding statement is True or F if it is False. T F The sequence {1, 1, 2, 3, 5, 8, 13, 21,...} satisfies the Fibonacci relation. T F The First (Weak) Principle of Mathematical Induction implies the Second (Strong) Principles of Mathematical Induction. T F A recursive algorithm is one which never terminates. T F 2 + 4 + 6 + 8 + ... + 200 = 10100. T F Functions that are Logarithmic order grow faster than functions that are Linear order. T F In costing algorithms, the sum of the orders equals the maximum order. T F In costing algorithms, the product of the orders equals the order of the product. T F In general, Linear Search algorithms are just as fast Binary Search algorithms. 2. Let { an } and { bn } be the sequences defined, for n > 0, by:
an = n^2 − 2, and bn = n^3 + 2. Find c 0 , c 1 , c 2 , and c 3 when c (^) n = ( an )( bn ).
3. Given positive integer inputs, A and B, write out in pseudocode the algorithm to calculate (A MOD B) and (A DIV B). You may assume B < A. 4. Rank from 1 (least complex) to 10 (most complex) the complexity of algorithms with the following orders:
(b) Find the Big-Oh of the algorithm with complexity: ( n^4 + 1)(2 n + n^2 ) + (3 n^2 + 4 n^4 + 5)( n^2 ).
5. Use the Euclidean Algorithm to find GCD(1100, 35). 6. Prove one of the two Theorems below using Mathematical Induction.
Theorem 2: If a 0 = 0 and a 1 = 10, then an = an − 1 + a (^) n − 2 is divisible by 10.
7. Prove one of the two Theorems below: Theorem 1: If an integer divides two other integers, then it divides their sum.
Theorem 2: If a and b are odd, then ( a^2 + b^2 ) is even.
8. Prove one of the two Theorems below by Contradiction. Theorem 1: If a prime divides an integer, then it cannot divide the integer’s successor. Theorem 2: There does not exist a largest integer.
a i
i = 0
n
a n + 1