













































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An introduction to big o notation and time complexity in discrete mathematics. It covers the concepts of time, input size, worst-case time, and growth rates. The document also discusses various notations such as o, ω, θ, and log*(n). Additionally, it introduces ackermann's function.
Typology: Slides
1 / 53
This page cannot be seen from the preview
Don't miss anything!














































Ho w to a d d 2 n -b it nu m b e rs
Ho w to a d d 2 n -b it nu m b e rs
Ho w to a d d 2 n -b it nu m b e rs
“Gra d e s c h o o l a d d itio n ”
Ho w to a d d 2 n -b it nu m b e rs
Our Goal We wa n t to d e fin e “tim e ” in a wa y th a t tra n s c e nd s im p le m e n ta tio n d e ta ils a n d a llo ws u s to m a ke a s s e r tio n s a b o u t g ra d e s c h o ol a d d itio n in a ve r y ge n e ra l ye t u s e fu l wa y.
Roadblock ???
On another computer M’, th e tim e to p e r fo r m m a y b e c ’.
To ta l tim e to a d d two n -b it nu m b e rs u s in g g ra d e s c h o o l a d d itio n :
c ’n [c ’ tim e fo r e a c h o f n c o lu m ns ]
The fact that we get a line is inva r ia nt u n d e r c h a n ge s o f im p le m e n ta tio ns. Diffe re n t m a c h in e s re s u lt in d iffe re n t s lo p e s , b u t tim e g ro ws lin e a rly a s in p u t s ize in c re a s e s.
t i m e
Time vs Input Size
Fo r a n y a lgo r ith m , d e fin e In p u t S ize = # o f b its to s p e c ify its in p u ts.
De fin e TIME (^) n = th e wo rs t-c a s e a m o u n t o f tim e u s e d o n in p u ts o f s ize n
We o fte n a s k: Wh a t is th e g ro wth ra te o f Tim e (^) n?
n 2
Ho w to mu ltip ly 2 n -b it nu m b e rs.
t i m e
Gra d e S c h o o l Ad d itio n : Lin e a r tim e Gra d e S c h o o l Mu ltip lic a tio n : Qu a d ra tic tim e
No m a tte r h o w d ra m a tic th e d iffe re n c e in th e c o n s ta n ts , th e q u a d ra tic c u rve will e ve n tua lly d o m in a te th e lin e a r c u rve
How much time does it take to square the nu m b e r N u s in g g ra d e s c h o o l mu ltip lic a tio n?