Introduction to Algorithms 6.046J/18.401J LECTURE 3 Divide and conquer Binary search Powering a number Fibonacci numbers Matrix multiplication

Size: px
Start display at page:

Download "Introduction to Algorithms 6.046J/18.401J LECTURE 3 Divide and conquer Binary search Powering a number Fibonacci numbers Matrix multiplication"

Transcription

1 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

2 The divide-ad-coquer desig paradigm. Divide the problem (istace) ito subproblems. 2. Coquer the subproblems by solvig them recursively. 3. Combie subproblem solutios. September 5, 2004 Itroductio to Algorithms L3.2

3 Merge sort. Divide: Trivial. 2. Coquer: Recursively sort 2 subarrays. 3. Combie: Liear-time merge. September 5, 2004 Itroductio to Algorithms L3.3

4 Merge sort. Divide: Trivial. 2. Coquer: Recursively sort 2 subarrays. 3. Combie: Liear-time merge. T() = 2 T(/2) + Θ() # subproblems subproblem size work dividig ad combiig September 5, 2004 Itroductio to Algorithms L3.4

5 Master theorem (reprise) T() = at(/b) + f () CASE : f () = O( log ba ε ), costat ε > 0 T() = Θ( log ba ). CASE 2: f () = Θ( log ba lg k ), costat k 0 T() = Θ( log ba lg k+ ). CASE 3: f () = Ω( log ba + ε ), costat ε > 0, ad regularity coditio T() = Θ( f ()). September 5, 2004 Itroductio to Algorithms L3.5

6 September 5, 2004 Master theorem (reprise) T() = at(/b) + f () CASE : f () = O( log ba ε ), costat ε > 0 T() = Θ( log ba ). CASE 2: f () = Θ( log ba lg k ), costat k 0 T() = Θ( log ba lg k+ ). CASE 3: f () = Ω( log ba + ε ), costat ε > 0, ad regularity coditio T() = Θ( f ()). Merge sort: a = 2, b = 2 log ba = log 22 = CASE 2 (k = 0) T() = Θ( lg ). Itroductio to Algorithms L3.6

7 Biary search Fid a elemet i a sorted array:. Divide: Check middle elemet. 2. Coquer: Recursively search subarray. 3. Combie: Trivial. September 5, 2004 Itroductio to Algorithms L3.7

8 Biary search Fid a elemet i a sorted array:. Divide: Check middle elemet. 2. Coquer: Recursively search subarray. 3. Combie: Trivial. Example: Fid September 5, 2004 Itroductio to Algorithms L3.8

9 Biary search Fid a elemet i a sorted array:. Divide: Check middle elemet. 2. Coquer: Recursively search subarray. 3. Combie: Trivial. Example: Fid September 5, 2004 Itroductio to Algorithms L3.9

10 Biary search Fid a elemet i a sorted array:. Divide: Check middle elemet. 2. Coquer: Recursively search subarray. 3. Combie: Trivial. Example: Fid September 5, 2004 Itroductio to Algorithms L3.0

11 Biary search Fid a elemet i a sorted array:. Divide: Check middle elemet. 2. Coquer: Recursively search subarray. 3. Combie: Trivial. Example: Fid September 5, 2004 Itroductio to Algorithms L3.

12 Biary search Fid a elemet i a sorted array:. Divide: Check middle elemet. 2. Coquer: Recursively search subarray. 3. Combie: Trivial. Example: Fid September 5, 2004 Itroductio to Algorithms L3.2

13 Biary search Fid a elemet i a sorted array:. Divide: Check middle elemet. 2. Coquer: Recursively search subarray. 3. Combie: Trivial. Example: Fid September 5, 2004 Itroductio to Algorithms L3.3

14 Recurrece for biary search T() = T(/2) + Θ() # subproblems subproblem size work dividig ad combiig September 5, 2004 Itroductio to Algorithms L3.4

15 Recurrece for biary search T() = T(/2) + Θ() # subproblems subproblem size work dividig ad combiig log ba = log 2 = 0 = CASE 2 (k = 0) T() = Θ(lg ). September 5, 2004 Itroductio to Algorithms L3.5

16 Powerig a umber Problem: Compute a, where N. Naive algorithm: Θ(). September 5, 2004 Itroductio to Algorithms L3.6

17 Powerig a umber Problem: Compute a, where N. Naive algorithm: Θ(). Divide-ad-coquer algorithm: a = a /2 a /2 a ( )/2 a ( )/2 a if is eve; if is odd. September 5, 2004 Itroductio to Algorithms L3.7

18 Powerig a umber Problem: Compute a, where N. Naive algorithm: Θ(). Divide-ad-coquer algorithm: a = a /2 a /2 a ( )/2 a ( )/2 a if is eve; if is odd. T() = T(/2) + Θ() T() = Θ(lg ). September 5, 2004 Itroductio to Algorithms L3.8

19 Fiboacci umbers Recursive defiitio: 0 if = 0; F = if = ; F + F 2 if L September 5, 2004 Itroductio to Algorithms L3.9

20 Fiboacci umbers Recursive defiitio: F = 0 if = 0; if = ; F + F 2 if L Naive recursive algorithm: Ω(φ ) (expoetial time), where φ = ( + is the golde ratio. 5)/2 September 5, 2004 Itroductio to Algorithms L3.20

21 Computig Fiboacci umbers Bottom-up: Compute F 0, F, F 2,, F i order, formig each umber by summig the two previous. Ruig time: Θ(). September 5, 2004 Itroductio to Algorithms L3.2

22 Computig Fiboacci umbers Bottom-up: Compute F 0, F, F 2,, F i order, formig each umber by summig the two previous. Ruig time: Θ(). Naive recursive squarig: F = φ / 5 rouded to the earest iteger. Recursive squarig: Θ(lg ) time. This method is ureliable, sice floatig-poit arithmetic is proe to roud-off errors. September 5, 2004 Itroductio to Algorithms L3.22

23 Recursive squarig F + F Theorem: = F F. 0 September 5, 2004 Itroductio to Algorithms L3.23

24 Recursive squarig F + F Theorem: = F F. 0 Algorithm: Recursive squarig. Time = Θ(lg ). September 5, 2004 Itroductio to Algorithms L3.24

25 September 5, 2004 Itroductio to Algorithms L3.25 Recursive squarig F F F F = + 0 Theorem:. Proof of theorem. (Iductio o.) Base ( = ): = F F F F Algorithm: Recursive squarig. Time = Θ(lg ).

26 September 5, 2004 Itroductio to Algorithms L3.26 Recursive squarig.. Iductive step ( 2): F F F F F F F F = = =

27 September 5, 2004 Itroductio to Algorithms L3.27 Matrix multiplicatio = b b b b b b b b b a a a a a a a a a c c c c c c c c c L M O M M L L L M O M M L L L M O M M L L = = k kj ik ij b a c Iput: A = [a ij ], B = [b ij ]. Output: C = [c ij ] = A B. i, j =, 2,,.

28 Stadard algorithm for i to do for j to do c ij 0 for k to do c ij c ij + a ik b kj September 5, 2004 Itroductio to Algorithms L3.28

29 Stadard algorithm for i to do for j to do c ij 0 for k to do c ij c ij + a ik b kj Ruig time = Θ( 3 ) September 5, 2004 Itroductio to Algorithms L3.29

30 Divide-ad-coquer algorithm IDEA: matrix = 2 2 matrix of (/2) (/2) submatrices: r=ae+bg s=af+bh t =ce+dg u=cf+dh r t s u = a c e g September 5, 2004 Itroductio to Algorithms L3.30 b d C = A B 8 mults of (/2) (/2) submatrices 4 adds of (/2) (/2) submatrices f h

31 Divide-ad-coquer algorithm IDEA: matrix = 2 2 matrix of (/2) (/2) submatrices: r=ae+bg s=af+bh t =ce+dh u=cf+dg r t s u = a c e g September 5, 2004 Itroductio to Algorithms L3.3 b d C = A B recursive 8 mults of (/2) (/2) submatrices ^ 4 adds of (/2) (/2) submatrices f h

32 Aalysis of D&C algorithm T() = 8 T(/2) + Θ( 2 ) # submatrices submatrix size work addig submatrices September 5, 2004 Itroductio to Algorithms L3.32

33 Aalysis of D&C algorithm T() = 8 T(/2) + Θ( 2 ) # submatrices submatrix size work addig submatrices log ba = log 2 8 = 3 CASE T() = Θ( 3 ). September 5, 2004 Itroductio to Algorithms L3.33

34 Aalysis of D&C algorithm T() = 8 T(/2) + Θ( 2 ) # submatrices submatrix size work addig submatrices log ba = log 2 8 = 3 CASE T() = Θ( 3 ). No better tha the ordiary algorithm. September 5, 2004 Itroductio to Algorithms L3.34

35 Strasse s idea Multiply 2 2 matrices with oly 7 recursive mults. September 5, 2004 Itroductio to Algorithms L3.35

36 Strasse s idea Multiply 2 2 matrices with oly 7 recursive mults. P = a ( f h) P 2 = (a + b) h P 3 = (c + d) e P 4 = d (g e) P 5 = (a + d) (e + h) P 6 = (b d) (g + h) P 7 = (a c) (e + f ) September 5, 2004 Itroductio to Algorithms L3.36

37 Strasse s idea Multiply 2 2 matrices with oly 7 recursive mults. P = a ( f h) P 2 = (a + b) h P 3 = (c + d) e P 4 = d (g e) P 5 = (a + d) (e + h) P 6 = (b d) (g + h) P 7 = (a c) (e + f ) r = P 5 + P 4 P 2 + P 6 s = P + P 2 t = P 3 + P 4 u = P 5 + P P 3 P 7 September 5, 2004 Itroductio to Algorithms L3.37

38 Strasse s idea Multiply 2 2 matrices with oly 7 recursive mults. P = a ( f h) P 2 = (a + b) h P 3 = (c + d) e P 4 = d (g e) P 5 = (a + d) (e + h) P 6 = (b d) (g + h) P 7 = (a c) (e + f ) r = P 5 + P 4 P 2 + P 6 s = P + P 2 t = P 3 + P 4 u = P 5 + P P 3 P 7 7 mults, 8 adds/subs. Note: No reliace o commutativity of mult! September 5, 2004 Itroductio to Algorithms L3.38

39 Strasse s idea Multiply 2 2 matrices with oly 7 recursive mults. P = a ( f h) P 2 = (a + b) h P 3 = (c + d) e P 4 = d (g e) P 5 = (a + d) (e + h) P 6 = (b d) (g + h) P 7 = (a c) (e + f ) r = P 5 + P 4 P 2 + P 6 =(a + d)(e + h) + d (g e) (a + b) h + (b d)(g + h) = ae + ah + de + dh + dg de ah bh + bg + bh dg dh = ae + bg September 5, 2004 Itroductio to Algorithms L3.39

40 Strasse s algorithm. Divide: Partitio A ad B ito (/2) (/2) submatrices. Form terms to be multiplied usig + ad. 2. Coquer: Perform 7 multiplicatios of (/2) (/2) submatrices recursively. 3. Combie: Form C usig + ad o (/2) (/2) submatrices. September 5, 2004 Itroductio to Algorithms L3.40

41 Strasse s algorithm. Divide: Partitio A ad B ito (/2) (/2) submatrices. Form terms to be multiplied usig + ad. 2. Coquer: Perform 7 multiplicatios of (/2) (/2) submatrices recursively. 3. Combie: Form C usig + ad o (/2) (/2) submatrices. T() = 7 T(/2) + Θ( 2 ) September 5, 2004 Itroductio to Algorithms L3.4

42 Aalysis of Strasse T() = 7 T(/2) + Θ( 2 ) September 5, 2004 Itroductio to Algorithms L3.42

43 Aalysis of Strasse T() = 7 T(/2) + Θ( 2 ) log ba = log CASE T() = Θ( lg 7 ). September 5, 2004 Itroductio to Algorithms L3.43

44 Aalysis of Strasse T() = 7 T(/2) + Θ( 2 ) log ba = log CASE T() = Θ( lg 7 ). The umber 2.8 may ot seem much smaller tha 3, but because the differece is i the expoet, the impact o ruig time is sigificat. I fact, Strasse s algorithm beats the ordiary algorithm o today s machies for 32 or so. September 5, 2004 Itroductio to Algorithms L3.44

45 Aalysis of Strasse T() = 7 T(/2) + Θ( 2 ) log ba = log CASE T() = Θ( lg 7 ). The umber 2.8 may ot seem much smaller tha 3, but because the differece is i the expoet, the impact o ruig time is sigificat. I fact, Strasse s algorithm beats the ordiary algorithm o today s machies for 32 or so. Best to date (of theoretical iterest oly): Θ( 2.376L ). September 5, 2004 Itroductio to Algorithms L3.45

46 VLSI layout Problem: Embed a complete biary tree with leaves i a grid usig miimal area. September 5, 2004 Itroductio to Algorithms L3.46

47 VLSI layout Problem: Embed a complete biary tree with leaves i a grid usig miimal area. W() H() September 5, 2004 Itroductio to Algorithms L3.47

48 VLSI layout Problem: Embed a complete biary tree with leaves i a grid usig miimal area. W() H() H() = H(/2) + Θ() = Θ(lg ) September 5, 2004 Itroductio to Algorithms L3.48

49 VLSI layout Problem: Embed a complete biary tree with leaves i a grid usig miimal area. W() H() H() = H(/2) + Θ() = Θ(lg ) W() = 2W(/2) + Θ() = Θ() September 5, 2004 Itroductio to Algorithms L3.49

50 VLSI layout Problem: Embed a complete biary tree with leaves i a grid usig miimal area. W() H() H() = H(/2) + Θ() W() = 2W(/2) + Θ() = Θ(lg ) = Θ() Area = Θ( lg ) September 5, 2004 Itroductio to Algorithms L3.50

51 H-tree embeddig L() L() September 5, 2004 Itroductio to Algorithms L3.5

52 H-tree embeddig L() L() L(/4) Θ() L(/4) September 5, 2004 Itroductio to Algorithms L3.52

53 H-tree embeddig L() L() L() = 2L(/4) + Θ() = Θ( ) Area = Θ() L(/4) Θ() L(/4) September 5, 2004 Itroductio to Algorithms L3.53

54 Coclusio Divide ad coquer is just oe of several powerful techiques for algorithm desig. Divide-ad-coquer algorithms ca be aalyzed usig recurreces ad the master method (so practice this math). The divide-ad-coquer strategy ofte leads to efficiet algorithms. September 5, 2004 Itroductio to Algorithms L3.54

Algorithms Design & Analysis. Divide & Conquer

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

Divide-and-conquer algorithm

Divide-and-conquer algorithm Divide-and-conquer algorithm IDEA: n n matrix = 2 2 matrix of (n/2) (n/2) submatrices: r=ae+bg s=af+bh t =ce+dh u=cf+dg r t s u = a c e g September 15, 2004 Introduction to Algorithms L3.31 b d C = A B

More information

Introduction to Algorithms 6.046J/18.401J/SMA5503

Introduction to Algorithms 6.046J/18.401J/SMA5503 Introduction to Algorithms 6.046J/8.40J/SMA5503 Lecture 3 Prof. Piotr Indyk The divide-and-conquer design paradigm. Divide the problem (instance) into subproblems. 2. Conquer the subproblems by solving

More information

The Divide-and-Conquer Design Paradigm

The Divide-and-Conquer Design Paradigm CS473- Algorithms I Lecture 4 The Divide-and-Conquer Design Paradigm CS473 Lecture 4 1 The Divide-and-Conquer Design Paradigm 1. Divide the problem (instance) into subproblems. 2. Conquer the subproblems

More information

Introduction to Algorithms 6.046J/18.401J

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

CS583 Lecture 02. Jana Kosecka. some materials here are based on E. Demaine, D. Luebke slides

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

CS60020: Foundations of Algorithm Design and Machine Learning. Sourangshu Bhattacharya

CS60020: Foundations of Algorithm Design and Machine Learning. Sourangshu Bhattacharya CS60020: Foundations of Algorithm Design and Machine Learning Sourangshu Bhattacharya Matrix multiplication September 14, 2005 L2.27 Standard algorithm for i 1 to n do for j 1 ton do c ij 0 for k 1 to

More information

This Lecture. Divide and Conquer. Merge Sort: Algorithm. Merge Sort Algorithm. MergeSort (Example) - 1. MergeSort (Example) - 2

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 information

Algorithms and Data Structures Lecture IV

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

CMPS 2200 Fall Divide-and-Conquer. Carola Wenk. Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk

CMPS 2200 Fall Divide-and-Conquer. Carola Wenk. Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk CMPS 2200 Fall 2017 Divide-and-Conquer Carola Wenk Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk 1 The divide-and-conquer design paradigm 1. Divide the problem (instance)

More information

A recurrence equation is just a recursive function definition. It defines a function at one input in terms of its value on smaller inputs.

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

Design and Analysis of Algorithms

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

CS 332: Algorithms. Linear-Time Sorting. Order statistics. Slide credit: David Luebke (Virginia)

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

Model of Computation and Runtime Analysis

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

Classification of problem & problem solving strategies. classification of time complexities (linear, logarithmic etc)

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

Model of Computation and Runtime Analysis

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

CS 270 Algorithms. Oliver Kullmann. Growth of Functions. Divide-and- Conquer Min-Max- Problem. Tutorial. Reading from CLRS for week 2

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

CSE Introduction to Parallel Processing. Chapter 3. Parallel Algorithm Complexity

CSE Introduction to Parallel Processing. Chapter 3. Parallel Algorithm Complexity Dr. Izadi CSE-40533 Itroductio to Parallel Processig Chapter 3 Parallel Algorithm Complexity Review algorithm complexity ad various complexity classes Itroduce the otios of time ad time-cost optimality

More information

Mathematical Foundation. CSE 6331 Algorithms Steve Lai

Mathematical Foundation. CSE 6331 Algorithms Steve Lai Mathematical Foudatio CSE 6331 Algorithms Steve Lai Complexity of Algorithms Aalysis of algorithm: to predict the ruig time required by a algorithm. Elemetary operatios: arithmetic & boolea operatios:

More information

Algorithm Analysis. Algorithms that are equally correct can vary in their utilization of computational resources

Algorithm Analysis. Algorithms that are equally correct can vary in their utilization of computational resources Algorithm Aalysis Algorithms that are equally correct ca vary i their utilizatio of computatioal resources time ad memory a slow program it is likely ot to be used a program that demads too much memory

More information

COMP26120: More on the Complexity of Recursive Programs (2018/19) Lucas Cordeiro

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

CS / MCS 401 Homework 3 grader solutions

CS / MCS 401 Homework 3 grader solutions CS / MCS 401 Homework 3 grader solutios assigmet due July 6, 016 writte by Jāis Lazovskis maximum poits: 33 Some questios from CLRS. Questios marked with a asterisk were ot graded. 1 Use the defiitio of

More information

Recurrence Relations

Recurrence Relations Recurrece Relatios Aalysis of recursive algorithms, such as: it factorial (it ) { if (==0) retur ; else retur ( * factorial(-)); } Let t be the umber of multiplicatios eeded to calculate factorial(). The

More information

Department of Informatics Prof. Dr. Michael Böhlen Binzmühlestrasse Zurich Phone:

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

Sums, products and sequences

Sums, products and sequences Sums, products ad sequeces How to write log sums, e.g., 1+2+ (-1)+ cocisely? i=1 Sum otatio ( sum from 1 to ): i 3 = 1 + 2 + + If =3, i=1 i = 1+2+3=6. The ame ii does ot matter. Could use aother letter

More information

Recursive Algorithms. Recurrences. Recursive Algorithms Analysis

Recursive Algorithms. Recurrences. Recursive Algorithms Analysis Recursive Algorithms Recurreces Computer Sciece & Egieerig 35: Discrete Mathematics Christopher M Bourke cbourke@cseuledu A recursive algorithm is oe i which objects are defied i terms of other objects

More information

Recursive Algorithm for Generating Partitions of an Integer. 1 Preliminary

Recursive Algorithm for Generating Partitions of an Integer. 1 Preliminary Recursive Algorithm for Geeratig Partitios of a Iteger Sug-Hyuk Cha Computer Sciece Departmet, Pace Uiversity 1 Pace Plaza, New York, NY 10038 USA scha@pace.edu Abstract. This article first reviews the

More information

Analysis of Algorithms -Quicksort-

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

4.3 Growth Rates of Solutions to Recurrences

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

Sorting Algorithms. Algorithms Kyuseok Shim SoEECS, SNU.

Sorting Algorithms. Algorithms Kyuseok Shim SoEECS, SNU. Sortig Algorithms Algorithms Kyuseo Shim SoEECS, SNU. Desigig Algorithms Icremetal approaches Divide-ad-Coquer approaches Dyamic programmig approaches Greedy approaches Radomized approaches You are ot

More information

Plan. Analysis of Multithreaded Algorithms. Plan. Matrix multiplication. University of Western Ontario, London, Ontario (Canada) Marc Moreno Maza

Plan. Analysis of Multithreaded Algorithms. Plan. Matrix multiplication. University of Western Ontario, London, Ontario (Canada) Marc Moreno Maza Pla Aalysis of Multithreaded Algorithms Marc Moreo Maza Uiversity of Wester Otario, Lodo, Otario (Caada) CS4402-9535 1 2 3 Pla (Moreo Maza) Aalysis of Multithreaded Algorithms CS4402-9535 1 / 27 (Moreo

More information

Data Structures Lecture 9

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

Test One (Answer Key)

Test One (Answer Key) CS395/Ma395 (Sprig 2005) Test Oe Name: Page 1 Test Oe (Aswer Key) CS395/Ma395: Aalysis of Algorithms This is a closed book, closed otes, 70 miute examiatio. It is worth 100 poits. There are twelve (12)

More information

Matriculation number: You have 90 minutes to complete the exam of InformatikIIb. The following rules apply:

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

Data Structures and Algorithm. Xiaoqing Zheng

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

CS 5150/6150: Assignment 1 Due: Sep 23, 2010

CS 5150/6150: Assignment 1 Due: Sep 23, 2010 CS 5150/6150: Assigmet 1 Due: Sep 23, 2010 Wei Liu September 24, 2010 Q1: (1) Usig master theorem: a = 7, b = 4, f() = O(). Because f() = log b a ε holds whe ε = log b a = log 4 7, we ca apply the first

More information

Data Structures and Algorithms

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

Fundamental Algorithms

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

Similar idea to multiplication in N, C. Divide and conquer approach provides unexpected improvements. Naïve matrix multiplication

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

Lecture 3: Divide and Conquer: Fast Fourier Transform

Lecture 3: Divide and Conquer: Fast Fourier Transform Lecture 3: Divide ad Coquer: Fast Fourier Trasform Polyomial Operatios vs. Represetatios Divide ad Coquer Algorithm Collapsig Samples / Roots of Uity FFT, IFFT, ad Polyomial Multiplicatio Polyomial operatios

More information

Divide and Conquer II

Divide and Conquer II Algorithms Divide ad Coquer II Divide ad Coquer II Desig ad Aalsis of Algorithms Adrei Bulatov Algorithms Divide ad Coquer II 6- Closest Pair: The Problem The Closest Pair Problem Istace: poits i the plae

More information

Matrix Multiplication. Data Structures and Algorithms Andrei Bulatov

Matrix Multiplication. Data Structures and Algorithms Andrei Bulatov Matrix Multiplicatio Data Structures ad Algorithms Adrei Bulatov Algorithms Matrix Multiplicatio 7- Matrix Multiplicatio Matrix multiplicatio. Give two -by- matrices A ad B, compute A B. k kj ik ij b a

More information

Divide & Conquer. Divide-and-conquer algorithms. Conventional product of polynomials. Conventional product of polynomials.

Divide & Conquer. Divide-and-conquer algorithms. Conventional product of polynomials. Conventional product of polynomials. Divide-ad-coquer algorithms Divide & Coquer Strategy: Divide the problem ito smaller subproblems of the same type of problem Solve the subproblems recursively Combie the aswers to solve the origial problem

More information

CSI 5163 (95.573) ALGORITHM ANALYSIS AND DESIGN

CSI 5163 (95.573) ALGORITHM ANALYSIS AND DESIGN CSI 5163 (95.573) ALGORITHM ANALYSIS AND DESIGN CSI 5163 (95.5703) ALGORITHM ANALYSIS AND DESIGN (3 cr.) (T) Topics of curret iterest i the desig ad aalysis of computer algorithms for graphtheoretical

More information

Chapter 22 Developing Efficient Algorithms

Chapter 22 Developing Efficient Algorithms Chapter Developig Efficiet Algorithms 1 Executig Time Suppose two algorithms perform the same task such as search (liear search vs. biary search). Which oe is better? Oe possible approach to aswer this

More information

CSE 1400 Applied Discrete Mathematics Number Theory and Proofs

CSE 1400 Applied Discrete Mathematics Number Theory and Proofs CSE 1400 Applied Discrete Mathematics Number Theory ad Proofs Departmet of Computer Scieces College of Egieerig Florida Tech Sprig 01 Problems for Number Theory Backgroud Number theory is the brach of

More information

Chapter 6. Advanced Counting Techniques

Chapter 6. Advanced Counting Techniques Chapter 6 Advaced Coutig Techiques 6.: Recurrece Relatios Defiitio: A recurrece relatio for the sequece {a } is a equatio expressig a i terms of oe or more of the previous terms of the sequece: a,a2,a3,,a

More information

CS 332: Algorithms. Quicksort

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

Introduction to Algorithms

Introduction to Algorithms Itroductio to Algorithms 6.046J/8.40J LECTURE 9 Radomly built biary search trees Epected ode depth Aalyzig height Coveity lemma Jese s iequality Epoetial height Post mortem Pro. Eri Demaie October 7, 2005

More information

1. By using truth tables prove that, for all statements P and Q, the statement

1. By using truth tables prove that, for all statements P and Q, the statement Author: Satiago Salazar Problems I: Mathematical Statemets ad Proofs. By usig truth tables prove that, for all statemets P ad Q, the statemet P Q ad its cotrapositive ot Q (ot P) are equivalet. I example.2.3

More information

Hand Out: Analysis of Algorithms. September 8, Bud Mishra. In general, there can be several algorithms to solve a problem; and one is faced

Hand Out: Analysis of Algorithms. September 8, Bud Mishra. In general, there can be several algorithms to solve a problem; and one is faced Had Out Aalysis of Algorithms September 8, 998 Bud Mishra c Mishra, February 9, 986 Itroductio I geeral, there ca be several algorithms to solve a problem; ad oe is faced with the problem of choosig a

More information

Examples: data compression, path-finding, game-playing, scheduling, bin packing

Examples: data compression, path-finding, game-playing, scheduling, bin packing Algorithms - Basic Cocepts Algorithms so what is a algorithm, ayway? The dictioary defiitio: A algorithm is a well-defied computatioal procedure that takes iput ad produces output. This class will deal

More information

Introduction to Algorithms

Introduction to Algorithms Itroductio to Algorithms 6.046J/8.40J/SMA5503 Lecture 9 Pro. Charles E. Leiserso Biary-search-tree sort T Create a empty BST or i to do TREE-INSERT(T, A[i]) Perorm a iorder tree wal o T. Eample: A [3 8

More information

Mathematics review for CSCI 303 Spring Department of Computer Science College of William & Mary Robert Michael Lewis

Mathematics review for CSCI 303 Spring Department of Computer Science College of William & Mary Robert Michael Lewis Mathematics review for CSCI 303 Sprig 019 Departmet of Computer Sciece College of William & Mary Robert Michael Lewis Copyright 018 019 Robert Michael Lewis Versio geerated: 13 : 00 Jauary 17, 019 Cotets

More information

Algorithms 演算法. Multi-threaded Algorithms

Algorithms 演算法. Multi-threaded Algorithms 演算法 Multi-threaded Professor Chie-Mo James Li 李建模 Graduate Istitute of Electroics Egieerig Natioal aiwa Uiversity Outlie Multithreaded, CH7 7. Basics 7. Matrix Multiplicatio 7.3 Merge sort Leoardo Fiboacci

More information

CHAPTER I: Vector Spaces

CHAPTER I: Vector Spaces CHAPTER I: Vector Spaces Sectio 1: Itroductio ad Examples This first chapter is largely a review of topics you probably saw i your liear algebra course. So why cover it? (1) Not everyoe remembers everythig

More information

Algorithms. Elementary Sorting. Dong Kyue Kim Hanyang University

Algorithms. Elementary Sorting. Dong Kyue Kim Hanyang University Algorithms Elemetary Sortig Dog Kyue Kim Hayag Uiversity dqkim@hayag.a.kr Cotets Sortig problem Elemetary sortig algorithms Isertio sort Merge sort Seletio sort Bubble sort Sortig problem Iput A sequee

More information

Algorithm Analysis. Chapter 3

Algorithm Analysis. Chapter 3 Data Structures Dr Ahmed Rafat Abas Computer Sciece Dept, Faculty of Computer ad Iformatio, Zagazig Uiversity arabas@zu.edu.eg http://www.arsaliem.faculty.zu.edu.eg/ Algorithm Aalysis Chapter 3 3. Itroductio

More information

Exam 2 CMSC 203 Fall 2009 Name SOLUTION KEY Show All Work! 1. (16 points) Circle T if the corresponding statement is True or F if it is False.

Exam 2 CMSC 203 Fall 2009 Name SOLUTION KEY Show All Work! 1. (16 points) Circle T if the corresponding statement is True or F if it is False. 1 (1 poits) Circle T if the correspodig statemet is True or F if it is False T F For ay positive iteger,, GCD(, 1) = 1 T F Every positive iteger is either prime or composite T F If a b mod p, the (a/p)

More information

Polynomial Multiplication and Fast Fourier Transform

Polynomial Multiplication and Fast Fourier Transform Polyomial Multiplicatio ad Fast Fourier Trasform Com S 477/577 Notes Ya-Bi Jia Sep 19, 2017 I this lecture we will describe the famous algorithm of fast Fourier trasform FFT, which has revolutioized digital

More information

CIS 121 Data Structures and Algorithms with Java Spring Code Snippets and Recurrences Monday, February 4/Tuesday, February 5

CIS 121 Data Structures and Algorithms with Java Spring Code Snippets and Recurrences Monday, February 4/Tuesday, February 5 CIS 11 Data Structures ad Algorithms with Java Sprig 019 Code Sippets ad Recurreces Moday, February 4/Tuesday, February 5 Learig Goals Practice provig asymptotic bouds with code sippets Practice solvig

More information

COMP285 Midterm Exam Department of Mathematics

COMP285 Midterm Exam Department of Mathematics COMP85 Midterm Exam Departmet of Mathematics Fall 010/011 - November 8, 010 Name: Studet Number: Please fiish withi 90 miutes. All poits above 100 are cosidered as bous poit. You ca reach maximal 1 poits.

More information

Average-Case Analysis of QuickSort

Average-Case Analysis of QuickSort Average-Case Aalysis of QuickSort Comp 363 Fall Semester 003 October 3, 003 The purpose of this documet is to itroduce the idea of usig recurrece relatios to do average-case aalysis. The average-case ruig

More information

Homework 3. = k 1. Let S be a set of n elements, and let a, b, c be distinct elements of S. The number of k-subsets of S is

Homework 3. = k 1. Let S be a set of n elements, and let a, b, c be distinct elements of S. The number of k-subsets of S is Homewor 3 Chapter 5 pp53: 3 40 45 Chapter 6 p85: 4 6 4 30 Use combiatorial reasoig to prove the idetity 3 3 Proof Let S be a set of elemets ad let a b c be distict elemets of S The umber of -subsets of

More information

Quantum Computing Lecture 7. Quantum Factoring

Quantum Computing Lecture 7. Quantum Factoring Quatum Computig Lecture 7 Quatum Factorig Maris Ozols Quatum factorig A polyomial time quatum algorithm for factorig umbers was published by Peter Shor i 1994. Polyomial time meas that the umber of gates

More information

CSI 2101 Discrete Structures Winter Homework Assignment #4 (100 points, weight 5%) Due: Thursday, April 5, at 1:00pm (in lecture)

CSI 2101 Discrete Structures Winter Homework Assignment #4 (100 points, weight 5%) Due: Thursday, April 5, at 1:00pm (in lecture) CSI 101 Discrete Structures Witer 01 Prof. Lucia Moura Uiversity of Ottawa Homework Assigmet #4 (100 poits, weight %) Due: Thursday, April, at 1:00pm (i lecture) Program verificatio, Recurrece Relatios

More information

Trial division, Pollard s p 1, Pollard s ρ, and Fermat s method. Christopher Koch 1. April 8, 2014

Trial division, Pollard s p 1, Pollard s ρ, and Fermat s method. Christopher Koch 1. April 8, 2014 Iteger Divisio Algorithm ad Cogruece Iteger Trial divisio,,, ad with itegers mod Iverses mod Multiplicatio ad GCD Iteger Christopher Koch 1 1 Departmet of Computer Sciece ad Egieerig CSE489/589 Algorithms

More information

1 Generating functions for balls in boxes

1 Generating functions for balls in boxes Math 566 Fall 05 Some otes o geeratig fuctios Give a sequece a 0, a, a,..., a,..., a geeratig fuctio some way of represetig the sequece as a fuctio. There are may ways to do this, with the most commo ways

More information

CSE 5311 Notes 1: Mathematical Preliminaries

CSE 5311 Notes 1: Mathematical Preliminaries Chapter 1 - Algorithms Computig CSE 5311 Notes 1: Mathematical Prelimiaries Last updated 1/20/18 12:56 PM) Relatioship betwee complexity classes, eg log,, log, 2, 2, etc Chapter 2 - Gettig Started Loop

More information

Divide and Conquer. 1 Overview. 2 Multiplying Bit Strings. COMPSCI 330: Design and Analysis of Algorithms 1/19/2016 and 1/21/2016

Divide and Conquer. 1 Overview. 2 Multiplying Bit Strings. COMPSCI 330: Design and Analysis of Algorithms 1/19/2016 and 1/21/2016 COMPSCI 330: Desig ad Aalysis of Algorithms 1/19/2016 ad 1/21/2016 Lecturer: Debmalya Paigrahi Divide ad Coquer Scribe: Tiaqi Sog 1 Overview I this lecture, a importat algorithm desig techique called divide-ad-coquer

More information

Signals & Systems Chapter3

Signals & Systems Chapter3 Sigals & Systems Chapter3 1.2 Discrete-Time (D-T) Sigals Electroic systems do most of the processig of a sigal usig a computer. A computer ca t directly process a C-T sigal but istead eeds a stream of

More information

Lecture 3: Asymptotic Analysis + Recurrences

Lecture 3: Asymptotic Analysis + Recurrences Lecture 3: Asymptotic Aalysis + Recurreces Data Structures ad Algorithms CSE 373 SU 18 BEN JONES 1 Warmup Write a model ad fid Big-O for (it i = 0; i < ; i++) { for (it j = 0; j < i; j++) { System.out.pritl(

More information

An Introduction to Randomized Algorithms

An Introduction to Randomized Algorithms A Itroductio to Radomized Algorithms The focus of this lecture is to study a radomized algorithm for quick sort, aalyze it usig probabilistic recurrece relatios, ad also provide more geeral tools for aalysis

More information

Generating Functions II

Generating Functions II Geeratig Fuctios II Misha Lavrov ARML Practice 5/4/2014 Warm-up problems 1. Solve the recursio a +1 = 2a, a 0 = 1 by usig commo sese. 2. Solve the recursio b +1 = 2b + 1, b 0 = 1 by usig commo sese ad

More information

Cache-Efficient Algorithms II

Cache-Efficient Algorithms II 6.172 Performace Egieerig of Software Systems LECTURE 9 Cache-Efficiet Algorithms II Charles E. Leiserso October 7, 2010 2010 Charles E. Leiserso 1 Ideal-Cache Model Features Two-level hierarchy. Cache

More information

Sequences A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

Sequences A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence Sequeces A sequece of umbers is a fuctio whose domai is the positive itegers. We ca see that the sequece 1, 1, 2, 2, 3, 3,... is a fuctio from the positive itegers whe we write the first sequece elemet

More information

In number theory we will generally be working with integers, though occasionally fractions and irrationals will come into play.

In number theory we will generally be working with integers, though occasionally fractions and irrationals will come into play. Number Theory Math 5840 otes. Sectio 1: Axioms. I umber theory we will geerally be workig with itegers, though occasioally fractios ad irratioals will come ito play. Notatio: Z deotes the set of all itegers

More information

APPENDIX F Complex Numbers

APPENDIX F Complex Numbers APPENDIX F Complex Numbers Operatios with Complex Numbers Complex Solutios of Quadratic Equatios Polar Form of a Complex Number Powers ad Roots of Complex Numbers Operatios with Complex Numbers Some equatios

More information

We are mainly going to be concerned with power series in x, such as. (x)} converges - that is, lims N n

We are mainly going to be concerned with power series in x, such as. (x)} converges - that is, lims N n Review of Power Series, Power Series Solutios A power series i x - a is a ifiite series of the form c (x a) =c +c (x a)+(x a) +... We also call this a power series cetered at a. Ex. (x+) is cetered at

More information

+ au n+1 + bu n = 0.)

+ au n+1 + bu n = 0.) Lecture 6 Recurreces - kth order: u +k + a u +k +... a k u k 0 where a... a k are give costats, u 0... u k are startig coditios. (Simple case: u + au + + bu 0.) How to solve explicitly - first, write characteristic

More information

Assignment 5: Solutions

Assignment 5: Solutions McGill Uiversity Departmet of Mathematics ad Statistics MATH 54 Aalysis, Fall 05 Assigmet 5: Solutios. Let y be a ubouded sequece of positive umbers satisfyig y + > y for all N. Let x be aother sequece

More information

A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence Sequeces A sequece of umbers is a fuctio whose domai is the positive itegers. We ca see that the sequece,, 2, 2, 3, 3,... is a fuctio from the positive itegers whe we write the first sequece elemet as

More information

Inverse Matrix. A meaning that matrix B is an inverse of matrix A.

Inverse Matrix. A meaning that matrix B is an inverse of matrix A. Iverse Matrix Two square matrices A ad B of dimesios are called iverses to oe aother if the followig holds, AB BA I (11) The otio is dual but we ofte write 1 B A meaig that matrix B is a iverse of matrix

More information

Intensive Algorithms Lecture 11. DFT and DP. Lecturer: Daniel A. Spielman February 20, f(n) O(g(n) log c g(n)).

Intensive Algorithms Lecture 11. DFT and DP. Lecturer: Daniel A. Spielman February 20, f(n) O(g(n) log c g(n)). Itesive Algorithms Lecture 11 DFT ad DP Lecturer: Daiel A. Spielma February 20, 2018 11.1 Itroductio The purpose of this lecture is to lear how use the Discrete Fourier Trasform to save space i Dyamic

More information

2.4 - Sequences and Series

2.4 - Sequences and Series 2.4 - Sequeces ad Series Sequeces A sequece is a ordered list of elemets. Defiitio 1 A sequece is a fuctio from a subset of the set of itegers (usually either the set 80, 1, 2, 3,... < or the set 81, 2,

More information

) n. ALG 1.3 Deterministic Selection and Sorting: Problem P size n. Examples: 1st lecture's mult M(n) = 3 M ( È

) n. ALG 1.3 Deterministic Selection and Sorting: Problem P size n. Examples: 1st lecture's mult M(n) = 3 M ( È Algorithms Professor Joh Reif ALG 1.3 Determiistic Selectio ad Sortig: (a) Selectio Algorithms ad Lower Bouds (b) Sortig Algorithms ad Lower Bouds Problem P size fi divide ito subproblems size 1,..., k

More information

A Probabilistic Analysis of Quicksort

A Probabilistic Analysis of Quicksort A Probabilistic Aalysis of Quicsort You are assumed to be familiar with Quicsort. I each iteratio this sortig algorithm chooses a pivot ad the, by performig comparisios with the pivot, splits the remaider

More information

Analysis of Algorithms. Introduction. Contents

Analysis of Algorithms. Introduction. Contents Itroductio The focus of this module is mathematical aspects of algorithms. Our mai focus is aalysis of algorithms, which meas evaluatig efficiecy of algorithms by aalytical ad mathematical methods. We

More information

SECTION 1.5 : SUMMATION NOTATION + WORK WITH SEQUENCES

SECTION 1.5 : SUMMATION NOTATION + WORK WITH SEQUENCES SECTION 1.5 : SUMMATION NOTATION + WORK WITH SEQUENCES Read Sectio 1.5 (pages 5 9) Overview I Sectio 1.5 we lear to work with summatio otatio ad formulas. We will also itroduce a brief overview of sequeces,

More information

Lecture 2 Clustering Part II

Lecture 2 Clustering Part II COMS 4995: Usupervised Learig (Summer 8) May 24, 208 Lecture 2 Clusterig Part II Istructor: Nakul Verma Scribes: Jie Li, Yadi Rozov Today, we will be talkig about the hardess results for k-meas. More specifically,

More information

TEACHER CERTIFICATION STUDY GUIDE

TEACHER CERTIFICATION STUDY GUIDE COMPETENCY 1. ALGEBRA SKILL 1.1 1.1a. ALGEBRAIC STRUCTURES Kow why the real ad complex umbers are each a field, ad that particular rigs are ot fields (e.g., itegers, polyomial rigs, matrix rigs) Algebra

More information

OPTIMAL ALGORITHMS -- SUPPLEMENTAL NOTES

OPTIMAL ALGORITHMS -- SUPPLEMENTAL NOTES OPTIMAL ALGORITHMS -- SUPPLEMENTAL NOTES Peter M. Maurer Why Hashig is θ(). As i biary search, hashig assumes that keys are stored i a array which is idexed by a iteger. However, hashig attempts to bypass

More information

Math 2112 Solutions Assignment 5

Math 2112 Solutions Assignment 5 Math 2112 Solutios Assigmet 5 5.1.1 Idicate which of the followig relatioships are true ad which are false: a. Z Q b. R Q c. Q Z d. Z Z Z e. Q R Q f. Q Z Q g. Z R Z h. Z Q Z a. True. Every positive iteger

More information

CHAPTER 1 SEQUENCES AND INFINITE SERIES

CHAPTER 1 SEQUENCES AND INFINITE SERIES CHAPTER SEQUENCES AND INFINITE SERIES SEQUENCES AND INFINITE SERIES (0 meetigs) Sequeces ad limit of a sequece Mootoic ad bouded sequece Ifiite series of costat terms Ifiite series of positive terms Alteratig

More information

Lecture 20. Brief Review of Gram-Schmidt and Gauss s Algorithm

Lecture 20. Brief Review of Gram-Schmidt and Gauss s Algorithm 8.409 A Algorithmist s Toolkit Nov. 9, 2009 Lecturer: Joatha Keler Lecture 20 Brief Review of Gram-Schmidt ad Gauss s Algorithm Our mai task of this lecture is to show a polyomial time algorithm which

More information

CHAPTER 5. Theory and Solution Using Matrix Techniques

CHAPTER 5. Theory and Solution Using Matrix Techniques A SERIES OF CLASS NOTES FOR 2005-2006 TO INTRODUCE LINEAR AND NONLINEAR PROBLEMS TO ENGINEERS, SCIENTISTS, AND APPLIED MATHEMATICIANS DE CLASS NOTES 3 A COLLECTION OF HANDOUTS ON SYSTEMS OF ORDINARY DIFFERENTIAL

More information

CS:3330 (Prof. Pemmaraju ): Assignment #1 Solutions. (b) For n = 3, we will have 3 men and 3 women with preferences as follows: m 1 : w 3 > w 1 > w 2

CS:3330 (Prof. Pemmaraju ): Assignment #1 Solutions. (b) For n = 3, we will have 3 men and 3 women with preferences as follows: m 1 : w 3 > w 1 > w 2 Shiyao Wag CS:3330 (Prof. Pemmaraju ): Assigmet #1 Solutios Problem 1 (a) Cosider iput with me m 1, m,..., m ad wome w 1, w,..., w with the followig prefereces: All me have the same prefereces for wome:

More information

Sect 5.3 Proportions

Sect 5.3 Proportions Sect 5. Proportios Objective a: Defiitio of a Proportio. A proportio is a statemet that two ratios or two rates are equal. A proportio takes a form that is similar to a aalogy i Eglish class. For example,

More information

CSE 202 Homework 1 Matthias Springer, A Yes, there does always exist a perfect matching without a strong instability.

CSE 202 Homework 1 Matthias Springer, A Yes, there does always exist a perfect matching without a strong instability. CSE 0 Homework 1 Matthias Spriger, A9950078 1 Problem 1 Notatio a b meas that a is matched to b. a < b c meas that b likes c more tha a. Equality idicates a tie. Strog istability Yes, there does always

More information

Homework 1 Solutions. The exercises are from Foundations of Mathematical Analysis by Richard Johnsonbaugh and W.E. Pfaffenberger.

Homework 1 Solutions. The exercises are from Foundations of Mathematical Analysis by Richard Johnsonbaugh and W.E. Pfaffenberger. Homewor 1 Solutios Math 171, Sprig 2010 Hery Adams The exercises are from Foudatios of Mathematical Aalysis by Richard Johsobaugh ad W.E. Pfaffeberger. 2.2. Let h : X Y, g : Y Z, ad f : Z W. Prove that

More information