Algorithm Design and Analysis
|
|
- Pierce Williams
- 5 years ago
- Views:
Transcription
1 Algorithm Design nd Anlysis LECTURE 12 Solving Recurrences Mster Theorem Adm Smith
2 Review Question: Exponentition Problem: Compute b, where b N is n bits long. Question: How mny multiplictions? Nive lgorithm: Θ(b) = Θ(2 n ) (exponentil in the input length!) Divide-nd-conquer lgorithm: b = b/2 b/2 if b is even; (b 1)/2 (b 1)/2 if b is odd. T(b) = T(b/2) + Θ(1) T(b) = Θ(log b) = Θ(n).
3 So fr: 2 recurrences Mergesort; Counting Inversions T(n) = 2 T(n/2) + Θ(n) = Θ(n log n) Binry Serch; Exponentition T(n) = 1 T(n/2) + Θ(1) = Θ(log n) Mster Theorem: method for solving recurrences.
4 The mster method The mster method pplies to recurrences of the form T(n) = T(n/b) +, where 1, b > 1, nd f is symptoticlly positive, tht is >0 for ll n > n 0.
5 Three common cses Compre with n log b : 1. = O(n log b ε ) for some constnt ε > 0. grows polynomilly slower thn n log b (by n n ε fctor). Solution: T(n) = Θ(n log b ).
6 Three common cses Compre with n log b : 1. = O(n log b ε ) for some constnt ε > 0. grows polynomilly slower thn n log b (by n n ε fctor). Solution: T(n) = Θ(n log b ). 2. = Θ(n log b lg k n) for some constnt k 0. nd n log b grow t similr rtes. Solution: T(n) = Θ(n log b lg k+1 n).
7 Three common cses (cont.) Compre with n log b : 3. = Ω(n log b + ε ) for some constnt ε > 0. grows polynomilly fster thn n log b (by n n ε fctor), nd stisfies the regulrity condition tht f (n/b) c for some constnt c < 1. Solution: T(n) = Θ( ).
8 Ide of mster theorem Recursion tree: f (n/b) f (n/b) f (n/b 2 ) f (n/b 2 ) f (n/b 2 ) f (n/b) Τ (1)
9 Ide of mster theorem Recursion tree: f (n/b) f (n/b) f (n/b 2 ) f (n/b 2 ) f (n/b 2 ) f (n/b) f (n/b) 2 f (n/b 2 ) Τ (1)
10 Ide of mster theorem h = log b n Recursion tree: f (n/b) f (n/b) f (n/b 2 ) f (n/b 2 ) f (n/b 2 ) f (n/b) f (n/b) 2 f (n/b 2 ) Τ (1)
11 Ide of mster theorem h = log b n Recursion tree: f (n/b) f (n/b) f (n/b 2 ) f (n/b 2 ) f (n/b 2 ) f (n/b) f (n/b) 2 f (n/b 2 ) Τ (1) #leves = h = log bn = n log b n log b Τ (1)
12 Ide of mster theorem h = log b n Recursion tree: f (n/b) f (n/b) f (n/b 2 ) f (n/b 2 ) f (n/b 2 ) f (n/b) f (n/b) 2 f (n/b 2 ) Τ (1) CASE 1: The weight increses geometriclly from the root to the leves. The leves hold constnt frction of the totl weight. n log b Τ (1) Θ(n log b )
13 Ide of mster theorem h = log b n Recursion tree: f (n/b) f (n/b) f (n/b 2 ) f (n/b 2 ) f (n/b 2 ) f (n/b) f (n/b) 2 f (n/b 2 ) Τ (1) CASE 2: (k = 0) The weight is pproximtely the sme on ech of the log b n levels. n log b Τ (1) Θ(n log b lg n)
14 Ide of mster theorem h = log b n Recursion tree: f (n/b) f (n/b) f (n/b 2 ) f (n/b 2 ) f (n/b 2 ) f (n/b) f (n/b) 2 f (n/b 2 ) Τ (1) CASE 3: The weight decreses geometriclly from the root to the leves. The root holds constnt frction of the totl weight. n log b Τ (1) Θ( )
15 Exmples EX. T(n) = 4T(n/2) + n = 4, b = 2 n log b = n 2 ; = n. CASE 1: = O(n 2 ε ) for ε = 1. T(n) = Θ(n 2 ).
16 Exmples EX. T(n) = 4T(n/2) + n = 4, b = 2 n log b = n 2 ; = n. CASE 1: = O(n 2 ε ) for ε = 1. T(n) = Θ(n 2 ). EX. T(n) = 4T(n/2) + n 2 = 4, b = 2 n log b = n 2 ; = n 2. CASE 2: = Θ(n 2 lg 0 n), tht is, k = 0. T(n) = Θ(n 2 lg n).
17 Exmples EX. T(n) = 4T(n/2) + n 3 = 4, b = 2 n log b = n 2 ; = n 3. CASE 3: = Ω(n 2 + ε ) for ε = 1 nd 4(n/2) 3 cn 3 (reg. cond.) for c = 1/2. T(n) = Θ(n 3 ).
18 Exmples EX. T(n) = 4T(n/2) + n 3 = 4, b = 2 n log b = n 2 ; = n 3. CASE 3: = Ω(n 2 + ε ) for ε = 1 nd 4(n/2) 3 cn 3 (reg. cond.) for c = 1/2. T(n) = Θ(n 3 ). EX. T(n) = 4T(n/2) + n 2 /lg n = 4, b = 2 n log b = n 2 ; = n 2 /lg n. Mster method does not pply. In prticulr, for every constnt ε > 0, we hve n ε = ω(lg n).
19 Notes Reference on Mster Th m to be posted on web Mster Th m generlized by Akr nd Bzzi to cover mny more recurrences: T (n) = f(n) + where h i (n) = O( k i=1 i T (b i n + h i (n)) n log 2 n ) See
20 Multiplying lrge integers Given n-bit integers, b (in binry), compute c=b n-1 n-2 0 Nïve (grde-school) lgorithm: b n-1 b n-2 b 0 Write,b in binry Compute n intermedite products Do n dditions Totl work: Θ(n 2 ) n bits n bits n bits 2n bit output
21 Multiplying lrge integers Divide nd Conquer (Attempt #1): Write = A 1 2 n /2 + A 0 b = B 1 2 n /2 + B 0 We wnt b = A 1 B 1 2 n + (A 1 B 0 + B 1 A 0 ) 2 n /2 + A 0 B 0 Multiply n/2 bit integers recursively T(n) = 4T(n/2) + Θ(n) Als! this is still Θ(n 2 ) (Mster Theorem, Cse 1)
22 Multiplying lrge integers Divide nd Conquer (Attempt #1): Write = A 1 2 n /2 + A 0 b = B 1 2 n /2 + B 0 We wnt b = A 1 B 1 2 n + (A 1 B 0 + B 1 A 0 ) 2 n /2 + A 0 B 0 Multiply Krtsub s n/2 ide: bit integers recursively T(n) (A 0 +A= 1 4T(n/2) ) (B 0 + B+ 1 ) Θ(n) = A 0 B 0 + A 1 B 1 + (A 0 B 1 + B 1 A 0 ) Als! We cn this get is wy still Θ(n with 2 ) 3. multiplictions! (in yellow) (Exercise: write out the recursion tree.) x = A 1 B 1 y = A 0 B 0 z = (A 0 +A 1 )(B 0 +B 1 ) Now we use b = A 1 B 1 2 n + (A 1 B 0 + B 1 A 0 ) 2 n /2 + A 0 B 0 = x 2 n + (z x y) 2 n /2 + y
23 Multiplying lrge integers MULTIPLY (n,, b) B nd b re n-bit integers B Assume n is power of 2 for simplicity 1. If n 2 then use grde-school lgorithm else 2. A 1 à div 2 n /2 ; B 1 à b div 2 n /2 ; 3. A 0 à mod 2 n /2 ; B 0 à b mod 2 n /2. 4. x à MULTIPLY(n/2, A 1, B 1 ) 5. y à MULTIPLY(n/2, A 0, B 0 ) 6. z à MULTIPLY(n/2, A 1 +A 0, B 1 +B 0 ) 7. Output x 2 n + (z x y)2 n /2 + y
24 Multiplying lrge integers The resulting recurrence T(n) = 3T(n/2) + Θ(n) Mster Theorem, Cse 1: T(n) = Θ (n log 23 ) = Θ(n 1.59 ) Note: There is Θ(n log n) lgorithm for multipliction (more on it lter in the course).
Data 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 informationData Structures and Algorithms CMPSC 465
Data Structures and Algorithms CMPSC 465 LECTURE 9 Solving recurrences Substitution method Adam Smith S. Raskhodnikova and A. Smith; based on slides by E. Demaine and C. Leiserson Review question Draw
More informationThe graphs of Rational Functions
Lecture 4 5A: The its of Rtionl Functions s x nd s x + The grphs of Rtionl Functions The grphs of rtionl functions hve severl differences compred to power functions. One of the differences is the behvior
More informationAlgorithm Design and Analysis
Algorithm Design and Analysis LECTURE 9 Divide and Conquer Merge sort Counting Inversions Binary Search Exponentiation Solving Recurrences Recursion Tree Method Master Theorem Sofya Raskhodnikova S. Raskhodnikova;
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 informationA recursive construction of efficiently decodable list-disjunct matrices
CSE 709: Compressed Sensing nd Group Testing. Prt I Lecturers: Hung Q. Ngo nd Atri Rudr SUNY t Bufflo, Fll 2011 Lst updte: October 13, 2011 A recursive construction of efficiently decodble list-disjunct
More informationp-adic Egyptian Fractions
p-adic Egyptin Frctions Contents 1 Introduction 1 2 Trditionl Egyptin Frctions nd Greedy Algorithm 2 3 Set-up 3 4 p-greedy Algorithm 5 5 p-egyptin Trditionl 10 6 Conclusion 1 Introduction An Egyptin frction
More informationModule 9: Tries and String Matching
Module 9: Tries nd String Mtching CS 240 - Dt Structures nd Dt Mngement Sjed Hque Veronik Irvine Tylor Smith Bsed on lecture notes by mny previous cs240 instructors Dvid R. Cheriton School of Computer
More informationModule 9: Tries and String Matching
Module 9: Tries nd String Mtching CS 240 - Dt Structures nd Dt Mngement Sjed Hque Veronik Irvine Tylor Smith Bsed on lecture notes by mny previous cs240 instructors Dvid R. Cheriton School of Computer
More informationSimilar idea to multiplication in N, C. Divide and conquer approach provides unexpected improvements. Naïve matrix multiplication
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
More informationChapter 1: Fundamentals
Chpter 1: Fundmentls 1.1 Rel Numbers Types of Rel Numbers: Nturl Numbers: {1, 2, 3,...}; These re the counting numbers. Integers: {... 3, 2, 1, 0, 1, 2, 3,...}; These re ll the nturl numbers, their negtives,
More information8 Laplace s Method and Local Limit Theorems
8 Lplce s Method nd Locl Limit Theorems 8. Fourier Anlysis in Higher DImensions Most of the theorems of Fourier nlysis tht we hve proved hve nturl generliztions to higher dimensions, nd these cn be proved
More informationIntroduction to Group Theory
Introduction to Group Theory Let G be n rbitrry set of elements, typiclly denoted s, b, c,, tht is, let G = {, b, c, }. A binry opertion in G is rule tht ssocites with ech ordered pir (,b) of elements
More informationCS 4407 Algorithms Lecture 3: Iterative and Divide and Conquer Algorithms
CS 4407 Algorithms Lecture 3: Iterative and Divide and Conquer Algorithms Prof. Gregory Provan Department of Computer Science University College Cork 1 Lecture Outline CS 4407, Algorithms Growth Functions
More informationCSE 521: Design and Analysis of Algorithms I
CSE 521: Design nd Anlysis of Algorithms I Divide nd Conquer Pul Beme 1 Algorithm Design Techniques Divide & Conquer Reduce prolem to one or more su-prolems of the sme type Typiclly, ech su-prolem is t
More information(e) if x = y + z and a divides any two of the integers x, y, or z, then a divides the remaining integer
Divisibility In this note we introduce the notion of divisibility for two integers nd b then we discuss the division lgorithm. First we give forml definition nd note some properties of the division opertion.
More informationLecture 20: Numerical Integration III
cs4: introduction to numericl nlysis /8/0 Lecture 0: Numericl Integrtion III Instructor: Professor Amos Ron Scribes: Mrk Cowlishw, Yunpeng Li, Nthnel Fillmore For the lst few lectures we hve discussed
More informationEuler, Ioachimescu and the trapezium rule. G.J.O. Jameson (Math. Gazette 96 (2012), )
Euler, Iochimescu nd the trpezium rule G.J.O. Jmeson (Mth. Gzette 96 (0), 36 4) The following results were estblished in recent Gzette rticle [, Theorems, 3, 4]. Given > 0 nd 0 < s
More information1.2. Linear Variable Coefficient Equations. y + b "! = a y + b " Remark: The case b = 0 and a non-constant can be solved with the same idea as above.
1 12 Liner Vrible Coefficient Equtions Section Objective(s): Review: Constnt Coefficient Equtions Solving Vrible Coefficient Equtions The Integrting Fctor Method The Bernoulli Eqution 121 Review: Constnt
More information4 7x =250; 5 3x =500; Read section 3.3, 3.4 Announcements: Bell Ringer: Use your calculator to solve
Dte: 3/14/13 Objective: SWBAT pply properties of exponentil functions nd will pply properties of rithms. Bell Ringer: Use your clcultor to solve 4 7x =250; 5 3x =500; HW Requests: Properties of Log Equtions
More informationMath 4310 Solutions to homework 1 Due 9/1/16
Mth 4310 Solutions to homework 1 Due 9/1/16 1. Use the Eucliden lgorithm to find the following gretest common divisors. () gcd(252, 180) = 36 (b) gcd(513, 187) = 1 (c) gcd(7684, 4148) = 68 252 = 180 1
More informationThe Regulated and Riemann Integrals
Chpter 1 The Regulted nd Riemnn Integrls 1.1 Introduction We will consider severl different pproches to defining the definite integrl f(x) dx of function f(x). These definitions will ll ssign the sme vlue
More informationWhat we have learned What is algorithm Why study algorithm The time and space efficiency of algorithm The analysis framework of time efficiency Asympt
Lecture 3 The Analysis of Recursive Algorithm Efficiency What we have learned What is algorithm Why study algorithm The time and space efficiency of algorithm The analysis framework of time efficiency
More informationSUMMER KNOWHOW STUDY AND LEARNING CENTRE
SUMMER KNOWHOW STUDY AND LEARNING CENTRE Indices & Logrithms 2 Contents Indices.2 Frctionl Indices.4 Logrithms 6 Exponentil equtions. Simplifying Surds 13 Opertions on Surds..16 Scientific Nottion..18
More information5.2 Exponent Properties Involving Quotients
5. Eponent Properties Involving Quotients Lerning Objectives Use the quotient of powers property. Use the power of quotient property. Simplify epressions involving quotient properties of eponents. Use
More informationNumerical Analysis: Trapezoidal and Simpson s Rule
nd Simpson s Mthemticl question we re interested in numericlly nswering How to we evlute I = f (x) dx? Clculus tells us tht if F(x) is the ntiderivtive of function f (x) on the intervl [, b], then I =
More informationMath 31S. Rumbos Fall Solutions to Assignment #16
Mth 31S. Rumbos Fll 2016 1 Solutions to Assignment #16 1. Logistic Growth 1. Suppose tht the growth of certin niml popultion is governed by the differentil eqution 1000 dn N dt = 100 N, (1) where N(t)
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 informationCS 4407 Algorithms Lecture 2: Iterative and Divide and Conquer Algorithms
CS 4407 Algorithms Lecture 2: Iterative and Divide and Conquer Algorithms Prof. Gregory Provan Department of Computer Science University College Cork 1 Lecture Outline CS 4407, Algorithms Growth Functions
More informationRead section 3.3, 3.4 Announcements:
Dte: 3/1/13 Objective: SWBAT pply properties of exponentil functions nd will pply properties of rithms. Bell Ringer: 1. f x = 3x 6, find the inverse, f 1 x., Using your grphing clcultor, Grph 1. f x,f
More informationConnected-components. Summary of lecture 9. Algorithms and Data Structures Disjoint sets. Example: connected components in graphs
Prm University, Mth. Deprtment Summry of lecture 9 Algorithms nd Dt Structures Disjoint sets Summry of this lecture: (CLR.1-3) Dt Structures for Disjoint sets: Union opertion Find opertion Mrco Pellegrini
More informationMath& 152 Section Integration by Parts
Mth& 5 Section 7. - Integrtion by Prts Integrtion by prts is rule tht trnsforms the integrl of the product of two functions into other (idelly simpler) integrls. Recll from Clculus I tht given two differentible
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 informationChapter 2. Recurrence Relations. Divide and Conquer. Divide and Conquer Strategy. Another Example: Merge Sort. Merge Sort Example. Merge Sort Example
Recurrence Relations Chapter 2 Divide and Conquer Equation or an inequality that describes a function by its values on smaller inputs. Recurrence relations arise when we analyze the running time of iterative
More informationset is not closed under matrix [ multiplication, ] and does not form a group.
Prolem 2.3: Which of the following collections of 2 2 mtrices with rel entries form groups under [ mtrix ] multipliction? i) Those of the form for which c d 2 Answer: The set of such mtrices is not closed
More informationInfinite Geometric Series
Infinite Geometric Series Finite Geometric Series ( finite SUM) Let 0 < r < 1, nd let n be positive integer. Consider the finite sum It turns out there is simple lgebric expression tht is equivlent to
More informationNUMERICAL INTEGRATION
NUMERICAL INTEGRATION How do we evlute I = f (x) dx By the fundmentl theorem of clculus, if F (x) is n ntiderivtive of f (x), then I = f (x) dx = F (x) b = F (b) F () However, in prctice most integrls
More informationLecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations.
Lecture 3 3 Solving liner equtions In this lecture we will discuss lgorithms for solving systems of liner equtions Multiplictive identity Let us restrict ourselves to considering squre mtrices since one
More informationMath 113 Exam 2 Practice
Mth Em Prctice Februry, 8 Em will cover sections 6.5, 7.-7.5 nd 7.8. This sheet hs three sections. The first section will remind you bout techniques nd formuls tht you should know. The second gives number
More informationFinite Field Arithmetic and Implementations. Xinmiao Zhang Case Western Reserve University
Finite Field Arithmetic nd Implementtions Xinmio Zhng Cse Western Reserve University Applictions of Finite Field Arithmetic Error-correcting codes Hmming codes BCH codes Reed-Solomon codes Low-density
More informationMath 360: A primitive integral and elementary functions
Mth 360: A primitive integrl nd elementry functions D. DeTurck University of Pennsylvni October 16, 2017 D. DeTurck Mth 360 001 2017C: Integrl/functions 1 / 32 Setup for the integrl prtitions Definition:
More informationCS/COE 1501 cs.pitt.edu/~bill/1501/ Integer Multiplication
CS/COE 1501 cs.pitt.edu/~bill/1501/ Integer Multiplication Integer multiplication Say we have 5 baskets with 8 apples in each How do we determine how many apples we have? Count them all? That would take
More informationNatural examples of rings are the ring of integers, a ring of polynomials in one variable, the ring
More generlly, we define ring to be non-empty set R hving two binry opertions (we ll think of these s ddition nd multipliction) which is n Abelin group under + (we ll denote the dditive identity by 0),
More information1 The Riemann Integral
The Riemnn Integrl. An exmple leding to the notion of integrl (res) We know how to find (i.e. define) the re of rectngle (bse height), tringle ( (sum of res of tringles). But how do we find/define n re
More informationModule 6: LINEAR TRANSFORMATIONS
Module 6: LINEAR TRANSFORMATIONS. Trnsformtions nd mtrices Trnsformtions re generliztions of functions. A vector x in some set S n is mpped into m nother vector y T( x). A trnsformtion is liner if, for
More informationChapter 3 Solving Nonlinear Equations
Chpter 3 Solving Nonliner Equtions 3.1 Introduction The nonliner function of unknown vrible x is in the form of where n could be non-integer. Root is the numericl vlue of x tht stisfies f ( x) 0. Grphiclly,
More informationWhen a force f(t) is applied to a mass in a system, we recall that Newton s law says that. f(t) = ma = m d dt v,
Impulse Functions In mny ppliction problems, n externl force f(t) is pplied over very short period of time. For exmple, if mss in spring nd dshpot system is struck by hmmer, the ppliction of the force
More informationMatrix Eigenvalues and Eigenvectors September 13, 2017
Mtri Eigenvlues nd Eigenvectors September, 7 Mtri Eigenvlues nd Eigenvectors Lrry Cretto Mechnicl Engineering 5A Seminr in Engineering Anlysis September, 7 Outline Review lst lecture Definition of eigenvlues
More information1 Probability Density Functions
Lis Yn CS 9 Continuous Distributions Lecture Notes #9 July 6, 28 Bsed on chpter by Chris Piech So fr, ll rndom vribles we hve seen hve been discrete. In ll the cses we hve seen in CS 9, this ment tht our
More information13: Diffusion in 2 Energy Groups
3: Diffusion in Energy Groups B. Rouben McMster University Course EP 4D3/6D3 Nucler Rector Anlysis (Rector Physics) 5 Sept.-Dec. 5 September Contents We study the diffusion eqution in two energy groups
More information63. Representation of functions as power series Consider a power series. ( 1) n x 2n for all 1 < x < 1
3 9. SEQUENCES AND SERIES 63. Representtion of functions s power series Consider power series x 2 + x 4 x 6 + x 8 + = ( ) n x 2n It is geometric series with q = x 2 nd therefore it converges for ll q =
More information20 MATHEMATICS POLYNOMIALS
0 MATHEMATICS POLYNOMIALS.1 Introduction In Clss IX, you hve studied polynomils in one vrible nd their degrees. Recll tht if p(x) is polynomil in x, the highest power of x in p(x) is clled the degree of
More informationMath 8 Winter 2015 Applications of Integration
Mth 8 Winter 205 Applictions of Integrtion Here re few importnt pplictions of integrtion. The pplictions you my see on n exm in this course include only the Net Chnge Theorem (which is relly just the Fundmentl
More informationFirst Midterm Examination
24-25 Fll Semester First Midterm Exmintion ) Give the stte digrm of DFA tht recognizes the lnguge A over lphet Σ = {, } where A = {w w contins or } 2) The following DFA recognizes the lnguge B over lphet
More information( dg. ) 2 dt. + dt. dt j + dh. + dt. r(t) dt. Comparing this equation with the one listed above for the length of see that
Arc Length of Curves in Three Dimensionl Spce If the vector function r(t) f(t) i + g(t) j + h(t) k trces out the curve C s t vries, we cn mesure distnces long C using formul nerly identicl to one tht we
More information38 Riemann sums and existence of the definite integral.
38 Riemnn sums nd existence of the definite integrl. In the clcultion of the re of the region X bounded by the grph of g(x) = x 2, the x-xis nd 0 x b, two sums ppered: ( n (k 1) 2) b 3 n 3 re(x) ( n These
More informationNondeterminism and Nodeterministic Automata
Nondeterminism nd Nodeterministic Automt 61 Nondeterminism nd Nondeterministic Automt The computtionl mchine models tht we lerned in the clss re deterministic in the sense tht the next move is uniquely
More informationCMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!)
CMSC 330: Orgniztion of Progrmming Lnguges DFAs, nd NFAs, nd Regexps (Oh my!) CMSC330 Spring 2018 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All
More informationVyacheslav Telnin. Search for New Numbers.
Vycheslv Telnin Serch for New Numbers. 1 CHAPTER I 2 I.1 Introduction. In 1984, in the first issue for tht yer of the Science nd Life mgzine, I red the rticle "Non-Stndrd Anlysis" by V. Uspensky, in which
More informationfractions Let s Learn to
5 simple lgebric frctions corne lens pupil retin Norml vision light focused on the retin concve lens Shortsightedness (myopi) light focused in front of the retin Corrected myopi light focused on the retin
More informationFaster Regular Expression Matching. Philip Bille Mikkel Thorup
Fster Regulr Expression Mtching Philip Bille Mikkel Thorup Outline Definition Applictions History tour of regulr expression mtching Thompson s lgorithm Myers lgorithm New lgorithm Results nd extensions
More informationUniversitaireWiskundeCompetitie. Problem 2005/4-A We have k=1. Show that for every q Q satisfying 0 < q < 1, there exists a finite subset K N so that
Problemen/UWC NAW 5/7 nr juni 006 47 Problemen/UWC UniversitireWiskundeCompetitie Edition 005/4 For Session 005/4 we received submissions from Peter Vndendriessche, Vldislv Frnk, Arne Smeets, Jn vn de
More informationPre-Session Review. Part 1: Basic Algebra; Linear Functions and Graphs
Pre-Session Review Prt 1: Bsic Algebr; Liner Functions nd Grphs A. Generl Review nd Introduction to Algebr Hierrchy of Arithmetic Opertions Opertions in ny expression re performed in the following order:
More informationIntegration Techniques
Integrtion Techniques. Integrtion of Trigonometric Functions Exmple. Evlute cos x. Recll tht cos x = cos x. Hence, cos x Exmple. Evlute = ( + cos x) = (x + sin x) + C = x + 4 sin x + C. cos 3 x. Let u
More informationHandout: Natural deduction for first order logic
MATH 457 Introduction to Mthemticl Logic Spring 2016 Dr Json Rute Hndout: Nturl deduction for first order logic We will extend our nturl deduction rules for sententil logic to first order logic These notes
More informationDesign and Analysis of Algorithms Recurrence. Prof. Chuhua Xian School of Computer Science and Engineering
Design and Analysis of Algorithms Recurrence Prof. Chuhua Xian Email: chhxian@scut.edu.cn School of Computer Science and Engineering Course Information Instructor: Chuhua Xian ( 冼楚华 ) Email: chhxian@scut.edu.cn
More informationad = cb (1) cf = ed (2) adf = cbf (3) cf b = edb (4)
10 Most proofs re left s reding exercises. Definition 10.1. Z = Z {0}. Definition 10.2. Let be the binry reltion defined on Z Z by, b c, d iff d = cb. Theorem 10.3. is n equivlence reltion on Z Z. Proof.
More informationTheoretical foundations of Gaussian quadrature
Theoreticl foundtions of Gussin qudrture 1 Inner product vector spce Definition 1. A vector spce (or liner spce) is set V = {u, v, w,...} in which the following two opertions re defined: (A) Addition of
More informationComputing the Optimal Global Alignment Value. B = n. Score of = 1 Score of = a a c g a c g a. A = n. Classical Dynamic Programming: O(n )
Alignment Grph Alignment Mtrix Computing the Optiml Globl Alignment Vlue An Introduction to Bioinformtics Algorithms A = n c t 2 3 c c 4 g 5 g 6 7 8 9 B = n 0 c g c g 2 3 4 5 6 7 8 t 9 0 2 3 4 5 6 7 8
More informationAP Calculus Multiple Choice: BC Edition Solutions
AP Clculus Multiple Choice: BC Edition Solutions J. Slon Mrch 8, 04 ) 0 dx ( x) is A) B) C) D) E) Divergent This function inside the integrl hs verticl symptotes t x =, nd the integrl bounds contin this
More informationMath 1B, lecture 4: Error bounds for numerical methods
Mth B, lecture 4: Error bounds for numericl methods Nthn Pflueger 4 September 0 Introduction The five numericl methods descried in the previous lecture ll operte by the sme principle: they pproximte the
More information7 - Continuous random variables
7-1 Continuous rndom vribles S. Lll, Stnford 2011.01.25.01 7 - Continuous rndom vribles Continuous rndom vribles The cumultive distribution function The uniform rndom vrible Gussin rndom vribles The Gussin
More informationExponentials - Grade 10 [CAPS] *
OpenStx-CNX module: m859 Exponentils - Grde 0 [CAPS] * Free High School Science Texts Project Bsed on Exponentils by Rory Adms Free High School Science Texts Project Mrk Horner Hether Willims This work
More informationWhere did dynamic programming come from?
Where did dynmic progrmming come from? String lgorithms Dvid Kuchk cs302 Spring 2012 Richrd ellmn On the irth of Dynmic Progrmming Sturt Dreyfus http://www.eng.tu.c.il/~mi/cd/ or50/1526-5463-2002-50-01-0048.pdf
More informationAbsolute values of real numbers. Rational Numbers vs Real Numbers. 1. Definition. Absolute value α of a real
Rtionl Numbers vs Rel Numbers 1. Wht is? Answer. is rel number such tht ( ) =. R [ ( ) = ].. Prove tht (i) 1; (ii). Proof. (i) For ny rel numbers x, y, we hve x = y. This is necessry condition, but not
More informationBest Approximation. Chapter The General Case
Chpter 4 Best Approximtion 4.1 The Generl Cse In the previous chpter, we hve seen how n interpolting polynomil cn be used s n pproximtion to given function. We now wnt to find the best pproximtion to given
More informationSection 7.1 Integration by Substitution
Section 7. Integrtion by Substitution Evlute ech of the following integrls. Keep in mind tht using substitution my not work on some problems. For one of the definite integrls, it is not possible to find
More informationCS683: calculating the effective resistances
CS683: clculting the effective resistnces Lecturer: John Hopcroft Note tkers: June Andrews nd Jen-Bptiste Jennin Mrch 7th, 2008 On Ferury 29th we sw tht, given grph in which ech edge is lelled with resistnce
More informationThe area under the graph of f and above the x-axis between a and b is denoted by. f(x) dx. π O
1 Section 5. The Definite Integrl Suppose tht function f is continuous nd positive over n intervl [, ]. y = f(x) x The re under the grph of f nd ove the x-xis etween nd is denoted y f(x) dx nd clled the
More informationMatrix Solution to Linear Equations and Markov Chains
Trding Systems nd Methods, Fifth Edition By Perry J. Kufmn Copyright 2005, 2013 by Perry J. Kufmn APPENDIX 2 Mtrix Solution to Liner Equtions nd Mrkov Chins DIRECT SOLUTION AND CONVERGENCE METHOD Before
More informationODE: Existence and Uniqueness of a Solution
Mth 22 Fll 213 Jerry Kzdn ODE: Existence nd Uniqueness of Solution The Fundmentl Theorem of Clculus tells us how to solve the ordinry differentil eqution (ODE) du = f(t) dt with initil condition u() =
More informationIntegrals - Motivation
Integrls - Motivtion When we looked t function s rte of chnge If f(x) is liner, the nswer is esy slope If f(x) is non-liner, we hd to work hrd limits derivtive A relted question is the re under f(x) (but
More informationFarey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University
U.U.D.M. Project Report 07:4 Frey Frctions Rickrd Fernström Exmensrete i mtemtik, 5 hp Hledre: Andres Strömergsson Exmintor: Jörgen Östensson Juni 07 Deprtment of Mthemtics Uppsl University Frey Frctions
More informationMatrices, Moments and Quadrature, cont d
Jim Lmbers MAT 285 Summer Session 2015-16 Lecture 2 Notes Mtrices, Moments nd Qudrture, cont d We hve described how Jcobi mtrices cn be used to compute nodes nd weights for Gussin qudrture rules for generl
More informationFingerprint idea. Assume:
Fingerprint ide Assume: We cn compute fingerprint f(p) of P in O(m) time. If f(p) f(t[s.. s+m 1]), then P T[s.. s+m 1] We cn compre fingerprints in O(1) We cn compute f = f(t[s+1.. s+m]) from f(t[s.. s+m
More informationMath 130 Midterm Review
Mth 130 Midterm Review April 6, 2013 1 Topic Outline: The following outline contins ll of the mjor topics tht you will need to know for the exm. Any topic tht we ve discussed in clss so fr my pper on the
More information4181H Problem Set 11 Selected Solutions. Chapter 19. n(log x) n 1 1 x x dx,
48H Problem Set Selected Solutions Chpter 9 # () Tke f(x) = x n, g (x) = e x, nd use integrtion by prts; this gives reduction formul: x n e x dx = x n e x n x n e x dx. (b) Tke f(x) = (log x) n, g (x)
More information4.4 Areas, Integrals and Antiderivatives
. res, integrls nd ntiderivtives 333. Ares, Integrls nd Antiderivtives This section explores properties of functions defined s res nd exmines some connections mong res, integrls nd ntiderivtives. In order
More informationLecture 7 notes Nodal Analysis
Lecture 7 notes Nodl Anlysis Generl Network Anlysis In mny cses you hve multiple unknowns in circuit, sy the voltges cross multiple resistors. Network nlysis is systemtic wy to generte multiple equtions
More information6.004 Computation Structures Spring 2009
MIT OpenCourseWre http://ocw.mit.edu 6.004 Computtion Structures Spring 009 For informtion out citing these mterils or our Terms of Use, visit: http://ocw.mit.edu/terms. Cost/Performnce Trdeoffs: cse study
More informationMIXED MODELS (Sections ) I) In the unrestricted model, interactions are treated as in the random effects model:
1 2 MIXED MODELS (Sections 17.7 17.8) Exmple: Suppose tht in the fiber breking strength exmple, the four mchines used were the only ones of interest, but the interest ws over wide rnge of opertors, nd
More informationDivide and Conquer. Andreas Klappenecker
Divide and Conquer Andreas Klappenecker The Divide and Conquer Paradigm The divide and conquer paradigm is important general technique for designing algorithms. In general, it follows the steps: - divide
More informationCMSC 330: Organization of Programming Languages
CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 CMSC 330 1 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All exmples so fr Nondeterministic
More informationLecture Note 9: Orthogonal Reduction
MATH : Computtionl Methods of Liner Algebr 1 The Row Echelon Form Lecture Note 9: Orthogonl Reduction Our trget is to solve the norml eution: Xinyi Zeng Deprtment of Mthemticl Sciences, UTEP A t Ax = A
More informationData Structures and Algorithms CSE 465
Data Structures and Algorithms CSE 465 LECTURE 3 Asymptotic Notation O-, Ω-, Θ-, o-, ω-notation Divide and Conquer Merge Sort Binary Search Sofya Raskhodnikova and Adam Smith /5/0 Review Questions If input
More informationAQA Further Pure 1. Complex Numbers. Section 1: Introduction to Complex Numbers. The number system
Complex Numbers Section 1: Introduction to Complex Numbers Notes nd Exmples These notes contin subsections on The number system Adding nd subtrcting complex numbers Multiplying complex numbers Complex
More informationLecture 17. Integration: Gauss Quadrature. David Semeraro. University of Illinois at Urbana-Champaign. March 20, 2014
Lecture 17 Integrtion: Guss Qudrture Dvid Semerro University of Illinois t Urbn-Chmpign Mrch 0, 014 Dvid Semerro (NCSA) CS 57 Mrch 0, 014 1 / 9 Tody: Objectives identify the most widely used qudrture method
More informationECON 331 Lecture Notes: Ch 4 and Ch 5
Mtrix Algebr ECON 33 Lecture Notes: Ch 4 nd Ch 5. Gives us shorthnd wy of writing lrge system of equtions.. Allows us to test for the existnce of solutions to simultneous systems. 3. Allows us to solve
More informationLecture 14: Quadrature
Lecture 14: Qudrture This lecture is concerned with the evlution of integrls fx)dx 1) over finite intervl [, b] The integrnd fx) is ssumed to be rel-vlues nd smooth The pproximtion of n integrl by numericl
More informationMultiplying integers EXERCISE 2B INDIVIDUAL PATHWAYS. -6 ì 4 = -6 ì 0 = 4 ì 0 = -6 ì 3 = -5 ì -3 = 4 ì 3 = 4 ì 2 = 4 ì 1 = -5 ì -2 = -6 ì 2 = -6 ì 1 =
EXERCISE B INDIVIDUAL PATHWAYS Activity -B- Integer multipliction doc-69 Activity -B- More integer multipliction doc-698 Activity -B- Advnced integer multipliction doc-699 Multiplying integers FLUENCY
More information