CMSC 203 Fall 2010 Exam: Algorithms and Number Theory, Exams of Discrete Structures and Graph Theory

The fall 2010 exam for cmsc 203, a university-level course on algorithms and number theory. The exam includes multiple-choice questions covering topics such as the euclidean algorithm, mathematical induction, and binary search. Students are asked to identify true or false statements, find the greatest common divisor (gcd) of two numbers, apply the binary search algorithm, and find the next terms of a sequence. The document also includes procedures for the euclidean algorithm and inductive definitions.

Typology: Exams

2012/2013

Uploaded on 04/27/2013

ashakiran
ashakiran ๐Ÿ‡ฎ๐Ÿ‡ณ

4.5

(27)

261 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Exam 2 CMSC 203 Fall 2010
1. Circle T if the corresponding statement is True or F if it is False.
T F GCD(0, 1) = 1.
T F Every integer can be factored as the product of primes.
T F If a โ‰ก b mod 5, then a and b are both multiples of 5.
T F If a and b are positive integers with a < b, then 0 < (b MOD a) < a.
T F 1 + 2 + 2
2
+ 2
3
+ 2
4
+ ... + 2
9999
= 2
10000
โˆ’ 1.
T F Algorithms with O(n) are less efficient than those with O(log n).
T F The Principle of Mathematical Induction is useful for discovering new
Mathematical theorems.
T F GCD(10,000,000, 9,999,998) = 2.
2. Find GCD( 2
3
5
2
7
4
11
1
17
5
23
1
29
1
31
2
, 2
4
5
1
11
2
13
4
17
4
19
3
23
1
31
3
)
3. List out the search intervals of the Binary Search algorithm to find 111 in the list:
3 4 6 9 13 18 21 34 55 72 83 85 92 104 111 133
4. List the next 5 terms of the sequence {a
n
}, a
n
= a
n โˆ’ 1
+ 2a
n โˆ’ 2
with the initial
conditions, a
0
= 0 and a
1
= 1.
5. Trace the Euclidean Algorithm below to find GCD(52, 6).
PROCEDURE GCD(A,B: integers) Pass
TEMP = (A MOD B) A
WHILE (TEMP > 0)
A = B B
B = TEMP
TEMP = (A MOD B) TEMP
ENDWHILE
OUTPUT (B) (TEMP > 0)?
6. What set, S, is defined by the Inductive Definition: 2 โˆˆ S, and, if n โˆˆ S, then (n + 5) โˆˆ S.
7. Show n
12
is the Big-Oh of the algorithm with complexity: (2n
2
+ 5n
2
log n)(n
6
+ 2n
4
)(3n
2
+ n
3
).
8. Prove ONE of the TWO Theorems below using Mathematical Induction.
Theorem 1: For all Natural numbers n, .
Theorem 2: If a
0
= 5, a
1
= 10, and a
2
= 15, then a
n
= a
nโˆ’1
+ 2a
nโˆ’2
+ 3a
nโˆ’3
is divisible by 5,
for all n > 3.
9. Prove ONE of the TWO Theorems below:
Theorem 1: For all Integers, n, if n
2
is even, then n
2
is divisible by 4.
Theorem 2: If a and b are Integers with a < b, then there is a Rational, q, such that a < q < b.
10. Prove ONE of the TWO Theorems below by Contradiction or Contraposition.
Theorem 1: The square root of an Irrational Number is Irrational.
Theorem 2: For all Integers, n > 2, if n is prime, then n is odd.
i
2
i0=
n
โˆ‘
n n 1+( ) 2n1+( )
6
-----------------------------------------
=
Docsity.com

Partial preview of the text

Download CMSC 203 Fall 2010 Exam: Algorithms and Number Theory and more Exams Discrete Structures and Graph Theory in PDF only on Docsity!

Exam 2 CMSC 203 Fall 2010

  1. Circle T if the corresponding statement is True or F if it is False. T F GCD(0, 1) = 1. T F Every integer can be factored as the product of primes. T F If a โ‰ก b mod 5, then a and b are both multiples of 5. T F If a and b are positive integers with a < b , then 0 < ( b MOD a ) < a.

T F 1 + 2 + 2^2 + 2^3 + 2^4 + ... + 2^9999 = 2^10000 โˆ’ 1. T F Algorithms with O( n ) are less efficient than those with O(log n ). T F The Principle of Mathematical Induction is useful for discovering new Mathematical theorems. T F GCD(10,000,000, 9,999,998) = 2.

  1. Find GCD( 2^35274111175231291312 , 2^451112134174193231313 )
  2. List out the search intervals of the Binary Search algorithm to find 111 in the list: 3 4 6 9 13 18 21 34 55 72 83 85 92 104 111 133
  3. List the next 5 terms of the sequence { an }, an = an โˆ’ 1 + 2 an โˆ’ 2 with the initial

conditions, a 0 = 0 and a 1 = 1.

  1. Trace the Euclidean Algorithm below to find GCD(52, 6). PROCEDURE GCD(A,B: integers) Pass TEMP = (A MOD B) A WHILE (TEMP > 0) A = B B B = TEMP TEMP = (A MOD B) TEMP ENDWHILE OUTPUT (B) (TEMP > 0)?
  2. What set, S, is defined by the Inductive Definition: 2 โˆˆ S, and, if n โˆˆ S, then ( n + 5) โˆˆ S.
  3. Show n^12 is the Big-Oh of the algorithm with complexity: (2 n^2 + 5 n^2 log n )( n^6 + 2 n^4 )(3 n^2 + n^3 ).
  4. Prove ONE of the TWO Theorems below using Mathematical Induction.

Theorem 1: For all Natural numbers n ,.

Theorem 2: If a 0 = 5, a 1 = 10, and a 2 = 15, then an = an โˆ’ 1 + 2 an โˆ’ 2 + 3 an โˆ’ 3 is divisible by 5,

for all n > 3.

  1. Prove ONE of the TWO Theorems below:

Theorem 1: For all Integers, n, if n^2 is even, then n^2 is divisible by 4. Theorem 2: If a and b are Integers with a < b , then there is a Rational, q , such that a < q < b.

  1. Prove ONE of the TWO Theorems below by Contradiction or Contraposition. Theorem 1: The square root of an Irrational Number is Irrational. Theorem 2: For all Integers, n > 2, if n is prime, then n is odd.

i^2 i = 0

n

n n ( + 1 ) ( 2 n + 1 ) 6 = -----------------------------------------

Docsity.com