Docsity

Asymptotic Notation Homework Assignment 1 for CMPS 101, Winter 2009, Assignments of Computer Science

Toggle sidebar
bg1
1
CMPS 101
Winter 2009
Homework Assignment 2
1. (1 Point) p.50: 3.1-1
Let )(nf and )(ng be asymptotically non-negative functions. Using the basic definition of
Θ
-
notation, prove that )))(),((max()()( ngnfngnf Θ=+ .
2. (1 Point) p.50: 3.1-3
Explain why the statement “The running time of algorithm A is at least )(2
nO ” is meaningless.
3. (2 Points) p. 50: 3.1-4
Determine whether the following statements are true or false.
a. (1 Point) )2(2 1nn O=
+
b. (1 Point) )2(22nn O=
4. (6 Points) p.58: 3-2abcdef
Indicate, for each pair of expressions (A, B) in the table below, whether A is O, o, Ω,
ω
, or
Θ
of B.
Assume that 1≥k, 0>
ε
, and 1>c are constants. Place 'yes' or 'no' in each of the empty cells below,
and justify your answers.
A B O o
Ω
ω
Θ
a. (1 Point) n
k
lg
ε
n
b. (1 Point) k
n n
c
c. (1 Point) n n
nsin
d. (1 Point) n
2 2/
2n
e. (1 Point) c
nlg n
clg
f. (1 Point) )!lg(n )lg( n
n
pf2

Partial preview of the text

Download Asymptotic Notation Homework Assignment 1 for CMPS 101, Winter 2009 and more Assignments Computer Science in PDF only on Docsity!

1

CMPS 101

Winter 2009

Homework Assignment 2

  1. (1 Point) p.50: 3.1- Let f ( n ) and g ( n ) be asymptotically non-negative functions. Using the basic definition of Θ - notation, prove that f ( n )+ g ( n )=Θ(max( f ( n ), g ( n ))).
  2. (1 Point) p.50: 3.1-

Explain why the statement “The running time of algorithm A is at least O ( n^2 )” is meaningless.

  1. (2 Points) p. 50: 3.1- Determine whether the following statements are true or false. a. (1 Point) 2 n^ +^1 = O ( 2 n ) b. (1 Point) 2 2 n^ = O ( 2 n )
  2. (6 Points) p.58: 3-2abcdef

Indicate, for each pair of expressions ( A , B ) in the table below, whether A is O , o , Ω , ω , or Θ of B.

Assume that k ≥ 1 , ε > 0 , and c > 1 are constants. Place 'yes' or 'no' in each of the empty cells below,

and justify your answers.

A B O o (^) Ω ω Θ a. (1 Point) (^) lg kn n^ ε b. (1 Point) (^) n k cn c. (1 Point) (^) n n sin n d. (1 Point) 2 n 2 n /^2 e. (1 Point) (^) n lg^ c c lg n f. (1 Point) lg( n! ) lg( nn )

2

  1. (4 Points) p.58: 3-4cdeh Let f ( n ) and g ( n ) be asymptotically positive functions (i.e. f ( n )> 0 and g ( n )> 0 for sufficiently large n .) Prove or disprove the following statements.

c. (1 Point) Assume lg( g ( n ))≥ 1 and f ( n )≥ 1 for all sufficiently large n. Then f ( n )= O ( g ( n )) implies lg( f ( n ))= O (lg( g ( n ))). d. (1 Point) f ( n )= O ( g ( n ))implies 2 f^ (^ n )= O ( 2 g ( n )). e. (1 Point) f ( n )= O (( f ( n ))^2 ). h. (1 Point) f ( n )+ o ( f ( n ))=Θ( f ( n )).

  1. (10 Points)

Let f ( n )= Θ( n ). Prove that ( ) (^2 ) 1

f i n

n

i

∑ =^ Θ

=

. (See the hint at bottom of p.4 of the handout on

asymptotic growth rates.)