Sei sulla pagina 1di 7

1FT 2125

Geiia Hahn
Introduction l'algorithmique
First MIDTERM
30 September 2013
Duration: 50 minutes
Value: 10% of the the grade, 20% of the grade if part of comprehensives

Instructions:
One side of letter-size paper of notes is allowed, nothing else.
Reply to each question in the space provided. Use the backs of the sheets for notes and rough work.
The space provided is no indication of the length of an answer! It is usually much too
big.
Unless otherwise indicated, no points will be given for answers- correct or not- with no justification
or proof.
Note the difference between justify (a quick short argument) and prove or show (detailed argument).
You canuse the results from class, tutorials, books, provided you quote them correctly and precisely.
You can also use the results given in the appendix.
To answer a question you can also use results from other questions on this exam even if you did
not prove them.
Recall that N is the set of non-negative integers, lR the set of reals, JR~ 0 the set of non-negative
reals, JR> 0 the set of positive reals. Also, lg n = log 2 n and ln n = loge n (where e is the base of the
naturallogarithm). Finally, log n is a "generic" logarithm : the base can be any b E JR> 1.

Total:

1. _ _ _ /15

4. _ _ _ /25

2. _ _ _ /15

5. _ _ _ /15

3. _ _ _ /10

6. _ _ _ /20

_________ +_________

_ _ _ _ /100

N ame:

Student code: _____________

Mark here if you are taking the exam as part of your comprehensives.
1

1. (15 points) Prove true or false:

fE O(g) if, and

only if, O(f)

<;:;;

O(g).

2. ( 15 points) Order the D' s of the folowing fun etions using only C and = ( so no ). For ease of
reading we write simply the values (i.e. nlgn plutot que fi(n) = nlgn).
n log3 n
n lg n
2n lg n
2n log3 n
3lgn
n!g 3n

Answer:

D(

D(

D(

D(

3. (10 points) Justify TWO of the relations found in question 2.

D(

D(

4. (25 points) Prove that each polynomial p( n)

= L::7=o aink-i

with

ai

E IR ;::o is smooth.

5. (15 points) Let MST-gen be the following problem:


GIVEN: G = (V, E) an (undirected) graph weighted by c: E ----7 lR
GOAL: find a minimum spanning tree (or say why such a tree does not exist)
Explain how to adapt, if possible, Kruskal's or Prim's algorithm (or both) to solve this problem. If
it is not possible, say why and suggest another method. Do not forget to justify!

6. (10 + 10 points) Are the functions f(n)


answer.

~~:, n > 1, and g( n)

~ smooth? Prove your

Bonus (15 points) Prove that the relation= defined by

f =gif fE 8(g) is an equivalence relation.

GOOD LUCK
7

Potrebbero piacerti anche