Similar idea to multiplication in N, C. Divide and conquer approach provides unexpected improvements. Naïve matrix multiplication
|
|
- George Thornton
- 5 years ago
- Views:
Transcription
1 Next. Covered bsics of simple desig techique (Divided-coquer) Ch. of the text.. Next, Strsse s lgorithm. Lter: more desig d coquer lgorithms: MergeSort. Solvig recurreces d the Mster Theorem. Similr ide to multiplictio i N, C Divide d coquer pproch provides uexpected improvemets 5/5/00 CSE 0 Lecture Nïve mtrix multiplictio SimpleMtrixMultiply (A,B). N A.rows. C CreteMtrix(,). for i to 4. for j to 5. C[i,j] 0 6. for k to 7. C[i,j] C[i,j] + A[i,k]*B[k,j] 8. retur C Argue tht the ruig time is θ( ) First ttempt d Divide & Coquer Divide A,B ito 4 / x / mtrices C A B + A B C A B + A B C A B + A B C A B + A B Simple Recursive implemettio. Ruig time is give by the followig recurrece. T() C, d for > T() 8T(/) + θ( ) θ( ) time-complexity Strsse s lgorithm Avoid oe multiplictio (detils o pge 80) (but uses more dditios) Recurrece: T() C, d for > T() 7T(/) + θ( ) How c we solve this? Will see tht T() θ( lg 7 ), lg The mximum-subrry problem Give rry of itegers, fid cotiguous subrry with the mximum sum. Very ïve lgorithm: Brute force lgorithm: At best, θ( ) time complexity
2 C we do divide d coquer? Wt to use swers from left d right hlf subrrys. Problem: The swer my ot lie i either! Key questio: Wht iformtio do we eed from (smller) subproblems to solve the big problem? A divide d coquer lgorithm Algorithm i Ch 4.: Recurrece: T() C, d for > T() T(/) + θ() Relted questio: how do we get this iformtio? T() θ( log ) More divide d coquer : Merge Sort Divide: If S hs t lest two elemets (othig eeds to be doe if S hs zero or oe elemets), remove ll the elemets from S d put them ito two sequeces, S d S, ech cotiig bout hlf of the elemets of S. (i.e. S cotis the first / elemets d S cotis the remiig / elemets). Coquer: Sort sequeces S d S usig Merge Sort. Combie: Put bck the elemets ito S by mergig the sorted sequeces S d S ito oe sorted sequece Merge Sort: Algorithm Merge-Sort(A, p, p, r) r) if if p < r the the q (p+r)/ Merge-Sort(A, p, p, q) q) Merge-Sort(A, q+, q+, r) r) Merge(A, p, p, q, q, r) r) Merge(A, p, p, q, q, r) r) Tke Tke the the smllest of of the the two two topmost elemets of of sequeces A[p..q] d d A[q+..r] d d put put ito ito the the resultig sequece. Repet this, this, util util both both sequeces re re empty. Copy Copy the the resultig sequece ito ito A[p..r].
3
4
5
6 Merge Sort: summry To sort umbers if doe! recursively sort lists of umbers / d / elemets merge sorted lists i Θ() time Strtegy brek problem ito similr (smller) subproblems recursively solve subproblems combie solutios to swer Recurreces Ruig times of lgorithms with Recursive clls c be described usig recurreces A recurrece is equtio or iequlity tht describes fuctio i terms of its vlue o smller iputs Exmple: Merge Sort solvig_trivil_problem if T ( ) um_pieces T ( / subproblem_size_fctor) + dividig + combiig if > Θ () if T ( ) T ( /) +Θ ( ) if > Solvig recurreces Repeted substitutio method Expdig the recurrece by substitutio d oticig ptters Substitutio method guessig the solutios verifyig the solutio by the mthemticl iductio Recursio-trees Mster method templtes for differet clsses of recurreces Repeted Substitutio Method Let s fid the ruig time of merge sort (let s ssume tht b, for some b). if T( ) T( /) + if > T( ) T( / ) + substitute ( T( /4 ) + / ) + expd T( / 4) + substitute ( T( /8) + / 4) + expd T( /8) + observe the ptter i i T( ) T( / ) + i lg T( / ) + lg + lg
7 Repeted Substitutio Method The procedure is strightforwrd: Substitute Expd Substitute Expd Observe ptter d write how your expressio looks fter the i-th substitutio Fid out wht the vlue of i (e.g., lg ) should be to get the bse cse of the recurrece (sy T()) Isert the vlue of T() d the expressio of i ito your expressio Substitutio method Solve T( ) 4 T( / ) + ) Guess tht T( ) O( ), i.e., tht T of the form c ) Assume ( ) for / d T k ck k ) Prove ( ) by iductio T c T( ) 4 T( / ) + (recurrece) + Thus T( ) O( )! 4c(/) (id. hypoth.) c + (simplify) c c (rerrge) c if c d (stisfy) Subtlety: Must choose c big eough to hdle T( ) Θ () for < for some 0 0 Substitutio method Achievig tighter bouds T Try to show ( ) ( ) Assume Tk ( ) ck T ( ) 4 T ( /) + + 4( c/) + c O > c for o choice of c 0. Substitutio method The problem: We could ot rewrite the equlity s: T ( ) c+ (somethig positive) T ( ) c i order to show the iequlity we wted Sometimes to prove iductive step, try to stregthe your hypothesis T() (swer you wt) - (somethig > 0) Substitutio method Corrected proof: the ide is to stregthe the iductive hypothesis by subtrctig lower-order terms! Assume Tk ( ) ck ck for k< T ( ) 4 T ( /) + 4( c( / ) c( / )) + c c + c c ( c ) c cif c Recursio Tree A recursio tree is coveiet wy to visulize wht hppes whe recurrece is iterted Costructio of recursio tree T ( ) T ( /4) + T ( /) +
8 Recursio Tree Recursio Tree T ( ) T ( /) + T( /) + Mster Method The ide is to solve clss of recurreces tht hve the form T ( ) Tb ( / ) + f ( ) Mster method d b >, d f is symptoticlly positive! Abstrctly spekig, T() is the rutime for lgorithm d we kow tht subproblems of size /b re solved recursively, ech i time T(/b) f() is the cost of dividig the problem d combiig the results. I merge-sort T ( ) T ( /) +Θ( ) Split problem ito prts t log b levels. There re leves Mster method Number of leves: Itertig the recurrece, expdig the tree yields log log b T ( ) f ( ) + Tb ( / ) b f + f b + T b ( ) ( / ) ( / ) f + f b + T b + ( ) ( / ) ( / )... + f( / b ) + T() log log log b b b Thus, j j ( ) ( / ) ( ) T fb +Θ j 0 The first term is divisio/recombitio cost (totled cross ll levels of the tree) log b The secod term is the cost of doig ll subproblems of size (totl of ll work pushed to leves) Mster method ituitio Three commo cses: Ruig time domited by cost t leves Ruig time evely distributed throughout the tree Ruig time domited by cost t root Cosequetly, to solve the recurrece, we eed oly to chrcterize the domit term I ech cse compre f ( ) with O ( )
9 Mster method Cse ( ) ( ε f O ) for some costt ε > 0 f() grows polyomilly (by fctor ε ) slower th log b The work t the lef level domites Summtio of recursio-tree levels O ( ) Cost of ll the leves Thus, the overll cost Θ( ) Θ( ) Mster method Cse f ( ) Θ( lg ) log f ( ) d b re symptoticlly the sme The work is distributed eqully throughout the tree T ( ) Θ( lg ) (level cost) (umber of levels) Mster method Cse ( ) ( +ε f Ω ) for some costt Iverse of Cse f() grows polyomilly fster th log b Also eed regulrity coditio c< d > 0 such tht f( / b) cf( ) > The work t the root domites T ( ) Θ( f ( )) ε > Mster Theorem Summrized Give recurrece of the form T ( ) Tb ( / ) + f ( ) ε. f( ) O( ) T ( ) Θ( ). f( ) Θ( ) T ( ) Θ( lg) +ε. f ( ) Ω( ) d f( / b) cf( ), for some c<, > 0 T ( ) Θ( f ( )) The mster method cot solve every recurrece of this form; there is gp betwee cses d, s well s cses d Usig the Mster Theorem Extrct, b, d f() from give recurrece log Determie b log b Compre f() d symptoticlly Determie pproprite MT cse, d pply Exmple merge sort T ( ) T ( /) +Θ( ) log b log, b ; Θ( ) Also f( ) Θ( ) Cse : T ( ) Θ lg Θ lg ( ) ( ) Exmples T () T (/) + b log, ; lso f (), f () Θ() Cse : T () Θ(lg) T ( ) 9 T ( /) + 9, b ; f f O ε log 9 ε (), () ( ) with Cs e : T () Θ ( ) Biry-serch(A, p, p, r, r, s): s): q (p+r)/ if if A[q]s the the retur q else else if if A[q]>s the the Biry-serch(A, p, p, q-, q-, s) s) else else Biry-serch(A, q+, q+, r, r, s) s)
10 Exmples Exmples T ( ) T ( /4) + lg, b 4; log f f log4 +ε ( ) lg, ( ) Ω( ) with ε 0. Cse : Regulrity coditio f ( / b) ( /4)lg( / 4) (/ 4) lg cf ( ) for c / 4 T ( ) Θ( lg ) T ( ) T ( /) + lg log, b ; +ε f ( ) lg, f( ) Ω( ) with ε? lso l g / lg either Cse or Cse! T( ) 4 T( /) + 4, b ; log 4 f f Ω ( ) ; ( ) ( ) Cse : T( ) Θ ( ) Checkig the regulrity coditio 4 f( / ) cf( ) 4 /8 c / c c /4< A quick review of logrithms Properties to remember. log (b) log + log b. log (/b) log - log b. log (/) - log 4. log log 5. log Next. Covered bsics of simple desig techique (Divided-coquer) Ch. 4 of the text.. Next, more sortig lgorithms. It follows tht :. log. + log. log (log )
This Lecture. Divide and Conquer. Merge Sort: Algorithm. Merge Sort Algorithm. MergeSort (Example) - 1. MergeSort (Example) - 2
This Lecture Divide-ad-coquer techique for algorithm desig. Example the merge sort. Writig ad solvig recurreces Divide ad Coquer Divide-ad-coquer method for algorithm desig: Divide: If the iput size is
More information5. Solving recurrences
5. Solvig recurreces Time Complexity Alysis of Merge Sort T( ) 0 if 1 2T ( / 2) otherwise sortig oth hlves mergig Q. How to prove tht the ru-time of merge sort is O( )? A. 2 Time Complexity Alysis of Merge
More informationAlgorithms and Data Structures Lecture IV
Algorithms ad Data Structures Lecture IV Simoas Šalteis Aalborg Uiversity simas@cs.auc.dk September 5, 00 1 This Lecture Aalyzig the ruig time of recursive algorithms (such as divide-ad-coquer) Writig
More informationMerge Sort. Outline and Reading. Divide-and-Conquer. Divide-and-conquer paradigm ( 4.1.1) Merge-sort ( 4.1.1)
Merge Sort 7 2 9 4 2 4 7 9 7 2 2 7 9 4 4 9 7 7 2 2 9 9 4 4 Merge Sort versio 1.3 1 Outlie d Redig Divide-d-coquer prdigm ( 4.1.1 Merge-sort ( 4.1.1 Algorithm Mergig two sorted sequeces Merge-sort tree
More informationLecture 4 Recursive Algorithm Analysis. Merge Sort Solving Recurrences The Master Theorem
Lecture 4 Recursive Algorithm Alysis Merge Sort Solvig Recurreces The Mster Theorem Merge Sort MergeSortA, left, right) { if left < right) { mid floorleft right) / 2); MergeSortA, left, mid); MergeSortA,
More informationLecture 4 Recursive Algorithm Analysis. Merge Sort Solving Recurrences The Master Theorem
Lecture 4 Recursive Algorithm Alysis Merge Sort Solvig Recurreces The Mster Theorem Merge Sort MergeSortA, left, right) { if left < right) { mid = floorleft + right) / 2); MergeSortA, left, mid); MergeSortA,
More informationSection IV.6: The Master Method and Applications
Sectio IV.6: The Mster Method d Applictios Defiitio IV.6.1: A fuctio f is symptoticlly positive if d oly if there exists rel umer such tht f(x) > for ll x >. A cosequece of this defiitio is tht fuctio
More informationPresentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, Divide-and-Conquer
Presettio for use with the textook, Algorithm Desig d Applictios, y M. T. Goodrich d R. Tmssi, Wiley, 25 Divide-d-Coquer Divide-d-Coquer Divide-d coquer is geerl lgorithm desig prdigm: Divide: divide the
More informationRecurrece reltio & Recursio 9 Chpter 3 Recurrece reltio & Recursio Recurrece reltio : A recurrece is equtio or iequlity tht describes fuctio i term of itself with its smller iputs. T T The problem of size
More information( a n ) converges or diverges.
Chpter Ifiite Series Pge of Sectio E Rtio Test Chpter : Ifiite Series By the ed of this sectio you will be ble to uderstd the proof of the rtio test test series for covergece by pplyig the rtio test pprecite
More informationNumbers (Part I) -- Solutions
Ley College -- For AMATYC SML Mth Competitio Cochig Sessios v.., [/7/00] sme s /6/009 versio, with presettio improvemets Numbers Prt I) -- Solutios. The equtio b c 008 hs solutio i which, b, c re distict
More informationCS583 Lecture 02. Jana Kosecka. some materials here are based on E. Demaine, D. Luebke slides
CS583 Lecture 02 Jaa Kosecka some materials here are based o E. Demaie, D. Luebke slides Previously Sample algorithms Exact ruig time, pseudo-code Approximate ruig time Worst case aalysis Best case aalysis
More informationData Structures and Algorithm. Xiaoqing Zheng
Data Structures ad Algorithm Xiaoqig Zheg zhegxq@fudaeduc What are algorithms? A sequece of computatioal steps that trasform the iput ito the output Sortig problem: Iput: A sequece of umbers
More informationCS 270 Algorithms. Oliver Kullmann. Growth of Functions. Divide-and- Conquer Min-Max- Problem. Tutorial. Reading from CLRS for week 2
Geeral remarks Week 2 1 Divide ad First we cosider a importat tool for the aalysis of algorithms: Big-Oh. The we itroduce a importat algorithmic paradigm:. We coclude by presetig ad aalysig two examples.
More informationSection 6.3: Geometric Sequences
40 Chpter 6 Sectio 6.: Geometric Sequeces My jobs offer ul cost-of-livig icrese to keep slries cosistet with ifltio. Suppose, for exmple, recet college grdute fids positio s sles mger erig ul slry of $6,000.
More informationCS 331 Design and Analysis of Algorithms. -- Divide and Conquer. Dr. Daisy Tang
CS 33 Desig d Alysis of Algorithms -- Divide d Coquer Dr. Disy Tg Divide-Ad-Coquer Geerl ide: Divide problem ito subproblems of the sme id; solve subproblems usig the sme pproh, d ombie prtil solutios,
More informationM3P14 EXAMPLE SHEET 1 SOLUTIONS
M3P14 EXAMPLE SHEET 1 SOLUTIONS 1. Show tht for, b, d itegers, we hve (d, db) = d(, b). Sice (, b) divides both d b, d(, b) divides both d d db, d hece divides (d, db). O the other hd, there exist m d
More information1.3 Continuous Functions and Riemann Sums
mth riem sums, prt 0 Cotiuous Fuctios d Riem Sums I Exmple we sw tht lim Lower() = lim Upper() for the fuctio!! f (x) = + x o [0, ] This is o ccidet It is exmple of the followig theorem THEOREM Let f be
More informationData Structures Lecture 9
Fall 2017 Fag Yu Software Security Lab. Dept. Maagemet Iformatio Systems, Natioal Chegchi Uiversity Data Structures Lecture 9 Midterm o Dec. 7 (9:10-12:00am, 106) Lec 1-9, TextBook Ch1-8, 11,12 How to
More informationDivide-and-Conquer. Divide-and-Conquer 1
Divide-d-Coquer 7 9 4 4 7 9 7 7 9 4 4 9 7 7 9 9 4 4 Divide-d-Coquer 1 Outie d Redig Divide-d-coquer prdigm 5. Review Merge-sort 4.1.1 Recurrece Equtios 5..1 tertive sustitutio Recursio trees Guess-d-test
More informationPROGRESSIONS AND SERIES
PROGRESSIONS AND SERIES A sequece is lso clled progressio. We ow study three importt types of sequeces: () The Arithmetic Progressio, () The Geometric Progressio, () The Hrmoic Progressio. Arithmetic Progressio.
More informationData Structures and Algorithms CMPSC 465
Dt Structures nd Algorithms CMPSC 465 LECTURE 10 Solving recurrences Mster theorem Adm Smith S. Rskhodnikov nd A. Smith; bsed on slides by E. Demine nd C. Leiserson Review questions Guess the solution
More informationRelation of BSTs to Quicksort, Analysis of Random BST. Lecture 9
Reltio o BSTs to Quicsort, Alysis o Rdom BST Lecture 9 Biry-serch-tree sort T Crete empty BST or i = to do TREE-INSERT(T, A[i]) Perorm iorder tree wl o T. Emple: 3 A = [3 8 2 6 7 5] 8 Tree-wl time = O(),
More informationCS 332: Algorithms. Quicksort
CS 33: Aorithms Quicsort David Luebe //03 Homewor Assiged today, due ext Wedesday Will be o web page shortly after class Go over ow David Luebe //03 Review: Quicsort Sorts i place Sorts O( ) i the average
More informationTaylor Polynomials. The Tangent Line. (a, f (a)) and has the same slope as the curve y = f (x) at that point. It is the best
Tylor Polyomils Let f () = e d let p() = 1 + + 1 + 1 6 3 Without usig clcultor, evlute f (1) d p(1) Ok, I m still witig With little effort it is possible to evlute p(1) = 1 + 1 + 1 (144) + 6 1 (178) =
More informationWeek 13 Notes: 1) Riemann Sum. Aim: Compute Area Under a Graph. Suppose we want to find out the area of a graph, like the one on the right:
Week 1 Notes: 1) Riem Sum Aim: Compute Are Uder Grph Suppose we wt to fid out the re of grph, like the oe o the right: We wt to kow the re of the red re. Here re some wys to pproximte the re: We cut the
More informationSM2H. Unit 2 Polynomials, Exponents, Radicals & Complex Numbers Notes. 3.1 Number Theory
SMH Uit Polyomils, Epoets, Rdicls & Comple Numbers Notes.1 Number Theory .1 Addig, Subtrctig, d Multiplyig Polyomils Notes Moomil: A epressio tht is umber, vrible, or umbers d vribles multiplied together.
More informationLesson-2 PROGRESSIONS AND SERIES
Lesso- PROGRESSIONS AND SERIES Arithmetic Progressio: A sequece of terms is sid to be i rithmetic progressio (A.P) whe the differece betwee y term d its preceedig term is fixed costt. This costt is clled
More informationIntroduction to Algorithms 6.046J/18.401J
Itrodutio to Algorithms.04J/8.40J The divide-d-oquer desig prdigm. Divide the problem (iste) ito subproblems.. Coquer the subproblems by solvig them reursively. 3. Combie subproblem solutios. Leture 3
More informationChapter 5. The Riemann Integral. 5.1 The Riemann integral Partitions and lower and upper integrals. Note: 1.5 lectures
Chpter 5 The Riem Itegrl 5.1 The Riem itegrl Note: 1.5 lectures We ow get to the fudmetl cocept of itegrtio. There is ofte cofusio mog studets of clculus betwee itegrl d tiderivtive. The itegrl is (iformlly)
More information) 2 2(2. Assume that
lg lg W W W W W W W Assume tht lg log. 0. with for, W W W For ot power of, W 0 W W W for hrd to lyze this cse exctly ecuse of the floors d ceiligs. usig iductio rgumet lie the oe i Ex B.5 i Appedix B,
More informationModel of Computation and Runtime Analysis
Model of Computatio ad Rutime Aalysis Model of Computatio Model of Computatio Specifies Set of operatios Cost of operatios (ot ecessarily time) Examples Turig Machie Radom Access Machie (RAM) PRAM Map
More information1. (25 points) Use the limit definition of the definite integral and the sum formulas to compute. [1 x + x2
Mth 3, Clculus II Fil Exm Solutios. (5 poits) Use the limit defiitio of the defiite itegrl d the sum formuls to compute 3 x + x. Check your swer by usig the Fudmetl Theorem of Clculus. Solutio: The limit
More informationThe maximum-subarray problem. Given an array of integers, find a contiguous subarray with the maximum sum. Very naïve algorithm:
The maximum-subarray problem Given an array of integers, find a contiguous subarray with the maximum sum. Very naïve algorithm: Brute force algorithm: At best, θ(n 2 ) time complexity 129 Can we do divide
More informationFig. 1. I a. V ag I c. I n. V cg. Z n Z Y. I b. V bg
ymmetricl Compoets equece impedces Although the followig focuses o lods, the results pply eqully well to lies, or lies d lods. Red these otes together with sectios.6 d.9 of text. Cosider the -coected lced
More informationAlgorithm Design and Analysis
Algorithm Design nd Anlysis LECTURE 12 Solving Recurrences Mster Theorem Adm Smith Review Question: Exponentition Problem: Compute b, where b N is n bits long. Question: How mny multiplictions? Nive lgorithm:
More informationMath 3B Midterm Review
Mth 3B Midterm Review Writte by Victori Kl vtkl@mth.ucsb.edu SH 643u Office Hours: R 11:00 m - 1:00 pm Lst updted /15/015 Here re some short otes o Sectios 7.1-7.8 i your ebook. The best idictio of wht
More informationModel of Computation and Runtime Analysis
Model of Computatio ad Rutime Aalysis Model of Computatio Model of Computatio Specifies Set of operatios Cost of operatios (ot ecessarily time) Examples Turig Machie Radom Access Machie (RAM) PRAM Map
More informationAnalysis of Algorithms -Quicksort-
Aalysis of Algorithms -- Adreas Ermedahl MRTC (Mälardales Real-Time Research Ceter) adreas.ermedahl@mdh.se Autum 2004 Proposed by C.A.R. Hoare i 962 Worst- case ruig time: Θ( 2 ) Expected ruig time: Θ(
More informationWe will begin by supplying the proof to (a).
(The solutios of problem re mostly from Jeffrey Mudrock s HWs) Problem 1. There re three sttemet from Exmple 5.4 i the textbook for which we will supply proofs. The sttemets re the followig: () The spce
More informationData Structures and Algorithms
Data Structures ad Algorithms Autum 2017-2018 Outlie 1 Sortig Algorithms (cotd) Outlie Sortig Algorithms (cotd) 1 Sortig Algorithms (cotd) Heapsort Sortig Algorithms (cotd) Have see that we ca build a
More informationIntroduction to Algorithms 6.046J/18.401J LECTURE 3 Divide and conquer Binary search Powering a number Fibonacci numbers Matrix multiplication
Itroductio to Algorithms 6.046J/8.40J LECTURE 3 Divide ad coquer Biary search Powerig a umber Fiboacci umbers Matrix multiplicatio Strasse s algorithm VLSI tree layout Prof. Charles E. Leiserso The divide-ad-coquer
More informationMatriculation number: You have 90 minutes to complete the exam of InformatikIIb. The following rules apply:
Departmet of Iformatics Prof. Dr. Michael Böhle Bizmühlestrasse 14 8050 Zurich Phoe: +41 44 635 4333 Email: boehle@ifi.uzh.ch AlgoDat Midterm1 Sprig 016 08.04.016 Name: Matriculatio umber: Advice You have
More informationDesign and Analysis of Algorithms
Desig ad Aalysis of Algorithms CSE 53 Lecture 9 Media ad Order Statistics Juzhou Huag, Ph.D. Departmet of Computer Sciece ad Egieerig Dept. CSE, UT Arligto CSE53 Desig ad Aalysis of Algorithms Medias ad
More informationTHE NATIONAL UNIVERSITY OF IRELAND, CORK COLÁISTE NA hollscoile, CORCAIGH UNIVERSITY COLLEGE, CORK SUMMER EXAMINATION 2005 FIRST ENGINEERING
OLLSCOIL NA héireann, CORCAIGH THE NATIONAL UNIVERSITY OF IRELAND, CORK COLÁISTE NA hollscoile, CORCAIGH UNIVERSITY COLLEGE, CORK SUMMER EXAMINATION 2005 FIRST ENGINEERING MATHEMATICS MA008 Clculus d Lier
More informationCOMP26120: More on the Complexity of Recursive Programs (2018/19) Lucas Cordeiro
COMP26120: More o the Complexity of Recursive Programs (2018/19) Lucas Cordeiro lucas.cordeiro@machester.ac.uk Divide-ad-Coquer (Recurrece) Textbook: Algorithm Desig ad Applicatios, Goodrich, Michael T.
More informationFundamental Algorithms
Fudametal Algorithms Chapter 2b: Recurreces Michael Bader Witer 2014/15 Chapter 2b: Recurreces, Witer 2014/15 1 Recurreces Defiitio A recurrece is a (i-equality that defies (or characterizes a fuctio i
More informationA design paradigm. Divide and conquer: (When) does decomposing a problem into smaller parts help? 09/09/ EECS 3101
A design paradigm Divide and conquer: (When) does decomposing a problem into smaller parts help? 09/09/17 112 Multiplying complex numbers (from Jeff Edmonds slides) INPUT: Two pairs of integers, (a,b),
More informationCS473-Algorithms I. Lecture 3. Solving Recurrences. Cevdet Aykanat - Bilkent University Computer Engineering Department
CS473-Algorthms I Lecture 3 Solvg Recurreces Cevdet Aykt - Blket Uversty Computer Egeerg Deprtmet Solvg Recurreces The lyss of merge sort Lecture requred us to solve recurrece. Recurreces re lke solvg
More informationlecture 16: Introduction to Least Squares Approximation
97 lecture 16: Itroductio to Lest Squres Approximtio.4 Lest squres pproximtio The miimx criterio is ituitive objective for pproximtig fuctio. However, i my cses it is more ppelig (for both computtio d
More informationb a 2 ((g(x))2 (f(x)) 2 dx
Clc II Fll 005 MATH Nme: T3 Istructios: Write swers to problems o seprte pper. You my NOT use clcultors or y electroic devices or otes of y kid. Ech st rred problem is extr credit d ech is worth 5 poits.
More informationMTH 146 Class 16 Notes
MTH 46 Clss 6 Notes 0.4- Cotiued Motivtio: We ow cosider the rc legth of polr curve. Suppose we wish to fid the legth of polr curve curve i terms of prmetric equtios s: r f where b. We c view the cos si
More informationFOURIER SERIES PART I: DEFINITIONS AND EXAMPLES. To a 2π-periodic function f(x) we will associate a trigonometric series. a n cos(nx) + b n sin(nx),
FOURIER SERIES PART I: DEFINITIONS AND EXAMPLES To -periodic fuctio f() we will ssocite trigoometric series + cos() + b si(), or i terms of the epoetil e i, series of the form c e i. Z For most of the
More informationReview of the Riemann Integral
Chpter 1 Review of the Riem Itegrl This chpter provides quick review of the bsic properties of the Riem itegrl. 1.0 Itegrls d Riem Sums Defiitio 1.0.1. Let [, b] be fiite, closed itervl. A prtitio P of
More informationUNIVERSITY OF BRISTOL. Examination for the Degrees of B.Sc. and M.Sci. (Level C/4) ANALYSIS 1B, SOLUTIONS MATH (Paper Code MATH-10006)
UNIVERSITY OF BRISTOL Exmitio for the Degrees of B.Sc. d M.Sci. (Level C/4) ANALYSIS B, SOLUTIONS MATH 6 (Pper Code MATH-6) My/Jue 25, hours 3 miutes This pper cotis two sectios, A d B. Plese use seprte
More informationPOWER SERIES R. E. SHOWALTER
POWER SERIES R. E. SHOWALTER. sequeces We deote by lim = tht the limit of the sequece { } is the umber. By this we me tht for y ε > 0 there is iteger N such tht < ε for ll itegers N. This mkes precise
More informationMATH 118 HW 7 KELLY DOUGAN, ANDREW KOMAR, MARIA SIMBIRSKY, BRANDEN LASKE
MATH 118 HW 7 KELLY DOUGAN, ANDREW KOMAR, MARIA SIMBIRSKY, BRANDEN LASKE Prt 1. Let be odd rime d let Z such tht gcd(, 1. Show tht if is qudrtic residue mod, the is qudrtic residue mod for y ositive iteger.
More information4.3 Growth Rates of Solutions to Recurrences
4.3. GROWTH RATES OF SOLUTIONS TO RECURRENCES 81 4.3 Growth Rates of Solutios to Recurreces 4.3.1 Divide ad Coquer Algorithms Oe of the most basic ad powerful algorithmic techiques is divide ad coquer.
More information,... are the terms of the sequence. If the domain consists of the first n positive integers only, the sequence is a finite sequence.
Chpter 9 & 0 FITZGERALD MAT 50/5 SECTION 9. Sequece Defiitio A ifiite sequece is fuctio whose domi is the set of positive itegers. The fuctio vlues,,, 4,...,,... re the terms of the sequece. If the domi
More information0 otherwise. sin( nx)sin( kx) 0 otherwise. cos( nx) sin( kx) dx 0 for all integers n, k.
. Computtio of Fourier Series I this sectio, we compute the Fourier coefficiets, f ( x) cos( x) b si( x) d b, i the Fourier series To do this, we eed the followig result o the orthogolity of the trigoometric
More informationChapter 7 Infinite Series
MA Ifiite Series Asst.Prof.Dr.Supree Liswdi Chpter 7 Ifiite Series Sectio 7. Sequece A sequece c be thought of s list of umbers writte i defiite order:,,...,,... 2 The umber is clled the first term, 2
More informationFast Fourier Transform 1) Legendre s Interpolation 2) Vandermonde Matrix 3) Roots of Unity 4) Polynomial Evaluation
Algorithm Desig d Alsis Victor Admchi CS 5-45 Sprig 4 Lecture 3 J 7, 4 Cregie Mello Uiversit Outlie Fst Fourier Trsform ) Legedre s Iterpoltio ) Vdermode Mtri 3) Roots of Uit 4) Polomil Evlutio Guss (777
More informationUnit 1. Extending the Number System. 2 Jordan School District
Uit Etedig the Number System Jord School District Uit Cluster (N.RN. & N.RN.): Etedig Properties of Epoets Cluster : Etedig properties of epoets.. Defie rtiol epoets d eted the properties of iteger epoets
More informationA GENERAL METHOD FOR SOLVING ORDINARY DIFFERENTIAL EQUATIONS: THE FROBENIUS (OR SERIES) METHOD
Diol Bgoo () A GENERAL METHOD FOR SOLVING ORDINARY DIFFERENTIAL EQUATIONS: THE FROBENIUS (OR SERIES) METHOD I. Itroductio The first seprtio of vribles (see pplictios to Newto s equtios) is ver useful method
More informationMAS221 Analysis, Semester 2 Exercises
MAS22 Alysis, Semester 2 Exercises Srh Whitehouse (Exercises lbelled * my be more demdig.) Chpter Problems: Revisio Questio () Stte the defiitio of covergece of sequece of rel umbers, ( ), to limit. (b)
More informationA recurrence equation is just a recursive function definition. It defines a function at one input in terms of its value on smaller inputs.
CS23 Algorithms Hadout #6 Prof Ly Turbak September 8, 200 Wellesley College RECURRENCES This hadout summarizes highlights of CLRS Chapter 4 ad Appedix A (CLR Chapters 3 & 4) Two-Step Strategy for Aalyzig
More informationImproving XOR-Dominated Circuits by Exploiting Dependencies between Operands. Ajay K. Verma and Paolo Ienne. csda
Improvig XOR-Domited Circuits y Exploitig Depedecies etwee Operds Ajy K. Verm d Polo Iee csd Processor Architecture Lortory LAP & Cetre for Advced Digitl Systems CSDA Ecole Polytechique Fédérle de Luse
More informationEVALUATING DEFINITE INTEGRALS
Chpter 4 EVALUATING DEFINITE INTEGRALS If the defiite itegrl represets re betwee curve d the x-xis, d if you c fid the re by recogizig the shpe of the regio, the you c evlute the defiite itegrl. Those
More informationGraphing Review Part 3: Polynomials
Grphig Review Prt : Polomils Prbols Recll, tht the grph of f ( ) is prbol. It is eve fuctio, hece it is smmetric bout the bout the -is. This mes tht f ( ) f ( ). Its grph is show below. The poit ( 0,0)
More information n. A Very Interesting Example + + = d. + x3. + 5x4. math 131 power series, part ii 7. One of the first power series we examined was. 2!
mth power series, prt ii 7 A Very Iterestig Emple Oe of the first power series we emied ws! + +! + + +!! + I Emple 58 we used the rtio test to show tht the itervl of covergece ws (, ) Sice the series coverges
More informationTest Info. Test may change slightly.
9. 9.6 Test Ifo Test my chge slightly. Short swer (0 questios 6 poits ech) o Must choose your ow test o Tests my oly be used oce o Tests/types you re resposible for: Geometric (kow sum) Telescopig (kow
More informationLEVEL I. ,... if it is known that a 1
LEVEL I Fid the sum of first terms of the AP, if it is kow tht + 5 + 0 + 5 + 0 + = 5 The iterior gles of polygo re i rithmetic progressio The smllest gle is 0 d the commo differece is 5 Fid the umber of
More informationAdvanced Algorithmic Problem Solving Le 6 Math and Search
Advced Algorithmic Prolem Solvig Le Mth d Serch Fredrik Heitz Dept of Computer d Iformtio Sciece Liköpig Uiversity Outlie Arithmetic (l. d.) Solvig lier equtio systems (l. d.) Chiese remider theorem (l.5
More informationDiscrete Mathematics I Tutorial 12
Discrete Mthemtics I Tutoril Refer to Chpter 4., 4., 4.4. For ech of these sequeces fid recurrece reltio stisfied by this sequece. (The swers re ot uique becuse there re ifiitely my differet recurrece
More informationSUTCLIFFE S NOTES: CALCULUS 2 SWOKOWSKI S CHAPTER 11
UTCLIFFE NOTE: CALCULU WOKOWKI CHAPTER Ifiite eries Coverget or Diverget eries Cosider the sequece If we form the ifiite sum 0, 00, 000, 0 00 000, we hve wht is clled ifiite series We wt to fid the sum
More informationSUTCLIFFE S NOTES: CALCULUS 2 SWOKOWSKI S CHAPTER 11
SUTCLIFFE S NOTES: CALCULUS SWOKOWSKI S CHAPTER Ifiite Series.5 Altertig Series d Absolute Covergece Next, let us cosider series with both positive d egtive terms. The simplest d most useful is ltertig
More informationAlgorithms Design & Analysis. Divide & Conquer
Algorithms Desig & Aalysis Divide & Coquer Recap Direct-accessible table Hash tables Hash fuctios Uiversal hashig Perfect Hashig Ope addressig 2 Today s topics The divide-ad-coquer desig paradigm Revised
More informationINTEGRATION IN THEORY
CHATER 5 INTEGRATION IN THEORY 5.1 AREA AROXIMATION 5.1.1 SUMMATION NOTATION Fibocci Sequece First, exmple of fmous sequece of umbers. This is commoly ttributed to the mthemtici Fibocci of is, lthough
More informationGeneral properties of definite integrals
Roerto s Notes o Itegrl Clculus Chpter 4: Defiite itegrls d the FTC Sectio Geerl properties of defiite itegrls Wht you eed to kow lredy: Wht defiite Riem itegrl is. Wht you c ler here: Some key properties
More informationCS 332: Algorithms. Linear-Time Sorting. Order statistics. Slide credit: David Luebke (Virginia)
1 CS 332: Algorithms Liear-Time Sortig. Order statistics. Slide credit: David Luebke (Virgiia) Quicksort: Partitio I Words Partitio(A, p, r): Select a elemet to act as the pivot (which?) Grow two regios,
More informationThe total number of permutations of S is n!. We denote the set of all permutations of S by
DETERMINNTS. DEFINITIONS Def: Let S {,,, } e the set of itegers from to, rrged i scedig order. rerrgemet jjj j of the elemets of S is clled permuttio of S. S. The totl umer of permuttios of S is!. We deote
More informationChapter Real Numbers
Chpter. - Rel Numbers Itegers: coutig umbers, zero, d the egtive of the coutig umbers. ex: {,-3, -, -,,,, 3, } Rtiol Numbers: quotiets of two itegers with ozero deomitor; termitig or repetig decimls. ex:
More informationz line a) Draw the single phase equivalent circuit. b) Calculate I BC.
ECE 2260 F 08 HW 7 prob 4 solutio EX: V gyb' b' b B V gyc' c' c C = 101 0 V = 1 + j0.2 Ω V gyb' = 101 120 V = 6 + j0. Ω V gyc' = 101 +120 V z LΔ = 9 j1.5 Ω ) Drw the sigle phse equivlet circuit. b) Clculte
More informationMA123, Chapter 9: Computing some integrals (pp )
MA13, Chpter 9: Computig some itegrls (pp. 189-05) Dte: Chpter Gols: Uderstd how to use bsic summtio formuls to evlute more complex sums. Uderstd how to compute its of rtiol fuctios t ifiity. Uderstd how
More informationSection 11.5 Notes Page Partial Fraction Decomposition. . You will get: +. Therefore we come to the following: x x
Setio Notes Pge Prtil Frtio Deompositio Suppose we were sked to write the followig s sigle frtio: We would eed to get ommo deomitors: You will get: Distributig o top will give you: 8 This simplifies to:
More informationDepartment of Informatics Prof. Dr. Michael Böhlen Binzmühlestrasse Zurich Phone:
Departmet of Iformatics Prof. Dr. Michael Böhle Bizmühlestrasse 14 8050 Zurich Phoe: +41 44 635 4333 Email: boehle@ifi.uzh.ch Iformatik II Midterm1 Sprig 018 3.03.018 Advice You have 90 miutes to complete
More informationThe limit comparison test
Roerto s Notes o Ifiite Series Chpter : Covergece tests Sectio 4 The limit compriso test Wht you eed to kow lredy: Bsics of series d direct compriso test. Wht you c ler here: Aother compriso test tht does
More informationStatistics for Financial Engineering Session 1: Linear Algebra Review March 18 th, 2006
Sttistics for Ficil Egieerig Sessio : Lier Algebr Review rch 8 th, 6 Topics Itroductio to trices trix opertios Determits d Crmer s rule Eigevlues d Eigevectors Quiz The cotet of Sessio my be fmilir to
More informationSurds, Indices, and Logarithms Radical
MAT 6 Surds, Idices, d Logrithms Rdicl Defiitio of the Rdicl For ll rel, y > 0, d ll itegers > 0, y if d oly if y where is the ide is the rdicl is the rdicd. Surds A umber which c be epressed s frctio
More informationStudent Success Center Elementary Algebra Study Guide for the ACCUPLACER (CPT)
Studet Success Ceter Elemetry Algebr Study Guide for the ACCUPLACER (CPT) The followig smple questios re similr to the formt d cotet of questios o the Accuplcer Elemetry Algebr test. Reviewig these smples
More informationSect Simplifying Radical Expressions. We can use our properties of exponents to establish two properties of radicals: and
128 Sect 10.3 - Simplifyig Rdicl Expressios Cocept #1 Multiplictio d Divisio Properties of Rdicls We c use our properties of expoets to estlish two properties of rdicls: () 1/ 1/ 1/ & ( Multiplictio d
More informationChapter 2 Infinite Series Page 1 of 9
Chpter Ifiite eries Pge of 9 Chpter : Ifiite eries ectio A Itroductio to Ifiite eries By the ed of this sectio you will be ble to uderstd wht is met by covergece d divergece of ifiite series recogise geometric
More informationis an ordered list of numbers. Each number in a sequence is a term of a sequence. n-1 term
Mthemticl Ptters. Arithmetic Sequeces. Arithmetic Series. To idetify mthemticl ptters foud sequece. To use formul to fid the th term of sequece. To defie, idetify, d pply rithmetic sequeces. To defie rithmetic
More informationf(bx) dx = f dx = dx l dx f(0) log b x a + l log b a 2ɛ log b a.
Eercise 5 For y < A < B, we hve B A f fb B d = = A B A f d f d For y ɛ >, there re N > δ >, such tht d The for y < A < δ d B > N, we hve ba f d f A bb f d l By ba A A B A bb ba fb d f d = ba < m{, b}δ
More informationINTEGRATION TECHNIQUES (TRIG, LOG, EXP FUNCTIONS)
Mthemtics Revisio Guides Itegrtig Trig, Log d Ep Fuctios Pge of MK HOME TUITION Mthemtics Revisio Guides Level: AS / A Level AQA : C Edecel: C OCR: C OCR MEI: C INTEGRATION TECHNIQUES (TRIG, LOG, EXP FUNCTIONS)
More informationClassification of problem & problem solving strategies. classification of time complexities (linear, logarithmic etc)
Classificatio of problem & problem solvig strategies classificatio of time complexities (liear, arithmic etc) Problem subdivisio Divide ad Coquer strategy. Asymptotic otatios, lower boud ad upper boud:
More information10.5 Test Info. Test may change slightly.
0.5 Test Ifo Test my chge slightly. Short swer (0 questios 6 poits ech) o Must choose your ow test o Tests my oly be used oce o Tests/types you re resposible for: Geometric (kow sum) Telescopig (kow sum)
More informationEXERCISE a a a 5. + a 15 NEETIIT.COM
- Dowlod our droid App. Sigle choice Type Questios EXERCISE -. The first term of A.P. of cosecutive iteger is p +. The sum of (p + ) terms of this series c be expressed s () (p + ) () (p + ) (p + ) ()
More informationMath 104: Final exam solutions
Mth 14: Fil exm solutios 1. Suppose tht (s ) is icresig sequece with coverget subsequece. Prove tht (s ) is coverget sequece. Aswer: Let the coverget subsequece be (s k ) tht coverges to limit s. The there
More informationNorthwest High School s Algebra 2
Northwest High School s Algebr Summer Review Pcket 0 DUE August 8, 0 Studet Nme This pcket hs bee desiged to help ou review vrious mthemticl topics tht will be ecessr for our success i Algebr. Istructios:
More information