Fall 2003 Examination 2 in CMSC 203: Mathematical Induction, Recursion, and Algorithms, Exams of Discrete Structures and Graph Theory

The fall 2003 examination 2 for the cmsc 203 course, focusing on mathematical induction, recursion, and algorithms. It includes multiple-choice questions, recursion problems, sequence calculations, big-oh analysis, and euclidean algorithm applications.

Typology: Exams

2012/2013

Uploaded on 04/27/2013

ashakiran
ashakiran ๐Ÿ‡ฎ๐Ÿ‡ณ

4.5

(27)

261 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Fall 2003 Examination 2 CMSC 203
1. Circle T if the corresponding statement is True or F if it is False.
TFStarting from 1, the sum of the first 200 integers is 10,100.
TFThe First (Weak) and Second (Strong) Principles of Mathematical Induction can be
used interchangably.
TFAlgorithms of constant order take the same amount of time to execute, regardless of
the inputs.
TFAny two distinct prime numbers have 1 for a Greatest Common Divisor.
TFFunctions that are O(x1000) grow faster than functions that are O(2x).
TFFor all integers a, b, and c, if a divides (b + c), then a divides b and a divides c.
TFThe product of an Irrational and an Irrational is Irrational.
TFFor positive integers, n, GCD(n, 0) = n.
2. Given the recursion defined as f(n) = f(n
โˆ’
1) + f(n
โˆ’
2), find the next 4 terms when:
(a) f(0) = 2 and f(1) = 4 (b) f(0) =
โˆ’
10 and f(1) = 5
3. Let {an} and {bn} be the sequences defined, for n > 0, by: an = 3n , bn = 2n.
Find c0, c1, c2, and c3 when cn = an
โˆ’
bn.
4. (a) Find the Big-Oh of the algorithm with complexity:
(n5 + 1)(n + n2) + (5n2 + 3n + 2)(n5).
(b) The following algorithms evaluate the polynomial anxn + an โˆ’ 1xn โˆ’ 1 +...+ a1x + a0 at x = c.
Step through each to evaluate x3 + x2 + x + 1 at x = 2.
procedure poly1 (c, a0, a1, ..., an : real numbers)
power := 1
y := a0
for i = 1 to n
begin
power := power * c
y := y + ai * power
end
output y
procedure poly2 (c, a0, a1, ..., an : real numbers)
y := an
for i = 1 to n
begin
y := y*c + an โˆ’ i
end
output y
5. Use the Euclidean Algorithm to find GCD(1000,256).
Docsity.com
pf2

Partial preview of the text

Download Fall 2003 Examination 2 in CMSC 203: Mathematical Induction, Recursion, and Algorithms and more Exams Discrete Structures and Graph Theory in PDF only on Docsity!

Fall 2003 Examination 2 CMSC 203

1. Circle T if the corresponding statement is True or F if it is False. T F Starting from 1, the sum of the first 200 integers is 10,100. T F The First (Weak) and Second (Strong) Principles of Mathematical Induction can be used interchangably. T F Algorithms of constant order take the same amount of time to execute, regardless of the inputs. T F Any two distinct prime numbers have 1 for a Greatest Common Divisor.

T F Functions that are O( x^1000 ) grow faster than functions that are O(2 x ). T F For all integers a, b, and c, if a divides ( b + c ), then a divides b and a divides c. T F The product of an Irrational and an Irrational is Irrational. T F For positive integers, n , GCD( n , 0) = n.

2. Given the recursion defined as f( n ) = f( n โˆ’ 1) + f( n โˆ’ 2), find the next 4 terms when:

(a) f(0) = 2 and f(1) = 4 (b) f(0) = โˆ’10 and f(1) = 5

3. Let { an } and { bn } be the sequences defined, for n > 0, by: an = 3 n , bn = 2 n.

Find c 0 , c 1 , c 2 , and c 3 when c n = an โˆ’ b n.

4. (a) Find the Big-Oh of the algorithm with complexity:

( n^5 + 1)( n + n^2 ) + (5 n^2 + 3 n + 2)( n^5 ).

(b) The following algorithms evaluate the polynomial anx n^ + an โˆ’ 1 xn^ โˆ’^1 +...+ a 1 x + a 0 at x = c.

Step through each to evaluate x^3 + x^2 + x + 1 at x = 2.

procedure poly1 ( c , a 0 , a 1 , ..., an : real numbers)

power := 1 y := a 0

for i = 1 to n begin power := power * c y := y + ai * power

end output y

procedure poly2 ( c , a 0 , a 1 , ..., an : real numbers)

y := an

for i = 1 to n begin y := y * c + an โˆ’ i

end output y

5. Use the Euclidean Algorithm to find GCD(1000,256).

Docsity.com

6. Prove one of the two Theorems below using Mathematical Induction.

Theorem 1: For all integers n > 0,

Theorem 2: If an = an -1 + an -2 + an -3 and a 0 = 3, a 1 = 6, and a 2 = 9, then an < 3 n^ for all n > 2.

7. Given the sequence { ai } where an +1 = (5 an + 3) mod 7, calculate the next ten terms

when a 0 = 11. What do you observe about the sequence?

8. Prove one of the two Theorems.

Theorem 1: If every integer is divisable by a prime, then the set of primes is infinite.

Theorem 2: If n is prime, then the square root of n is irrational.

(Hint: Use the Lemma that any prime that divides p^2 also divides p )

i i ( + 1 ) ( i + 2 ) i = 1

n

n n ( + 1 ) ( n + 2 ) ( n + 3 ) 4

Docsity.com