Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CS 173 Discrete Math Final Exam - UIUC, Spring 2004, Exams of Discrete Mathematics

The final exam for the discrete mathematics course (cs 173) offered by the department of computer science at the university of illinois at urbana-champaign during the spring 2004 semester. The exam consists of multiple choice, short answer, and long problem questions covering various topics in discrete mathematics such as logic, sets, functions, relations, graphs, and polynomial algebra.

Typology: Exams

2012/2013

Uploaded on 04/27/2013

atmaja
atmaja 🇮🇳

4.2

(45)

182 documents

1 / 16

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
University of Illinois at Urbana-Champaign
Department of Computer Science
Final Exam
CS 173 Discrete Mathematics
Spring, 2004
Friday, May 7, 2004
Print your name neatly in the space provided below, and sign in the area provided. Do not place your social security
number anywhere on this exam.
Name:
Netid:
Lecture Section:
Signature:
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download CS 173 Discrete Math Final Exam - UIUC, Spring 2004 and more Exams Discrete Mathematics in PDF only on Docsity!

University of Illinois at Urbana-Champaign

Department of Computer Science

Final Exam

CS 173 Discrete Mathematics

Spring, 2004

Friday, May 7, 2004

Print your name neatly in the space provided below, and sign in the area provided. Do not place your social security number anywhere on this exam.

Name:

Netid:

Lecture Section:

Signature:

This is a closed book and closed notes exam. Try to do ALL problems in this booklet. Read each question very carefully. If you think that there is an ambiguous statement, make an explicit assumption, and keep on solving using your assumption. If you run out of time, at least try to explain what you are trying to do.

You should have 14 pages. Page numbered 14 is draft paper. You may remove it but you have to turn in the draft paper at the end. You can also use the back sides of the pages as draft area of area for the solution, if needed.

Question Points Score Grader

1 6

2 6 3 6 4 6

5 6 6 6 7 6

8 6 9 6 10 6

11 10 12 10 13 10

14 10 15 10 16 10

17 15 18 15

Total 150

You must return all pages of this exam.

Problem 4

Which of the following functions has the slowest order of growth?

a) 

b)  

c) 

d)    

Problem 5

What is the running time of the following algorithm? (Choose all that apply.)

for i = 1 to n j := n; while j >= 1 j := j / 2;

a) 

  

b) 

  

c) 

  

d) 

  

Problem 6

Given that  ^  ^   !^ , which of the following recursive definitions could have generated these terms? Choose all that apply.

a) #" ^  ^ , and   $ "% $ when 

 .

b) #" ^  &!^ , and   $ "%' (^) $ when 

 .

c) #" ^  (^ ) ^ , and   $ "*% +$ %' (^) +$ ) when 

 !.

d) #" ^  (^ ) ^ , and   $ "*%' (^) $ % +$ ) when 

 !.

Problem 7

Let be a relation on the set  ^ ^ ^ . If ^      , then has which of the following properties? (Choose the best answer. Be very careful!)

a) reflexive

b) reflexive and symmetric

c) reflexive, symmetric and transitive

d) reflexive, symmetric, antisymmetric and transitive

Problem 8

The symmetric closure of a relation drawn from a set with cardinality  will require (Choose all that apply. Think of the matrix representation of the the relation.)

a) at least  elements to be added to the original relation

b) at most ^ $  elements to be added to the original relation

c) as few as zero elements to be added to the original relation

d) at most  elements to be added to the original relation

Problem 9

      +  #  is a poset where ’ ’ means ’divides’. Which of the following statements are true regarding

 ? (Choose all that apply.)

a) 4 and 6 are incomparable

b)

 has a least element

c) 6 and 12 are the maximal elements of



d)

 has a greatest element

Short Answer Problems

Problem 11 (10pts)

Express the negations of each of these statements so that all negation symbols immediately precede predicates.

a) 

 .  

(^) 

b) 

 

   

^ ^ 0^  

c) 

 

 0   )

   1

Problem 12 (10pts)

The fibonacci sequence is defined as:

^ 

^  $ "% $ ,  !.

Use mathematical induction to prove that for ^ ,

Problem 14 (10pts)

Let be a non-empty set. Define a relation on

  , the power set of , as

   

 if and only if 

. Is this relation reflexive, symmetric, antisymmetric, transitive and/or a partial order? Justify your answer.

a

d

b

c e

f

Problem 15 (10pts)

The above directed graph represents a relation .

a) List the edges that need to be added to the above graph to form the directed graph representing the transitive closure of .

b) Let

be the transitive closure of the reflexive closure of . Notice

is a poset. Draw its Hasse diagram.

c) What is/are the minimal element(s) of

?

d) What is/are the maximal element(s)?

e) What is the least element (if any)?

f) What is the greatest element (if any)?

g) What are the upper bounds of the set ^ ^?

h) What are the lower bounds of the set ^ ?

Long Problems

Problem 17 (15pts)

The ternary search algorithm searches for an element

 in a sorted list as follows. At each step it first compares the element at position ! in the list to

 and then possibly compares the element at position ! in the list to



. In every step, it either discovers

 and terminates or reduces the size of the list to one-third its current size.

a) Given a single element

 and a list of  elements that contains

 , where  is a power of !, devise a recursive algorithm for this search strategy to find the position of

 in the list.

b) Analyze the time complexity of your algorithm.

Problem 18 (15pts)

Definition : If  is a function with domain  , then the relation defined by



iff 

    





is an equivalence relation on  , and it is called the kernel relation of .

An interesting consequence of equivalence relations and partitions is that any function  can be factored into a com- position of two functions, one an injection, and one a surjection. For a function    ) , let

 be a partition of  by the kernel relation of . Then define the function  )^

 (^) by    ^ ^ and define  

 ) by 

 ^      .

a) Prove that  is a surjection.

b) Prove that  is an injection.

Draft Paper