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

Asymptotic Notation Midterm 1 Review Problems, Study notes of Computer Science

Review problems for the midterm exam of a computer science 101 course, focusing on asymptotic notation. Topics include big o, big omega, and big theta notations, as well as related concepts such as limits and stirling's formula. Students are asked to prove various statements and theorems using these concepts.

Typology: Study notes

Pre 2010

Uploaded on 08/19/2009

koofers-user-57p-1
koofers-user-57p-1 🇺🇸

10 documents

1 / 2

Toggle sidebar

Related documents


Partial preview of the text

Download Asymptotic Notation Midterm 1 Review Problems and more Study notes Computer Science in PDF only on Docsity! CMPS 101 Midterm 1 Review Problems 1. Let )(nf and )(ng be asymptotically non-negative functions which are defined on the positive integers. a. State the definition of ))(()( ngOnf = . b. State the definition of ))(()( ngnf ω= 2. State whether the following assertions are true or false. If any statements are false, give a related statement which is true. a. ))(()( ngOnf = implies ))(()( ngonf = . b. ))(()( ngOnf = if and only if ))(()( nfng Ω= . c. ))(()( ngnf Θ= if and only if Lngnf n = ∞→ ))(/)((lim , where ∞<< L0 . 3. Prove that ))()(())(())(( ngnfngnf ⋅Θ=Θ⋅Θ . In other words, if ))(()(1 nfnh Θ= and ))(()(2 ngnh Θ= , then ))()(()()( 21 ngnfnhnh ⋅Θ=⋅ . 4. Use limits to prove the following (these are some of the exercises at the end of the asymptotic growth rates handout): a. If )(nP is a polynomial of degree 0≥k , then )()( knnP Θ= . b. For any positive real numbers α and β : )( βα non = iff βα < , )( βα nn Θ= iff βα = , and )( βα ω nn = iff βα > . c. For any positive real numbers a and b: )( nn boa = iff ba < , )( nn ba Θ= iff ba = , and )( nn ba ω= iff ba > . d. ))(())(()( nfnfonf Θ=+ . 5. Use Stirling’s formula: ( ))/1(12! n e n nn n Θ+⋅     ⋅= π , to prove that )log()!log( nnn Θ= . 6. Use Stirling’s formula to prove that       Θ=      nn n n42 . 7. Consider the following sketch of an algorithm called ProcessArray which performs some unspecified operation on a subarray ][ rpA  . ProcessArray(A, p, r) (Preconditions: 1≥p and ][Alengthr ≤ ) 1. do something which takes constant time. 2. if rp < 3.   +← 2 rp q 4. ProcessArray(A, p, q) 5. ProcessArray(A, q+1, r) Write a recurrence which gives the running time )(nT of this algorithm, when called on the full array ]1[ nA  . Give a tight asymptotic solution to this recurrence.
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved