Fall 2002 CS Exam 1: Logic and Functions, Exams of Discrete Structures and Graph Theory

Fall 2002 exam questions for cmsc203 course focusing on logic and functions, including true/false questions, compound statement truth table, universal conditional statement forms, bijection, sequence, algorithm complexity, and set operations.

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
CMSC203 - Fall 2002 - Examination 1
1. Circle T for True or F for False as they apply to the following statements:
T F A conditional statement and its contrapositive are logically equivalent.
T F If a, b, and c are integers and a divides (b + c), then a divides b.
T F If F:X Y and G:Y X are functions, then F(G(y)) = G(F(x)).
T F Onto functions map bigger sets to smaller or equal-sized sets.
T F Disjoint sets have empty intersections.
T F The Integers and the Rationals have the same cardinality.
T F The Binary Search algorithm is of order O(2n).
T F If A and B are sets, then |A B| = |A| + |B| - |A B|.
T F If p and q are statements, then p q ¬p q.
T F If P(x,y) is a predicate, then the negation of the quantified statement
For all x, there is a y such that P(x,y) is the quantified statement
For all y, there is an x such that P(x,y).
2. Find the truth table for the compound statement: p ¬[q (r ¬p)]
3. Find the related forms for the Universal Conditional Statement:
Every even integer greater than two is composite.
CONVERSE: ____ INVERSE: ____ CONTRAPOSITIVE: ____ NEGATION: ____.
4. Find set X so that the function, f:Z X, given by f(n) = 2n is a bijection (one-to-one and onto).
5. (a) Find the first 4 terms of the sequence an = .
(b) For constant, c, and functions f and g, show that: .
6. (a) Rank from 1 (least complex) to 10 (most complex) the complexity of algorithms
with the following orders:
Order n2nlognn!2
n1nn
nlogn10nn10
Rank
(b) Find the Big-Oh of the algorithm with complexity: (n2 + 1)(n + n3) + (2n + 1)(n4).
7. (a) List the elements of a Bijective function from {1, 2, 3, 4, 5} to {2, -4, 8, -16, 32}
(b) Find the Inverse of the function you described in (a).
(c) Use Directed Graphs to verify that the composition of your function with its inverse is the
Identity function. Only test for the composition in one direction.
8. For the sets A = {1, 3, 4}, B = {2, 3, 4}, and C = {1, 2, 3}:
(a) verify that A (B C) = B (A C) (b) find A × B
9. Use the Laws of Logic to verify: (p q) ¬(p ¬r) p (q r).
i
i1=
n
cf i() gi()+
i1=
n
cfi()
i1=
n
gi()
i1=
n
+=
Docsity.com

Partial preview of the text

Download Fall 2002 CS Exam 1: Logic and Functions and more Exams Discrete Structures and Graph Theory in PDF only on Docsity!

CMSC203 - Fall 2002 - Examination 1

1. Circle T for True or F for False as they apply to the following statements: T F A conditional statement and its contrapositive are logically equivalent. T F If a , b , and c are integers and a divides ( b + c ), then a divides b. T F If F :X → Y and G :Y → X are functions, then F(G(y)) = G(F(x)). T F Onto functions map bigger sets to smaller or equal-sized sets. T F Disjoint sets have empty intersections. T F The Integers and the Rationals have the same cardinality.

T F The Binary Search algorithm is of order O (2 n ). T F If A and B are sets, then |A ∪ B| = |A| + |B| - |A ∩ B|. T F If p and q are statements, then pq ≡ ¬ pq. T F If P(x,y) is a predicate, then the negation of the quantified statement For all x , there is a y such that P(x,y) is the quantified statement For all y , there is an x such that P(x,y).

2. Find the truth table for the compound statement: p → ¬[ q ∨ ( r → ¬ p )] 3. Find the related forms for the Universal Conditional Statement: Every even integer greater than two is composite. CONVERSE: ____ INVERSE: ____ CONTRAPOSITIVE: ____ NEGATION: ____. 4. Find set X so that the function, f : Z → X, given by f(n) = 2 n^ is a bijection (one-to-one and onto). 5. (a) Find the first 4 terms of the sequence an =.

(b) For constant, c , and functions f and g , show that:.

6. (a) Rank from 1 (least complex) to 10 (most complex) the complexity of algorithms with the following orders:

Order n^2 n log n n! 2 n^ 1 n nn^ log n 10 n^ n^10

Rank

(b) Find the Big-Oh of the algorithm with complexity: ( n^2 + 1)( n + n^3 ) + (2 n + 1)( n^4 ).

7. (a) List the elements of a Bijective function from {1, 2, 3, 4, 5} to {2, -4, 8, -16, 32} (b) Find the Inverse of the function you described in (a). (c) Use Directed Graphs to verify that the composition of your function with its inverse is the Identity function. Only test for the composition in one direction. 8. For the sets A = {1, 3, 4}, B = {2, 3, 4}, and C = {1, 2, 3}: (a) verify that A ∩ (B − C) = B ∩ (A − C) (b) find A × B 9. Use the Laws of Logic to verify: ( pq ) → ¬( p → ¬ r ) ≡ p ∧ ( qr ).

i i = 1

n

cf i ( ) + g i ( ) i = 1

n

∑ c^ f i ( )

i = 1

n

∑ g i ( )

i = 1

n

Docsity.com