Fall 2005 CMSC 203 Exam 2: Mathematical Induction and Algorithms, Exams of Discrete Structures and Graph Theory

The fall 2005 exam for cmsc 203, a computer science course focusing on mathematical induction and algorithms. It includes multiple choice questions and problems that require finding common sequences, writing pseudocode, ranking algorithm complexities, and proving theorems using mathematical induction and contradiction.

Typology: Exams

2012/2013

Uploaded on 04/27/2013

ashay
ashay 🇮🇳

4.1

(15)

196 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CMSC 203 - Fall 2005 - Exam 2
1. Circle T if the corresponding statement is True or F if it is False.
TFThe sequence {1, 1, 2, 3, 5, 8, 13, 21,...} satisfies the Fibonacci relation.
TFThe First (Weak) Principle of Mathematical Induction implies the Second (Strong)
Principles of Mathematical Induction.
TFA recursive algorithm is one which never terminates.
TF2 + 4 + 6 + 8 + ... + 200 = 10100.
TFFunctions that are Logarithmic order grow faster than functions that are Linear order.
TFIn costing algorithms, the sum of the orders equals the maximum order.
TFIn costing algorithms, the product of the orders equals the order of the product.
TFIn 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 = n2 2, and bn = n3 + 2. Find c0, c1, c2, and c3 when cn = (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:
Order: 2nlognn! n21nn
nnlognn10 10n
Rank:
(b) Find the Big-Oh of the algorithm with complexity: (n4 + 1)(2n + n2) + (3n2 + 4n4 + 5)(n2).
5. Use the Euclidean Algorithm to find GCD(1100, 35).
6. Prove one of the two Theorems below using Mathematical Induction.
Theorem 1: For all integers n > 0 and a 0,1, .
Theorem 2: If a0 = 0 and a1 = 10, then an = an1 + an2 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 (a2 + b2 ) 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.
ai
i0=
n
an1+ 1
a1
-------------------=
Docsity.com

Partial preview of the text

Download Fall 2005 CMSC 203 Exam 2: Mathematical Induction and Algorithms and more Exams Discrete Structures and Graph Theory in PDF only on Docsity!

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:

Order: 2

n

log n n! n

1 n n

n

n log nn

n

Rank:

(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 1: For all integers n > 0 and a ≠ 0,1,.

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

  • 1 a – 1

Docsity.com