
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This exam paper is very easy to understand and very helpful to built a concept about the foundation of computers and discrete structures.The key points in these exam are:Weak and Strong Principles, Mathematical Induction, Alternating Sequence, Iterative Algorithms, Recursive Representations, Euclidean Algorithm, Recursive Definition, Big-Oh of Algorithm, Binary Search Algorithm
Typology: Exams
1 / 1
This page cannot be seen from the preview
Don't miss anything!

Exam 2 - Discrete Structures - Spring 2008
1. Circle T if the corresponding statement is True or F if it is False. T F The sequence {1, โ1, 1, โ1, 1, โ1 ...} is an example of an Alternating sequence. T F The Weak and Strong Principles of Mathematical Induction are logically equivalent. T F In general, iterative algorithms use memory more efficiently than their equivalent recursive representations.
T F 1 + 10 + 100 + 1000 + ... + 10 n^ = 10( n^ + 1)^ โ 1. T F 2 + 4 + 6 + 8 + 10 + ... + 2,000 = 1,001,000.
T F Algorithms whose order is O( n^2 ) are less efficient than those of order O(2 n ). T F If the set A contains the element x , then half the subsets of A contain x. T F LCM( p,q )GCD( p,q ) = pq.
2. Let { an } and { bn } be the sequences defined, for n > 0, by:
an = ( n โ 1), and bn = ( n + 1). Find c 1 , c 2 , c 3 , and c 4 when c (^) n = ( an )( bn ).
3. Write out the Euclidean Algorithm and trace its steps to calculate GCD(21,4). 4. (a) Give a Recursive Definition for the odd integers.
(b) Find the Big-Oh of the algorithm with complexity: ( n^2 + 1)(4 n^3 + 5) + [2 n^4 + n (log n )](3 n^2 ).
5. (a) Given a = 2^2 335577119131117131915231729193121. and b = 2^1325478111613321764191282325629512 311024 , GCD( a,b ) = ___________________ LCM( a,b ) = __________________________.
(b) List out the search intervals in applying the Binary Search algorithm to find 7 in the list: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 (Hint: Include the mid/test point with the lower interval.)
6. Prove one of the two Theorems below using Mathematical Induction.
Theorem 1: For all integers n > 0,.
Theorem 2: If a 0 = 0, a 1 = 10, and a 2 = 20, then an = an โ 1 + an โ 2 + a (^) n โ 3 is divisible by 10,
for all n > 3.
7. Prove one of the two Theorems below: Theorem 1: If a , b , p , and r are Integers with a = bq + r , then GCD( a,b ) = GCD( b,r ). Theorem 2: The product of odd integers is odd. 8. Prove one of the two Theorems below by Contradiction or Contraposition.
Theorem 1: is irrational. Theorem 2: The Prime numbers form an infinite set.
i
i = 0
n
n + 1