Discrete Mathematical Structures - Homework 5 | CS 173, Assignments of Discrete Structures and Graph Theory

Material Type: Assignment; Class: Discrete Structures; Subject: Computer Science; University: University of Illinois - Urbana-Champaign; Term: Spring 2007;

Typology: Assignments

Pre 2010

Uploaded on 03/16/2009

koofers-user-0lf
koofers-user-0lf 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS173 Discrete Mathematical Structures
Spring 2007
Homework #5
Due Sun 02/18/07, 8AM.
1) BIG-O ESTIMATION
a) Show that if f(x) is
O(xlog
2
(x))
, then f(x) is
O(x2)
.
b) Show that for all real numbers a and b with a > 1 and b > 1, if f(x) is
O(logbx)
, then f(x) is
O(logax)
.
c) (bonus) Show that if , where
a0,a1,L an
are real numbers
and
an0
, then
f(x)=Θ(
x
n
)
.
2) GROWTH OF FUNCTIONS
Consider the following functions:
1.
n
2
log
2
(log
2
n)
2.
3.
nlog2n4
4.
n!
| sin(nn) | +1
5.
n
3
+ 2
n
+ 3
6.
2n+
n
100
7.
1
2k
k=1
n
8.
n
0.001
+ log
2
n
a) Find a good big-O estimation of each of the above functions. A formal proof is not need ed, but
you must explain your reasoning.
b) Sort them in decreasing order of growth rate.
pf2

Partial preview of the text

Download Discrete Mathematical Structures - Homework 5 | CS 173 and more Assignments Discrete Structures and Graph Theory in PDF only on Docsity!

CS173 Discrete Mathematical Structures

Spring 200 7

Homework # 5

Due Sun 02/18/0 7 , 8AM.

1) BIG- O ESTIMATION

a) Show that if f ( x ) is O ( x log

2

( x )) , then f ( x ) is O ( x

2

b) Show that for all real numbers a and b with a > 1 and b > 1, if f ( x ) is O (log

b

x ) , then f ( x ) is

O (log

a

x ) .

c) (bonus) Show that if , where a

0

, a

1

,L a

n

are real numbers

and a

n

, then f ( x ) =Θ( x

n

2) GROWTH OF FUNCTIONS

Consider the following functions:

n

2

log

2

(log

2

n )

n

3

  • 2 n

n

2

  • cos n

n log

2

n

4

n!

| sin( n

n

n

3

  • 2 n + 3

n

  • n

100

k k = 1

n

n

  1. 001
  • log

2

n

a) Find a good big- O estimation of each of the above functions. A formal proof is not needed, but

you must explain your reasoning.

b) Sort them in decreasing order of growth rate.

3) TIME COMPLEXITY ANALYSIS

Consider the following algorithm:

a) Give a good time complexity bound (a tight big- O estimate) of this algorithm.

b) What is the time complexity bound if we change j :=

j

to

j := j− 1 ? Is it the same bound as the

one in a)?

c) What is the time complexity bound if we change j := n

2

to j := n

4

? Is it the same bound as the

one in a)?

4) SUMMATION

Let’s derive a formula for k

2

k = 1

n

in this problem. Parts a) through c) illustrate the technique we’ll

use, but on an easier problem: k

k = 1

n

a) Find a formula for ( k

2

−( k − 1 )

2

k= 1

n

( Hint: expand the summation without computing

k

2

−( k − 1 )

2

explicitly. Most of the terms in the expansion will cancel out each other ).

b) Find a formula for ( 2 k − 1 )

k= 1

n

by summing both sides of the identity k

2

−( k − 1 )

2

= 2 k − 1.

c) Using the result of b), find a formula for k

k = 1

n

d) Find an identity for k

3

−( k − 1 )

3

e) Summing both sides of the identity found in d), find a formula for the right side.

f) Using the result of c) and e), find a formula for k

2

k = 1

n

algorithm mystery (positive integer m ; positive integer n )

j := n

2

while (

j > 1 )

i := 1

while ( i < m )

i := 3 i

end while

j :=

j

end while

end algorithm mystery