CSE 521: Design and Analysis of Algorithms I

Size: px
Start display at page:

Download "CSE 521: Design and Analysis of Algorithms I"

Transcription

1 CSE 521: Design nd Anlysis of Algorithms I Divide nd Conquer Pul Beme 1

2 Algorithm Design Techniques Divide & Conquer Reduce prolem to one or more su-prolems of the sme type Typiclly, ech su-prolem is t most constnt frction of the size of the originl prolem e.g. Mergesort, Binry Serch, Strssen s Algorithm, Quicksort (kind of) 2

3 Fst exponentition Power(,n) Input: integer n nd numer Output: n Ovious lgorithm n-1 multiplictions Oservtion: if n is even, n=2m, then n = m m 3

4 Divide & Conquer Algorithm Power(,n) if n=0 then return(1) else if n=1 then return() else x Power(, n/2 ) if n is even then return(x x) else return( x x) 4

5 Anlysis Worst-cse recurrence T(n)=T( n/2 )2 for n 1 T(1)=0 Time T(n)=T( n/2 )2 T( n/4 )22 T(1)2 2 = 2 log 2 n More precise nlysis: log 2 n copies T(n)= log 2 n # of 1 s in n s inry representtion 5

6 A Prcticl Appliction- RSA Insted of n wnt n mod N ij mod N = (( i mod N) ( j mod N)) mod N sme lgorithm pplies with ech x y replced y ((x mod N) (y mod N)) mod N In RSA cryptosystem need n mod N where, n, N ech typiclly hve 1024 its Power: t most 2048 multiplies of 1024 it numers reltively esy for modern mchines Nive lgorithm: multiplies 6

7 Binry serch for roots (isection method) Given: continuous function f nd two points < with f() 0 nd f() > 0 Find: pproximtion to c s.t. f(c)=0 nd <c< 7

8 Bisection method Bisection(,, ε) if (-) < ε then return() else c ()/2 if f(c) 0 then return(bisection(c,,ε)) else return(bisection(,c,ε)) 8

9 Time Anlysis At ech step we hlved the size of the intervl It strted t size - It ended t size ε # of clls to f is log 2 ( (-)/ε) 9

10 Old fvorites Binry serch One suprolem of hlf size plus one comprison Recurrence T(n) = T( n/2 )1 for n 2 T(1) = 0 So T(n) is log 2 n 1 Mergesort Two suprolems of hlf size plus merge cost of n-1 comprisons Recurrence T(n) 2T( n/2 )n-1 for n 2 T(1) = 0 Roughly n comprisons t ech of log 2 n levels of recursion So T(n) is roughly 2n log 2 n 10

11 Eucliden Closest Pir Given set P of n points p 1,,p n with relvlued coordintes Find the pir of points p i,p j P such tht the Eucliden distnce d(p i,p j ) is minimized Θ(n 2 ) possile pirs In one dimension there is n esy O(n log n) lgorithm Sort the points Compre consecutive elements in the sorted list Wht out points in the plne? 11

12 Closest Pir in the Plne No single direction long which one cn sort points to gurntee success! 12

13 Closest Pir In the Plne: Divide nd Conquer Sort the points y their x coordintes Split the points into two sets of n/2 points L nd R y x coordinte Recursively compute closest pir of points in L, (p L,q L ) closest pir of points in R, (p R,q R ) Let δ=min{d(p L,q L ),d(p R,q R )} nd let (p,q) e the pir of points tht hs distnce δ This my not e enough! Closest pir of points my involve one point from L nd the other from R! 13

14 A clever geometric ide L R Any pir of points p L nd q R with d(p,q)<δ must lie in nd δ δ 14

15 A clever geometric ide L R Any pir of points p L nd q R with d(p,q)<δ must lie in nd δ/2 No two points cn e in the sme green ox δ/ 2 δ δ 15

16 A clever geometric ide L R Any pir of points p L nd q R with d(p,q)<δ must lie in nd δ/2 No two points cn e in the sme green ox δ δ Only need to check pirs of points up to 2 rows prt - constnt # of other points! 16

17 Closest Pir Recomining Sort points y y coordinte hed of time On recomintion only compre ech point in L R to the 12 points ove it in the y sorted order If ny of those distnces is etter thn δ replce (p,q) y the est of those pirs O(n log n) for x nd y sorting t strt Two recursive clls on prolems on hlf size O(n) recomintion Totl O(n log n) 17

18 Sometimes two su-prolems ren t enough More generl divide nd conquer You ve roken the prolem into different su-prolems Ech hs size t most n/ The cost of the rek-up nd recomining the su-prolem solutions is O(n k ) Recurrence T(n) T(n/)c n k 18

19 Mster Divide nd Conquer Recurrence If T(n) T(n/)c n k for n> then if > k log then T(n) is Θ(n ) if < k then T(n) is Θ(n k ) if = k then T(n) is Θ(n k log n) Works even if it is n/ insted of n/. 19

20 Proving Mster recurrence Prolem size n T(n)=T(n/)cn k # pros 1 n/ n/ T(1)=c d 20

21 Proving Mster recurrence Prolem size n T(n)= T(n/)c n k # pros 1 n/ n/ T(1)=c d 21

22 Proving Mster recurrence Prolem size n T(n)= T(n/)c n k # pros 1 cost cn k n/ c n k / k n/ 2 2 c 2 n k / 2k =c n k (/ k ) 2 1 T(1)=c d c n k (/ k ) d =c d 22

23 Geometric Series S = t tr tr 2... tr n-1 r S = tr tr 2... tr n-1 tr n (r-1)s =tr n - t so S=t (r n -1)/(r-1) if r 1. Simple rule If r 1 then S is constnt times lrgest term in series 23

24 Totl Cost Geometric series rtio / k d1=log n 1 terms first term cn k, lst term c d If / k =1 ll terms re equl T(n) is Θ(n k log n) If / k <1 first term is lrgest T(n) is Θ(n k ) If / k >1 lst term is lrgest T(n) is Θ( d )=Θ( (To see this tke log of oth sides) log n log ) ) =Θ(n 24

25 25 Multiplying Mtrices n 3 multiplictions, n 3 -n 2 dditions = o o o o

26 Multiplying Mtrices for i=1 to n for j=1 to n C[i,j] 0 for k=1 to n C[i,j]=C[i,j]A[i,k] B[k,j] endfor endfor endfor 26

27 27 Multiplying Mtrices = o o o o

28 28 Multiplying Mtrices = o o o o

29 Multiplying Mtrices 11 = A A A A B B B B A B A B A B A B o o o o A B A B A 21 B 12 A 22 B

30 Simple Divide nd Conquer A 11 A 12 B 11 B 12 A 21 A 22 B 21 B 22 = A 11 B 11 A 12 B 21 A 11 B 12 A 12 B 22 A 21 B 11 A 22 B 21 A 21 B 12 A 22 B 22 T(n)=8T(n/2)4(n/2) 2 =8T(n/2)n 2 8>2 2 so T(n) is Θ Θ Θ log log28 3 ( n ) = ( n ) = ( n ) 30

31 Strssen s Divide nd Conquer Algorithm Strssen s lgorithm Multiply 2x2 mtrices using 7 insted of 8 multiplictions (nd lots more thn 4 dditions) T(n)=7 T(n/2)cn 2 log 2 7 7>2 2 so T(n) is Θ(n ) which is O(n 2.81 ) Fstest lgorithms theoreticlly use O(n ) time not prcticl ut Strssen s is prcticl provided clcultions re exct nd we stop recursion when mtrix hs size out 32 nd use ordinry multipliction for suprolems 31

32 The lgorithm P 1 A 12 (B 11 B 21 ); P 2 A 21 (B 12 B 22 ) P 3 (A 11 - A 12 )B 11 ; P 4 (A 22 - A 21 )B 22 P 5 (A 22 - A 12 )(B 21 - B 22 ) P 6 (A 11 - A 21 )(B 12 - B 11 ) P 7 (A 21 - A 12 )(B 11 B 22 ) C 11 P 1 P 3 ; C 12 P 2 P 3 P 6 - P 7 C 21 P 1 P 4 P 5 P 7 ; C 22 P 2 P 4 32

33 Another Divide &Conquer Exmple: Multiplying Fster If you nlyze our usul elementry school lgorithm for multiplying numers Θ(n 2 ) time On rel mchines ech digit is, e.g., 32 its long ut still get Θ(n 2 ) running time with this lgorithm when run on n-it multipliction We cn do etter! We ll descrie the sic ides y multiplying polynomils rther thn integers Advntge is we don t get confused y worrying out crries 33

34 Polynomil Multipliction Given: Degree n-1 polynomils P nd Q P = 0 1 x 2 x 2 n-2 x n-2 n-1 x n-1 Q = 0 1 x 2 x 2 n-2 x n-2 n-1 x n-1 Compute: Degree 2n-2 Polynomil P Q P Q = 0 0 ( ) x ( ) x 2... ( n-2 n-1 n-1 n-2 ) x 2n-3 n-1 n-1 x 2n-2 Ovious Algorithm: Compute ll i j nd collect terms Θ (n 2 ) time 34

35 Nive Divide nd Conquer Assume n=2k P = ( 0 1 x 2 x 2... k-2 x k-2 k-1 x k-1 ) ( k k1 x n-2 x k-2 n-1 x k-1 ) x k = P 0 P 1 x k where P 0 nd P 1 re degree k-1 polynomils Similrly Q = Q 0 Q 1 x k P Q = (P 0 P 1 x k )(Q 0 Q 1 x k ) = P 0 Q 0 (P 1 Q 0 P 0 Q 1 )x k P 1 Q 1 x 2k 4 su-prolems of size k=n/2 plus liner comining T(n)=4 T(n/2)cn Solution T(n) = Θ(n 2 ) 35

36 Krtsu s Algorithm A etter wy to compute the terms Compute A P 0 Q 0 B P 1 Q 1 C (P 0 P 1 )(Q 0 Q 1 ) = P 0 Q 0 P 1 Q 0 P 0 Q 1 P 1 Q 1 Then P 0 Q 1 P 1 Q 0 = C-A-B So PQ=A(C-A-B)x k Bx 2k 3 su-prolems of size n/2 plus O(n) work T(n) = 3 T(n/2) cn T(n) = O(n α ) where α = log 2 3 =

37 Krtsu: Detils Mid B R 2n-1 n n/2 0 PolyMul(P, Q): // P, Q re length n =2k vectors, with P[i], Q[i] eing // the coefficient of x i in polynomils P, Q respectively. // Let Pzero e elements 0..k-1 of P; Pone e elements k..n-1 // Qzero, Qone : similr If n=1 then Return(P[0]*Q[0]) else A PolyMul(Pzero, Qzero); // result is (2k-1)-vector B PolyMul(Pone, Qone); // ditto Psum Pzero Pone; // dd corresponding elements Qsum Qzero Qone; // ditto C polymul(psum, Qsum); // nother (2k-1)-vector Mid C A B; // sutrct correspond elements R A Shift(Mid, n/2) Shift(B,n) // (2n-1)-vector Return( R); A 37

38 Multipliction Polynomils Nïve: Θ(n 2 ) Krtsu: Θ(n 1.59 ) Best known: Θ(n log n) "Fst Fourier Trnsform FFT widely used for signl processing, especilly s DCT (Discrete Cosine Trnsform) Integers Similr, ut some ugly detils re: crries, etc. due to Schonhge-Strssen in 1971 gives Θ(n log n loglog n), Improvement in 2007 due to Furer gives Θ(n log n 2 log* n ) Used in prctice in symolic mnipultion systems like Mple 38

39 Hints towrds FFT: Interpoltion Given set of vlues t 5 points 39

40 Hints towrds FFT: Interpoltion Given set of vlues t 5 points Cn find unique degree 4 polynomil going through these points 40

41 Multiplying Polynomils y Evlution & Interpoltion Any degree n-1 polynomil R(y) is determined y R(y 0 ),... R(y n-1 ) for ny n distinct y 0,...,y n-1 To compute PQ (ssume degree t most n-1) Evlute P(y 0 ),..., P(y n-1 ) Evlute Q(y 0 ),...,Q(y n-1 ) Multiply vlues P(y i )Q(y i ) for i=0,...,n-1 Interpolte to recover PQ 41

42 Interpoltion Given vlues of degree n-1 polynomil R t n distinct points y 1,,y n R(y 1 ),,R(y n ) Compute coefficients c 0,,c n-1 such tht R(x)=c 0 c 1 xc 2 x 2 c n-1 x n-1 System of liner equtions in c 0,,c n-1 c 0 c 1 y 1 c 2 y 12 c n-1 y n-1 1 =R(y 1 ) c 0 c 1 y 2 c 2 y 22 c n-1 y n-1 2 =R(y 2 ) c 0 c 1 y n c 2 y n2 c n-1 y n-1 n =R(y n ) known unknown 42

43 Interpoltion: n equtions in n unknowns Mtrix form of the liner system 1 y 1 y 12 y n-1 1 c 0 R(y 1 ) 1 y 2 y 22 y n-1 2 c 1 R(y 2 ) c 2 =... 1 y n y n2 y n-1 n c n-1 R(y n ) Fct: Determinnt of the mtrix is Π i<j (y i -y j ) which is not 0 since points re distinct System hs unique solution c 0,,c n-1 43

44 Hints towrds FFT: Evlution & Interpoltion P: 0, 1,..., n-1 Q: 0, 1,..., n-1 evlution t y 0,...,y 2n-1 O(?) ordinry polynomil multipliction Θ(n 2 ) c k i j= k i j R:c 0,c 1,...,c 2n-1 interpoltion from y 0,...,y 2n-1 O(?) P(y 0 ),Q(y 0 ) P(y 1 ),Q(y 1 )... P(y 2n-1 ),Q(y 2n-1 ) point-wise multipliction of numers O(n) R(y 0 ) P(y 0 ) Q(y 0 ) R(y 1 ) P(y 1 ) Q(y 1 )... R(y 2n-1 ) P(y 2n-1 ) Q(y 2n-1 ) 44

45 Krtsu s lgorithm nd evlution nd interpoltion Strssen gve wy of doing 2x2 mtrix multiplies with fewer multiplictions Krtsu s lgorithm cn e thought of s wy of multiplying degree 1 polynomils (which hve 2 coefficients) using fewer multiplictions PQ=(P 0 P 1 z)(q 0 Q 1 z) = P 0 Q 0 (P 1 Q 0 P 0 Q 1 )z P 1 Q 1 z 2 Alterntive Krtsu: evlute t 0,1,-1 (Could lso use other points) A = P(0)Q(0)= P 0 Q 0 C = P(1)Q(1)=(P 0 P 1 )(Q 0 Q 1 ) D = P(-1)Q(-1)=(P 0 -P 1 )(Q 0 -Q 1 ) Interpolting, P 1 Q 0 P 0 Q 1 =(C-D)/2 nd P 1 Q 1 =(CD)/2-A 45

46 Evlution t Specil Points Evlution of polynomil t 1 point tkes O(n) time So 2n points (nively) tkes O(n 2 ) no svings But the lgorithm works no mtter wht the points re So choose points tht re relted to ech other so tht evlution prolems cn shre suprolems 46

47 The key ide: Evlute t relted points P(x) = 0 1 x 2 x 2 3 x 3 4 x 4... n-1 x n-1 = 0 2 x 2 4 x 4... n-2 x n-2 1 x 3 x 3 5 x 5... n-1 x n-1 = P even (x 2 ) x P odd (x 2 ) P(-x)= 0-1 x 2 x 2-3 x 3 4 x n-1 x n-1 = 0 2 x 2 4 x 4... n-2 x n-2 - ( 1 x 3 x 3 5 x 5... n-1 x n-1 ) = P even (x 2 ) - x P odd (x 2 ) where P even (x) = 0 2 x 4 x 2... n-2 x n/2-1 nd P odd (x) = 1 3 x 5 x 2... n-1 x n/2-1 47

48 The key ide: Evlute t relted points So if we hve hlf the points s negtives of the other hlf i.e., y n/2 = -y 0, y n/21 = -y 1,,y n-1 = -y n/2-1 then we cn reduce the size n prolem of evluting degree n-1 polynomil P t n points to evluting 2 degree n/2-1 polynomils P even nd P odd t n/2 points y 02, y n/2-12 nd recomine nswers with O(1) extr work per point But to use this ide recursively we need hlf of y 02, y n/2-12 to e negtives of the other hlf If y n/4 2 = -y 02, sy, then (y n/4 /y 0 ) 2 = -1 Motivtes use of complex numers s evlution points 48

49 Complex Numers i 2 = -1 efi -1 cdi θϕ i ϕ θ i 1 To multiply complex numers: 1. dd ngles 2. multiply lengths (ll length 1 here) efi = (i)(cdi) e 2πi = 1 e π i = -1 -i i =cos θ i sin θ = e iθ cdi =cos ϕ i sin ϕ = e iϕ efi =cos (θϕ) i sin (θϕ) = e i(θϕ θϕ) 49

50 Primitive n th root of 1 /n ω=ω n = e i 2π/n ω 3 ω 2 =i ω Let ω = ω n = ei 2π /n = cos (2π/ π/n) i sin (2π/n) ω 4 =-1 ω 0 =1=ω 8 ω 5 ω 6 = -i ω 7 i 2 = -1 E 2π i = 1 50

51 Fcts out ω=e 2πi /n for even n ω n = 1 ω n/2 = -1 ω n/2k = - ω k for ll vlues of k ω 2 = e 2πi /m where m=n/2 ω k = cos(2kπ/n)i sin(2kπ/n) so cn compute with powers of ω ω k is root of x n -1= (x-1)(x n-1 x n-2 1) =0 ut for k 0, ω k 1 so ω k(n-1) ω k(n-2) 1=0 51

52 Gol: The recursive ide for n power of 2 Evlute P t 1,ω,ω 2,ω 3,...,ω n-1 Now P even nd P odd hve degree n/2-1 where P(ω k )=P even (ω 2k )ω k P odd (ω 2k ) P(-ω k )=P even (ω 2k )-ω k P odd (ω 2k ) Recursive Algorithm Evlute P even t 1,ω 2,ω 4,...,ω n-2 Evlute P odd t 1,ω 2,ω 4,...,ω n-2 Comine to compute P t 1,ω,ω 2,...,ω n/2-1 Comine to compute P t -1,-ω,-ω 2,...,-ω n/2-1 (i.e. t ω n/2, ω n/21, ω n/22,..., ω n-1 ) ω 2 is e 2πi / m where m=n/2 so prolems re of sme type ut smller size 52

53 Anlysis nd more Run-time T(n)=2 T(n/2)cn so T(n)=O(n log n) So much for evlution... wht out interpoltion? Given R(1), R(ω), R(ω 2 ),..., R(ω n-1 ) Compute c 0, c 1,...,c n-1 s.t. R(x)=c 0 c 1 x...c n-1 x n-1 53

54 Interpoltion: n equtions in n unknowns Mtrix form of the liner system c 0 R(1) 1 ω ω 2 ω n-1 c 1 R(ω) c 2 =... 1 ω n-1 ω 2n-2 ω (n-1)(n-1) c n-1 R(ω n-1 ) Let M e the interpoltion mtrix for these points Tht is: M ij = ω ij 54

55 The inverse of M Define mtrix N y N ij = ω -ij. Then (MN) ij =Σ k=0..n =0..n-1 ωik ω -kj = Σ k=0..n If i=j then this is Σ 1 = n k=0..n-1 If i j then this is k=0..n-1 ω k(i-j) 1ω i-j ω 2(i-j) ω (n-1)(i-j) =0 So MN is n times the identity mtrix; tht is M -1 =N/n 55

56 Interpoltion using FFT So C=M -1 R=N R/n; tht is R(1)/n c 0 1 ω -1 ω -2 ω -(n-1) R(ω)/n c 1. = c ω -(n-1) ω -(2n-2) ω -(n-1)(n-1) R(ω n-1 )/n c n-1 But mtrix N is just the mtrix for the evlution t points 1, ω -1, ω -2,, ω -(n-1)!!! So pply the sme FFT recursion for the interpoltion phse which is lso O(n log n) time. 56

57 Why this is clled the discrete Fourier trnsform Rel Fourier series Given rel vlued function f defined on [0,2π] the Fourier series for f is given y f(x)= 0 1 cos(x) 2 cos(2x)... m cos(mx)... where 2π 1 m = f(x) cos(mx) dx 2π 0 is the component of f of frequency m In signl processing nd dt compression one ignores ll ut the components with lrge m nd there ren t mny of these. 57

58 Why this is clled the discrete Fourier trnsform Complex Fourier series Given function f defined on [0,2π] the complex Fourier series for f is given y f(z)= 0 1 e i z 2 e 2i z... m e mi z... where m = 2π 1 π -mi z f(z) e dz 2 0 is the component of f of frequency m If we discretize this integrl using vlues t n eqully spced points etween 0 nd 2π we get 1 1 f e f n 1 n 1 iπ = -2km /n = km m k k ω n k= 0 n k= 0 just like interpoltion! where f k =f(2kπ/n) 2π/n prt 58

59 Beyond the Mster Theorem Divide nd conquer exmples Simple, rndomized medin lgorithm Expected O(n) time Not so simple, deterministic medin lgorithm Worst cse O(n) time Expected time nlysis for Rndomized QuickSort Expected O(n log n) time 59 59

60 Order prolems: Find the k th lrgest Runtime models Mchine Instructions Comprisons Mximum O(n) time n-1 comprisons 2 nd Lrgest O(n) time? comprisons 60

61 Medin Prolem k th lrgest for k = n/2 Esily done in O(n log n) time with sorting How cn the prolem e solved in O(n) time? Select(k, n) find the k-th lrgest from list of length n 61

62 Divide nd Conquer T(n) = n T(αn) for α < 1 Liner time solution Select lgorithm in liner time, reduce the prolem from selecting the k-th lrgest of n to the j-th lrgest of αn, for α < 1 62

63 Quick Select QSelect(k, S) Choose element x from S S L = {y in S y < x } S E = {y in S y = x } S G = {y in S y > x } if S L k return QSelect(k, S L ) else if S L S E k return y else return QSelect(k - S L - S E, S G ) 63

64 Implementing Choose n element x Idelly, we would choose n x in the middle, to reduce oth sets in hlf nd gurntee progress Method 1 Select n element t rndom Method 2 BFPRT Algorithm Select n element y complicted, ut liner time method tht gurntees good split 64

65 Rndom Selection Consider cll to QSelect(k, S), nd let S e the elements pssed to the recursive cll. With proility t lest ½, S < ¾ S d x good x good x elements of S listed in sorted order d x On verge only 2 recursive clls efore the size of S is t most 3n/4 65

66 Expected runtime is O(n) Given x, one pss over S to determine S L, S E, nd S G nd their sizes: cn time. Expect 2cn cost efore size of S drops to t most 3 S /4 Let T(n) e the expected running time T(n) T(3n/4) 2cn 2cn (¾) 2cn (¾) 2 2cn 2cn (1 (¾) (¾) 2 ) 66

67 Mking the lgorithm deterministic In O(n) time, find n element tht gurntees tht the lrger set in the split hs size t most ¾ n 67

68 Blum-Floyd-Prtt-Rivest-Trjn Algorithm Divide S into n/5 sets of size 5 Sort ech of these sets of size 5 Let M e the set of ll medins of the sets of size 5 Let x e the medin of M S L = {y in S y < x}, S G = {y in S y > x} Clim: S L < ¾ S, S G < ¾ S 68

69 BFPRT, Step 1: Construct sets of size 5, sort ech set 13, 15, 32, 14, 95, 5, 16, 45, 86, 65, 62, 41, 81, 52, 32, 32, 12, 73, 25, 81, 47, 8, 69, 9, 7, 81, 18, 25, 42, 91, 64, 98, 96, 91, 6, 51, 21, 12, 36, 11, 11, 9, 5, 17,

70 BFPRT, Step 2: Find medin of column medins

71 BFPRT Recurrence Sorting ll n/5 lists of size 5 c n time Finding medin of set M of medins Recursive computtion: T(n/5) Computing sets S L, S E, S G nd S c n time Solving selection prolem on S Recursive computtion: T(3n/4) since S ¾ n 71

72 T(n) cn T(n/5) T(3n/4) is O(n) Key property 3/4 1/5 < 1 (The sum is 19/20) Sum of prolem sizes decreses y 19/20 fctor per level of recursion Overhed per level is liner in the sum of the prolem sizes Overhed decreses y 19/20 fctor per level of recursion Totl overhed is liner (sum of geometric series with constnt rtio nd liner lrgest term) 72

73 Quick Sort QuickSort(S) if S is empty, return Choose element x from S pivot S L = {y in S y < x } S E = {y in S y = x } S G = {y in S y > x } return [QuickSort(S L ), S E, QuickSort(S G )] 73

74 QuickSort Pivot Selection Choose the medin T(n) = T(n/2) T(n/2) cn, O(n log n) Choose ritrry element Worst cse O(n 2 ) Averge cse O(n log n) Choose rndom pivot Expected time O(n log n) 74

75 Expected run time for QuickSort: Glol nlysis Count comprisons i, j elements in positions i nd j in the finl sorted list. p ij the proility tht i nd j re compred Expected numer of comprisons: Σ i<j p ij 75

76 Lemm: P ij 2/(j i 1) If i nd j re compred then it must e during the cll when they end up in different suprolems - Before tht, they ren t compred to ech other - After they ren t compred to ech other During this step they re only compred if one of them is the pivot Since ll elements etween i nd j re lso in the suprolem this is 2 out of t lest j-i1 choices 76

77 Averge runtime is 2nln n Σ i<j p ij Σ i<j 2/(j-i1) write j=ki = 2 n-1 n-i 1/(k 1) i=1 k=1 2 (n-1) (H n -1) where H n =11/21/31/4... = ln n O(1) 2n ln n O(n) 1.387nlog 2 n 77

78 Divide nd Conquer Summry Powerful technique, when pplicle Divide lrge prolem into few smller prolems of the sme type Smller prolems must e constnt fctor smller 78

Algorithm Design and Analysis

Algorithm 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 information

set is not closed under matrix [ multiplication, ] and does not form a group.

set 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 information

Linear Inequalities. Work Sheet 1

Linear Inequalities. Work Sheet 1 Work Sheet 1 Liner Inequlities Rent--Hep, cr rentl compny,chrges $ 15 per week plus $ 0.0 per mile to rent one of their crs. Suppose you re limited y how much money you cn spend for the week : You cn spend

More information

Vectors , (0,0). 5. A vector is commonly denoted by putting an arrow above its symbol, as in the picture above. Here are some 3-dimensional vectors:

Vectors , (0,0). 5. A vector is commonly denoted by putting an arrow above its symbol, as in the picture above. Here are some 3-dimensional vectors: Vectors 1-23-2018 I ll look t vectors from n lgeric point of view nd geometric point of view. Algericlly, vector is n ordered list of (usully) rel numers. Here re some 2-dimensionl vectors: (2, 3), ( )

More information

Math& 152 Section Integration by Parts

Math& 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 information

Review of Gaussian Quadrature method

Review of Gaussian Quadrature method Review of Gussin Qudrture method Nsser M. Asi Spring 006 compiled on Sundy Decemer 1, 017 t 09:1 PM 1 The prolem To find numericl vlue for the integrl of rel vlued function of rel vrile over specific rnge

More information

Numerical Analysis: Trapezoidal and Simpson s Rule

Numerical 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 information

p-adic Egyptian Fractions

p-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 information

1B40 Practical Skills

1B40 Practical Skills B40 Prcticl Skills Comining uncertinties from severl quntities error propgtion We usully encounter situtions where the result of n experiment is given in terms of two (or more) quntities. We then need

More information

The Regulated and Riemann Integrals

The 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 information

Polynomials and Division Theory

Polynomials and Division Theory Higher Checklist (Unit ) Higher Checklist (Unit ) Polynomils nd Division Theory Skill Achieved? Know tht polynomil (expression) is of the form: n x + n x n + n x n + + n x + x + 0 where the i R re the

More information

Definite Integrals. The area under a curve can be approximated by adding up the areas of rectangles = 1 1 +

Definite Integrals. The area under a curve can be approximated by adding up the areas of rectangles = 1 1 + Definite Integrls --5 The re under curve cn e pproximted y dding up the res of rectngles. Exmple. Approximte the re under y = from x = to x = using equl suintervls nd + x evluting the function t the left-hnd

More information

Things to Memorize: A Partial List. January 27, 2017

Things to Memorize: A Partial List. January 27, 2017 Things to Memorize: A Prtil List Jnury 27, 2017 Chpter 2 Vectors - Bsic Fcts A vector hs mgnitude (lso clled size/length/norm) nd direction. It does not hve fixed position, so the sme vector cn e moved

More information

5: The Definite Integral

5: The Definite Integral 5: The Definite Integrl 5.: Estimting with Finite Sums Consider moving oject its velocity (meters per second) t ny time (seconds) is given y v t = t+. Cn we use this informtion to determine the distnce

More information

MATH 573 FINAL EXAM. May 30, 2007

MATH 573 FINAL EXAM. May 30, 2007 MATH 573 FINAL EXAM My 30, 007 NAME: Solutions 1. This exm is due Wednesdy, June 6 efore the 1:30 pm. After 1:30 pm I will NOT ccept the exm.. This exm hs 1 pges including this cover. There re 10 prolems.

More information

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University

Farey 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 information

Section 6: Area, Volume, and Average Value

Section 6: Area, Volume, and Average Value Chpter The Integrl Applied Clculus Section 6: Are, Volume, nd Averge Vlue Are We hve lredy used integrls to find the re etween the grph of function nd the horizontl xis. Integrls cn lso e used to find

More information

MA123, Chapter 10: Formulas for integrals: integrals, antiderivatives, and the Fundamental Theorem of Calculus (pp.

MA123, Chapter 10: Formulas for integrals: integrals, antiderivatives, and the Fundamental Theorem of Calculus (pp. MA123, Chpter 1: Formuls for integrls: integrls, ntiderivtives, nd the Fundmentl Theorem of Clculus (pp. 27-233, Gootmn) Chpter Gols: Assignments: Understnd the sttement of the Fundmentl Theorem of Clculus.

More information

2.4 Linear Inequalities and Interval Notation

2.4 Linear Inequalities and Interval Notation .4 Liner Inequlities nd Intervl Nottion We wnt to solve equtions tht hve n inequlity symol insted of n equl sign. There re four inequlity symols tht we will look t: Less thn , Less thn or

More information

QUADRATIC EQUATIONS OBJECTIVE PROBLEMS

QUADRATIC EQUATIONS OBJECTIVE PROBLEMS QUADRATIC EQUATIONS OBJECTIVE PROBLEMS +. The solution of the eqution will e (), () 0,, 5, 5. The roots of the given eqution ( p q) ( q r) ( r p) 0 + + re p q r p (), r p p q, q r p q (), (d), q r p q.

More information

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations.

Lecture 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 information

MTH 505: Number Theory Spring 2017

MTH 505: Number Theory Spring 2017 MTH 505: Numer Theory Spring 207 Homework 2 Drew Armstrong The Froenius Coin Prolem. Consider the eqution x ` y c where,, c, x, y re nturl numers. We cn think of $ nd $ s two denomintions of coins nd $c

More information

Math 1B, lecture 4: Error bounds for numerical methods

Math 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 information

Lecture 14: Quadrature

Lecture 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 information

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3 2 The Prllel Circuit Electric Circuits: Figure 2- elow show ttery nd multiple resistors rrnged in prllel. Ech resistor receives portion of the current from the ttery sed on its resistnce. The split is

More information

NUMERICAL INTEGRATION. The inverse process to differentiation in calculus is integration. Mathematically, integration is represented by.

NUMERICAL INTEGRATION. The inverse process to differentiation in calculus is integration. Mathematically, integration is represented by. NUMERICAL INTEGRATION 1 Introduction The inverse process to differentition in clculus is integrtion. Mthemticlly, integrtion is represented by f(x) dx which stnds for the integrl of the function f(x) with

More information

Quadratic Forms. Quadratic Forms

Quadratic Forms. Quadratic Forms Qudrtic Forms Recll the Simon & Blume excerpt from n erlier lecture which sid tht the min tsk of clculus is to pproximte nonliner functions with liner functions. It s ctully more ccurte to sy tht we pproximte

More information

Improper Integrals. The First Fundamental Theorem of Calculus, as we ve discussed in class, goes as follows:

Improper Integrals. The First Fundamental Theorem of Calculus, as we ve discussed in class, goes as follows: Improper Integrls The First Fundmentl Theorem of Clculus, s we ve discussed in clss, goes s follows: If f is continuous on the intervl [, ] nd F is function for which F t = ft, then ftdt = F F. An integrl

More information

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique? XII. LINEAR ALGEBRA: SOLVING SYSTEMS OF EQUATIONS Tody we re going to tlk out solving systems of liner equtions. These re prolems tht give couple of equtions with couple of unknowns, like: 6= x + x 7=

More information

First Midterm Examination

First 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

The area under the graph of f and above the x-axis between a and b is denoted by. f(x) dx. π O

The 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 information

u( t) + K 2 ( ) = 1 t > 0 Analyzing Damped Oscillations Problem (Meador, example 2-18, pp 44-48): Determine the equation of the following graph.

u( t) + K 2 ( ) = 1 t > 0 Analyzing Damped Oscillations Problem (Meador, example 2-18, pp 44-48): Determine the equation of the following graph. nlyzing Dmped Oscilltions Prolem (Medor, exmple 2-18, pp 44-48): Determine the eqution of the following grph. The eqution is ssumed to e of the following form f ( t) = K 1 u( t) + K 2 e!"t sin (#t + $

More information

Surface maps into free groups

Surface maps into free groups Surfce mps into free groups lden Wlker Novemer 10, 2014 Free groups wedge X of two circles: Set F = π 1 (X ) =,. We write cpitl letters for inverse, so = 1. e.g. () 1 = Commuttors Let x nd y e loops. The

More information

Lecture 2e Orthogonal Complement (pages )

Lecture 2e Orthogonal Complement (pages ) Lecture 2e Orthogonl Complement (pges -) We hve now seen tht n orthonorml sis is nice wy to descrie suspce, ut knowing tht we wnt n orthonorml sis doesn t mke one fll into our lp. In theory, the process

More information

f(a+h) f(a) x a h 0. This is the rate at which

f(a+h) f(a) x a h 0. This is the rate at which M408S Concept Inventory smple nswers These questions re open-ended, nd re intended to cover the min topics tht we lerned in M408S. These re not crnk-out-n-nswer problems! (There re plenty of those in the

More information

1 ELEMENTARY ALGEBRA and GEOMETRY READINESS DIAGNOSTIC TEST PRACTICE

1 ELEMENTARY ALGEBRA and GEOMETRY READINESS DIAGNOSTIC TEST PRACTICE ELEMENTARY ALGEBRA nd GEOMETRY READINESS DIAGNOSTIC TEST PRACTICE Directions: Study the exmples, work the prolems, then check your nswers t the end of ech topic. If you don t get the nswer given, check

More information

4.4 Areas, Integrals and Antiderivatives

4.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 information

Edexcel GCE Core Mathematics (C2) Required Knowledge Information Sheet. Daniel Hammocks

Edexcel GCE Core Mathematics (C2) Required Knowledge Information Sheet. Daniel Hammocks Edexcel GCE Core Mthemtics (C) Required Knowledge Informtion Sheet C Formule Given in Mthemticl Formule nd Sttisticl Tles Booklet Cosine Rule o = + c c cosine (A) Binomil Series o ( + ) n = n + n 1 n 1

More information

Physics 116C Solution of inhomogeneous ordinary differential equations using Green s functions

Physics 116C Solution of inhomogeneous ordinary differential equations using Green s functions Physics 6C Solution of inhomogeneous ordinry differentil equtions using Green s functions Peter Young November 5, 29 Homogeneous Equtions We hve studied, especilly in long HW problem, second order liner

More information

NUMERICAL INTEGRATION

NUMERICAL 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 information

Lecture 1. Functional series. Pointwise and uniform convergence.

Lecture 1. Functional series. Pointwise and uniform convergence. 1 Introduction. Lecture 1. Functionl series. Pointwise nd uniform convergence. In this course we study mongst other things Fourier series. The Fourier series for periodic function f(x) with period 2π is

More information

Orthogonal Polynomials

Orthogonal Polynomials Mth 4401 Gussin Qudrture Pge 1 Orthogonl Polynomils Orthogonl polynomils rise from series solutions to differentil equtions, lthough they cn be rrived t in vriety of different mnners. Orthogonl polynomils

More information

Chapter 3 Solving Nonlinear Equations

Chapter 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 information

Abstract inner product spaces

Abstract inner product spaces WEEK 4 Abstrct inner product spces Definition An inner product spce is vector spce V over the rel field R equipped with rule for multiplying vectors, such tht the product of two vectors is sclr, nd the

More information

Improper Integrals. Type I Improper Integrals How do we evaluate an integral such as

Improper Integrals. Type I Improper Integrals How do we evaluate an integral such as Improper Integrls Two different types of integrls cn qulify s improper. The first type of improper integrl (which we will refer to s Type I) involves evluting n integrl over n infinite region. In the grph

More information

p(t) dt + i 1 re it ireit dt =

p(t) dt + i 1 re it ireit dt = Note: This mteril is contined in Kreyszig, Chpter 13. Complex integrtion We will define integrls of complex functions long curves in C. (This is bit similr to [relvlued] line integrls P dx + Q dy in R2.)

More information

Matrix Algebra. Matrix Addition, Scalar Multiplication and Transposition. Linear Algebra I 24

Matrix Algebra. Matrix Addition, Scalar Multiplication and Transposition. Linear Algebra I 24 Mtrix lger Mtrix ddition, Sclr Multipliction nd rnsposition Mtrix lger Section.. Mtrix ddition, Sclr Multipliction nd rnsposition rectngulr rry of numers is clled mtrix ( the plurl is mtrices ) nd the

More information

f(x) dx, If one of these two conditions is not met, we call the integral improper. Our usual definition for the value for the definite integral

f(x) dx, If one of these two conditions is not met, we call the integral improper. Our usual definition for the value for the definite integral Improper Integrls Every time tht we hve evluted definite integrl such s f(x) dx, we hve mde two implicit ssumptions bout the integrl:. The intervl [, b] is finite, nd. f(x) is continuous on [, b]. If one

More information

Math 113 Exam 2 Practice

Math 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 information

Unit #9 : Definite Integral Properties; Fundamental Theorem of Calculus

Unit #9 : Definite Integral Properties; Fundamental Theorem of Calculus Unit #9 : Definite Integrl Properties; Fundmentl Theorem of Clculus Gols: Identify properties of definite integrls Define odd nd even functions, nd reltionship to integrl vlues Introduce the Fundmentl

More information

a a a a a a a a a a a a a a a a a a a a a a a a In this section, we introduce a general formula for computing determinants.

a a a a a a a a a a a a a a a a a a a a a a a a In this section, we introduce a general formula for computing determinants. Section 9 The Lplce Expnsion In the lst section, we defined the determinnt of (3 3) mtrix A 12 to be 22 12 21 22 2231 22 12 21. In this section, we introduce generl formul for computing determinnts. Rewriting

More information

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4 Intermedite Mth Circles Wednesdy, Novemer 14, 2018 Finite Automt II Nickols Rollick nrollick@uwterloo.c Regulr Lnguges Lst time, we were introduced to the ide of DFA (deterministic finite utomton), one

More information

W. We shall do so one by one, starting with I 1, and we shall do it greedily, trying

W. We shall do so one by one, starting with I 1, and we shall do it greedily, trying Vitli covers 1 Definition. A Vitli cover of set E R is set V of closed intervls with positive length so tht, for every δ > 0 nd every x E, there is some I V with λ(i ) < δ nd x I. 2 Lemm (Vitli covering)

More information

. Double-angle formulas. Your answer should involve trig functions of θ, and not of 2θ. sin 2 (θ) =

. Double-angle formulas. Your answer should involve trig functions of θ, and not of 2θ. sin 2 (θ) = Review of some needed Trig. Identities for Integrtion. Your nswers should be n ngle in RADIANS. rccos( 1 ) = π rccos( - 1 ) = 2π 2 3 2 3 rcsin( 1 ) = π rcsin( - 1 ) = -π 2 6 2 6 Cn you do similr problems?

More information

Math 113 Fall Final Exam Review. 2. Applications of Integration Chapter 6 including sections and section 6.8

Math 113 Fall Final Exam Review. 2. Applications of Integration Chapter 6 including sections and section 6.8 Mth 3 Fll 0 The scope of the finl exm will include: Finl Exm Review. Integrls Chpter 5 including sections 5. 5.7, 5.0. Applictions of Integrtion Chpter 6 including sections 6. 6.5 nd section 6.8 3. Infinite

More information

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER /2019

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER /2019 ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS MATH00030 SEMESTER 208/209 DR. ANTHONY BROWN 7.. Introduction to Integrtion. 7. Integrl Clculus As ws the cse with the chpter on differentil

More information

The practical version

The practical version Roerto s Notes on Integrl Clculus Chpter 4: Definite integrls nd the FTC Section 7 The Fundmentl Theorem of Clculus: The prcticl version Wht you need to know lredy: The theoreticl version of the FTC. Wht

More information

Calculus II: Integrations and Series

Calculus II: Integrations and Series Clculus II: Integrtions nd Series August 7, 200 Integrls Suppose we hve generl function y = f(x) For simplicity, let f(x) > 0 nd f(x) continuous Denote F (x) = re under the grph of f in the intervl [,x]

More information

Chapter 3 Polynomials

Chapter 3 Polynomials Dr M DRAIEF As described in the introduction of Chpter 1, pplictions of solving liner equtions rise in number of different settings In prticulr, we will in this chpter focus on the problem of modelling

More information

Torsion in Groups of Integral Triangles

Torsion in Groups of Integral Triangles Advnces in Pure Mthemtics, 01,, 116-10 http://dxdoiorg/1046/pm011015 Pulished Online Jnury 01 (http://wwwscirporg/journl/pm) Torsion in Groups of Integrl Tringles Will Murry Deprtment of Mthemtics nd Sttistics,

More information

Parse trees, ambiguity, and Chomsky normal form

Parse trees, ambiguity, and Chomsky normal form Prse trees, miguity, nd Chomsky norml form In this lecture we will discuss few importnt notions connected with contextfree grmmrs, including prse trees, miguity, nd specil form for context-free grmmrs

More information

Math 61CM - Solutions to homework 9

Math 61CM - Solutions to homework 9 Mth 61CM - Solutions to homework 9 Cédric De Groote November 30 th, 2018 Problem 1: Recll tht the left limit of function f t point c is defined s follows: lim f(x) = l x c if for ny > 0 there exists δ

More information

2. VECTORS AND MATRICES IN 3 DIMENSIONS

2. VECTORS AND MATRICES IN 3 DIMENSIONS 2 VECTORS AND MATRICES IN 3 DIMENSIONS 21 Extending the Theory of 2-dimensionl Vectors x A point in 3-dimensionl spce cn e represented y column vector of the form y z z-xis y-xis z x y x-xis Most of the

More information

Chapter 4 Contravariance, Covariance, and Spacetime Diagrams

Chapter 4 Contravariance, Covariance, and Spacetime Diagrams Chpter 4 Contrvrince, Covrince, nd Spcetime Digrms 4. The Components of Vector in Skewed Coordintes We hve seen in Chpter 3; figure 3.9, tht in order to show inertil motion tht is consistent with the Lorentz

More information

Numerical Linear Algebra Assignment 008

Numerical Linear Algebra Assignment 008 Numericl Liner Algebr Assignment 008 Nguyen Qun B Hong Students t Fculty of Mth nd Computer Science, Ho Chi Minh University of Science, Vietnm emil. nguyenqunbhong@gmil.com blog. http://hongnguyenqunb.wordpress.com

More information

Data Structures and Algorithms CMPSC 465

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 information

Best Approximation. Chapter The General Case

Best 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 information

New Expansion and Infinite Series

New Expansion and Infinite Series Interntionl Mthemticl Forum, Vol. 9, 204, no. 22, 06-073 HIKARI Ltd, www.m-hikri.com http://dx.doi.org/0.2988/imf.204.4502 New Expnsion nd Infinite Series Diyun Zhng College of Computer Nnjing University

More information

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies Stte spce systems nlysis (continued) Stbility A. Definitions A system is sid to be Asymptoticlly Stble (AS) when it stisfies ut () = 0, t > 0 lim xt () 0. t A system is AS if nd only if the impulse response

More information

Chapter 6 Techniques of Integration

Chapter 6 Techniques of Integration MA Techniques of Integrtion Asst.Prof.Dr.Suprnee Liswdi Chpter 6 Techniques of Integrtion Recll: Some importnt integrls tht we hve lernt so fr. Tle of Integrls n+ n d = + C n + e d = e + C ( n ) d = ln

More information

Z b. f(x)dx. Yet in the above two cases we know what f(x) is. Sometimes, engineers want to calculate an area by computing I, but...

Z b. f(x)dx. Yet in the above two cases we know what f(x) is. Sometimes, engineers want to calculate an area by computing I, but... Chpter 7 Numericl Methods 7. Introduction In mny cses the integrl f(x)dx cn be found by finding function F (x) such tht F 0 (x) =f(x), nd using f(x)dx = F (b) F () which is known s the nlyticl (exct) solution.

More information

13: Diffusion in 2 Energy Groups

13: 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 information

Anti-derivatives/Indefinite Integrals of Basic Functions

Anti-derivatives/Indefinite Integrals of Basic Functions Anti-derivtives/Indefinite Integrls of Bsic Functions Power Rule: In prticulr, this mens tht x n+ x n n + + C, dx = ln x + C, if n if n = x 0 dx = dx = dx = x + C nd x (lthough you won t use the second

More information

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives Block #6: Properties of Integrls, Indefinite Integrls Gols: Definition of the Definite Integrl Integrl Clcultions using Antiderivtives Properties of Integrls The Indefinite Integrl 1 Riemnn Sums - 1 Riemnn

More information

5.7 Improper Integrals

5.7 Improper Integrals 458 pplictions of definite integrls 5.7 Improper Integrls In Section 5.4, we computed the work required to lift pylod of mss m from the surfce of moon of mss nd rdius R to height H bove the surfce of the

More information

Mathematics Number: Logarithms

Mathematics Number: Logarithms plce of mind F A C U L T Y O F E D U C A T I O N Deprtment of Curriculum nd Pedgogy Mthemtics Numer: Logrithms Science nd Mthemtics Eduction Reserch Group Supported y UBC Teching nd Lerning Enhncement

More information

First Midterm Examination

First Midterm Examination Çnky University Deprtment of Computer Engineering 203-204 Fll Semester First Midterm Exmintion ) Design DFA for ll strings over the lphet Σ = {,, c} in which there is no, no nd no cc. 2) Wht lnguge does

More information

Lecture 19: Continuous Least Squares Approximation

Lecture 19: Continuous Least Squares Approximation Lecture 19: Continuous Lest Squres Approximtion 33 Continuous lest squres pproximtion We begn 31 with the problem of pproximting some f C[, b] with polynomil p P n t the discrete points x, x 1,, x m for

More information

SUMMER KNOWHOW STUDY AND LEARNING CENTRE

SUMMER 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 information

Review of Calculus, cont d

Review of Calculus, cont d Jim Lmbers MAT 460 Fll Semester 2009-10 Lecture 3 Notes These notes correspond to Section 1.1 in the text. Review of Clculus, cont d Riemnn Sums nd the Definite Integrl There re mny cses in which some

More information

CS667 Lecture 6: Monte Carlo Integration 02/10/05

CS667 Lecture 6: Monte Carlo Integration 02/10/05 CS667 Lecture 6: Monte Crlo Integrtion 02/10/05 Venkt Krishnrj Lecturer: Steve Mrschner 1 Ide The min ide of Monte Crlo Integrtion is tht we cn estimte the vlue of n integrl by looking t lrge number of

More information

( ) Same as above but m = f x = f x - symmetric to y-axis. find where f ( x) Relative: Find where f ( x) x a + lim exists ( lim f exists.

( ) Same as above but m = f x = f x - symmetric to y-axis. find where f ( x) Relative: Find where f ( x) x a + lim exists ( lim f exists. AP Clculus Finl Review Sheet solutions When you see the words This is wht you think of doing Find the zeros Set function =, fctor or use qudrtic eqution if qudrtic, grph to find zeros on clcultor Find

More information

CMDA 4604: Intermediate Topics in Mathematical Modeling Lecture 19: Interpolation and Quadrature

CMDA 4604: Intermediate Topics in Mathematical Modeling Lecture 19: Interpolation and Quadrature CMDA 4604: Intermedite Topics in Mthemticl Modeling Lecture 19: Interpoltion nd Qudrture In this lecture we mke brief diversion into the res of interpoltion nd qudrture. Given function f C[, b], we sy

More information

Math 520 Final Exam Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008

Math 520 Final Exam Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008 Mth 520 Finl Exm Topic Outline Sections 1 3 (Xio/Dums/Liw) Spring 2008 The finl exm will be held on Tuesdy, My 13, 2-5pm in 117 McMilln Wht will be covered The finl exm will cover the mteril from ll of

More information

dx dt dy = G(t, x, y), dt where the functions are defined on I Ω, and are locally Lipschitz w.r.t. variable (x, y) Ω.

dx dt dy = G(t, x, y), dt where the functions are defined on I Ω, and are locally Lipschitz w.r.t. variable (x, y) Ω. Chpter 8 Stility theory We discuss properties of solutions of first order two dimensionl system, nd stility theory for specil clss of liner systems. We denote the independent vrile y t in plce of x, nd

More information

Summary: Method of Separation of Variables

Summary: Method of Separation of Variables Physics 246 Electricity nd Mgnetism I, Fll 26, Lecture 22 1 Summry: Method of Seprtion of Vribles 1. Seprtion of Vribles in Crtesin Coordintes 2. Fourier Series Suggested Reding: Griffiths: Chpter 3, Section

More information

Math 100 Review Sheet

Math 100 Review Sheet Mth 100 Review Sheet Joseph H. Silvermn December 2010 This outline of Mth 100 is summry of the mteril covered in the course. It is designed to be study id, but it is only n outline nd should be used s

More information

September 13 Homework Solutions

September 13 Homework Solutions College of Engineering nd Computer Science Mechnicl Engineering Deprtment Mechnicl Engineering 5A Seminr in Engineering Anlysis Fll Ticket: 5966 Instructor: Lrry Cretto Septemer Homework Solutions. Are

More information

Chapter 9 Definite Integrals

Chapter 9 Definite Integrals Chpter 9 Definite Integrls In the previous chpter we found how to tke n ntiderivtive nd investigted the indefinite integrl. In this chpter the connection etween ntiderivtives nd definite integrls is estlished

More information

Coalgebra, Lecture 15: Equations for Deterministic Automata

Coalgebra, Lecture 15: Equations for Deterministic Automata Colger, Lecture 15: Equtions for Deterministic Automt Julin Slmnc (nd Jurrin Rot) Decemer 19, 2016 In this lecture, we will study the concept of equtions for deterministic utomt. The notes re self contined

More information

QUADRATURE is an old-fashioned word that refers to

QUADRATURE is an old-fashioned word that refers to World Acdemy of Science Engineering nd Technology Interntionl Journl of Mthemticl nd Computtionl Sciences Vol:5 No:7 011 A New Qudrture Rule Derived from Spline Interpoltion with Error Anlysis Hdi Tghvfrd

More information

The Evaluation Theorem

The Evaluation Theorem These notes closely follow the presenttion of the mteril given in Jmes Stewrt s textook Clculus, Concepts nd Contexts (2nd edition) These notes re intended primrily for in-clss presenttion nd should not

More information

Section 4: Integration ECO4112F 2011

Section 4: Integration ECO4112F 2011 Reding: Ching Chpter Section : Integrtion ECOF Note: These notes do not fully cover the mteril in Ching, ut re ment to supplement your reding in Ching. Thus fr the optimistion you hve covered hs een sttic

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

(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 information

4 VECTORS. 4.0 Introduction. Objectives. Activity 1

4 VECTORS. 4.0 Introduction. Objectives. Activity 1 4 VECTRS Chpter 4 Vectors jectives fter studying this chpter you should understnd the difference etween vectors nd sclrs; e le to find the mgnitude nd direction of vector; e le to dd vectors, nd multiply

More information

A recursive construction of efficiently decodable list-disjunct matrices

A 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 information

Chapter 5. Numerical Integration

Chapter 5. Numerical Integration Chpter 5. Numericl Integrtion These re just summries of the lecture notes, nd few detils re included. Most of wht we include here is to be found in more detil in Anton. 5. Remrk. There re two topics with

More information

Chapter 0. What is the Lebesgue integral about?

Chapter 0. What is the Lebesgue integral about? Chpter 0. Wht is the Lebesgue integrl bout? The pln is to hve tutoril sheet ech week, most often on Fridy, (to be done during the clss) where you will try to get used to the ides introduced in the previous

More information

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1 Chpter Five: Nondeterministic Finite Automt Forml Lnguge, chpter 5, slide 1 1 A DFA hs exctly one trnsition from every stte on every symol in the lphet. By relxing this requirement we get relted ut more

More information

ODE: Existence and Uniqueness of a Solution

ODE: 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 information