ITEC 360 Data Structures and Analysis of Algorithms Spring for n 1

Size: px
Start display at page:

Download "ITEC 360 Data Structures and Analysis of Algorithms Spring for n 1"

Transcription

1 ITEC 360 Data Structures ad Aalysis of Algorithms Sprig Prove that f () = is Θ ( ) = 66 for 1 Take C 1 = 66 f () = is O( ) Sice for 1 If we take C = 60 f () = is Ω ( ) Sice f () is O ( ) ad f () is Ω ( ), therefore f () is Θ ( ).. Prove that f() = a k k + a k-1 k a 1 + a 0 is Θ ( k ). Let C = a k + a k a 1 + a 0. The a k k + a k-1 k a 1 + a 0 a k k + a k-1 k +. + a 1 k + a 0 k = (a k + a k a 1 + a 0 ) k = C k Therefore, f() = a k k + a k-1 k a 1 + a 0 is O( k ) Sice a k k + a k-1 k a 1 + a 0 a k k f() = a k k + a k-1 k a 1 + a 0 is Ω ( k ) Thus f() = a k k + a k-1 k a 1 + a 0 is Θ ( k )

2 3. Prove that f() = 1 k + k +. + k is Θ ( k+1 ) If k is a positive iteger ad replace each iteger 1,,, by We have 1 k + k +. + k k + k + + k =. k = k+1 for 1; Hece f() = 1 k + k +. + k is O ( k+1 ) We ca obtai the lower boud, throwig away the first half of the terms 1 k + k +. + k / k + + (-1) k + k / k + + / So we ca coclude that = ( +1) / f() = 1 k + k +. + k is Ω ( k+1 ). k / k k k + / (/) (/) k = k+1 / k+1. Hece f() = 1 k + k +. + k is Θ ( k+1 ) 4. Prove that f() = lg! is Θ ( lg ). Sice! =. (-1)..,. 1 ad lg a. b = lg a + lg b lg! = lg + lg (-1) + + lg + lg 1 lg + lg (-1) + + lg + lg 1 lg + lg + + lg + lg = lg We ca coclude that lg! is O ( lg ). lg + lg (-1) + + lg + lg 1 lg + lg (-1) + + lg / lg / + lg / + + lg / ( +1) / lg / (/) lg (/)

3 Therefore, By mathematical iductio we ca show that if 4, (/) lg (/) ( lg ) / 4. I the last two iequalities, lg + lg (-1) + + lg + lg 1 ( lg ) / 4 for 4. So fially it follows that lg! is Ω ( lg ). lg! is Θ ( lg ). 5. Assumig that f 1 () is O (g 1 ()) ad f () is O (g ()), prove the followig statemets: a. f 1 () + f () is O (max (g 1 (), g ))). b. If a umber k ca be determied such that for all > k, g 1 () g (), the O (g 1 ()) + O(g ()) is O(g ()). c. f 1 () * f () is O(g 1 () * g ()) (rule of product). d. O(cg()) is O(g()). e. c is O(1). I the followig aswers, these two defiitios are used: f 1 () is O(g 1 ()) if there exist positive umbers c 1 ad N 1 such that f 1 () c 1 g 1 () for all > N 1 ; f () is O(g ()) if there exist positive umbers c ad N such that f () c g () for all > N ; (a) From the above defiitios we have f 1 () c 1. max (g 1 (), g ()) for all max ( N 1, N ) f () c. max (g 1 (), g ()) for all max ( N 1, N ) which implies that f 1 () + f () ( c1+ c ) max (g 1 (), g ()) for all max ( N1, N ) Hece for c 3 = c 1 + c ad N 3 = max (N 1, N ), f 1 ()+ f () c 3. max (g 1 (), g ()) for all N that is f 1 ()+ f () is O(max (g 1 (), g ()). 3

4 (b) If g 1 () g (), the for c = max (c 1+ c ), c g 1 () c g (), c g 1 () + c g () c g() which implies that O(g 1 ()) + O(g ()) is O(g ()). (c) The rule of product, f 1 (). f () is O(g 1 ().g ()) is true sice f 1 (). f () c 1 c g 1 (). g ()) for all max ( N1, N ) (d) O (cg()) is (O(g()) meas that ay fuctio f which is O(cg) is also O(g). Fuctio f is O(cg) if there are two costats c 1 ad N so that f () c 1 cg() for all N; i this case, for a costat c = c 1 c, f () c g(); thus by choosig properly a costat c (whose value depeds o the value of c ad c 1 ), f is O(g). (e) A costat c is O (1) if there exist positive umbers c 1 ad N such that c c 1. 1 for all N; that is, the costat fuctio c is idepedet of, ad we ca simply set c 1 = c. 6. Assumig that f 1 () is O (g 1 ()) ad f () is O (g ()), Fid couter examples refute the followig statemet: f 1 () - f () is O (g 1 () g ()). Let f 1 () = a 1 ad f () = a, the f 1 () ad f () are O (). But f 1 () - f () = (a 1 a ) is ot O( ) = O(0). Hece f 1 () - f () is ot O (g 1 () g ()). 7. Fid the complexity of the fuctio used to fid the kth smallest iteger i a uordered array of itegers it selectkth(it a[], it k, it ) { it i, j, mii, tmp; for (i = 0; i < k; i++) { mii = i; for (j = i+1; j < ; j++) if (a[j]<a[mii]) mii = j; tmp = a[i]; a[i] = a[mii]; a[mii] = tmp; retur a[k-1]; The complexity of selectkth ( ) is (-1) + (-) + + (-k) = ( k - 1) k / = O( )

5 8. Determie the complexity of the followig implemetatios of the algorithms for addig, multiplyig, ad trasposig matrices: Aswer: for (i = 0; i < ; i++) for (j = 0; j < ; j++) a[i][j] = b[i][j] + c[i][j]; for (i = 0; i < ; i++) for (j = 0; j < ; j++) for (k = a[i][j] = 0; k < ; k++) a[i][j] += b[i][k] * c[k][j]; for (i = 0; i < - 1; i++) for (j = i+1; j < ; j++) { tmp = a[i][j]; a[i][j] = a[j][i]; a[j][i] = tmp; The algorithm for addig matrices requires assigmets. Note that the couter i for the ier loop does ot deped o the couter j for the outer loop ad both of them take values 0,..., - 1. All three couters, i, j ad k, i the algorithm for matrix multiplicatio are also idepedet of each other, hece the complexity of the algorithms is 3. To traspose a matrix, i= j= i+ 1 = O( ) assigmets are required. 9. Fid the computatioal complexity for the followig four loops: a. for (ct1 = 0, i = 1; i <= ; i++) for (j = 1; j <= ; j++) ct1++; b. for (ct = 0, i = 1; i <= ; i++) for (j = 1; j <= i; j++) ct++; c. for (ct3 = 0, i = 1; i <= ; i *= ) for (j = 1; j <= ; j++) ct3++;

6 d. for (ct4 = 0, i = 1; i <= ; i *= ) for (j = 1; j <= i; j++) ct4++; Aswer: (a) The auto-icremet ct++ is executed exactly times. (b) i = 1 i = O( ); lg i = 1 (c) i = Θ( lg ) lg = (d) i = Θ() i Fid the average case complexity of sequetial search i a array if the probability of accessig the last cell equals ½ the probability of the ext to last cell equals ¼, ad the probability of locatig a umber i ay of the remaiig cells is the same ad equal to 1. 4( ) Aswer: ( ) 4( ) ( 1) = = IMPORTANT NOTE Study problems of exercises i pages of chapter.

7 Exact Aalysis Rules 1. We assume a arbitrary time uit.. Executio of oe of the followig operatios takes time 1: a) assigmet operatio b) sigle I/O operatios c) sigle Boolea operatios, umeric comparisos d) sigle arithmetic operatios e) fuctio retur 3. Ruig time of a selectio statemet (if, switch) is the time for the coditio evaluatio + the maximum of the ruig times for the idividual clauses i the selectio. 4. Loop executio time is the sum, over the umber of times the loop is executed, of the body time + time for the loop check ad update operatios, + time for the loop setup. Always assume that the loop executes the maximum umber of iteratios possible 5. Ruig time of a fuctio call is 1 for setup + the time for ay parameter calculatios + the time required for the executio of the fuctio body. Aalysis Example 1 Give: for (i = 0; i < -1; i++) { for (j = 0; j < i; j++) { aray[i][j] = 0; Rules 4 ad a: time 1 before loop Rules 4, c ad d: time 3 o each iteratio of outer loop, ad oe more test Rules 4 ad a: time 1 o each iteratio of outer loop for (i = 0; i < -1; i++) { for (j = 0; j < i; j++) { aray[i][j] = 0; So, the total time T() is give by: 1 i T ( ) = = i= 1 j= 1 3 Rules 4, c ad d: time (o each iteratio of ier loop) ad oe more test Rule a: time 1 o each pass of ier loop 7 + 3

8 Aalysis Example Rules 4 ad a: time 1 before loop Rule a: time 1 before loop Rules 4 ad a: time 1 o each iteratio of outer loop Sum = 0; for (k = 1; k <= ; k = *k) { for (j = 1; j <= ; j++) { Sum++; Rules 4, c ad d: time 3 o each iteratio of outer loop, plus oe more test Rules 4, c ad d: time (o each iteratio of ier loop) plus oe more test Rule a: time 1 o each pass of ier loop The tricky part is that the outer loop will be executed log() times assumig is a power of. So, the total time T() is give by: log T ( ) = k = 1 j= 1 Aalysis Example = 3 log + 5log + 3 How does this compare to the previous result? Rule a: time 1 before loop Sum = 0; I >> Value; while ( I ) { Rule b: time 1 before loop Rule c: time 1 at begiig of each pass, ad oce more Rule c: time 1 o each pass Rules ad: time, if doe if ( Value < 0 ) { Sum = -Sum; Sum = Sum + Value; else { Sum = Sum + Value; I >> Value; Rules ad: time, if doe Rules ad: time, if doe Rules ad: time 1 o each pass So, assumig iput values are received, the total time T() is give by: T ( ) = + k = 1 ( 3 + max( 4, )) + 1 = 7 + 3

9 Big-O Example Take the fuctio obtaied i the algorithm aalysis example earlier: 3 5 T ( ) = + 3 Ituitively, oe should expect that this fuctio grows similarly to. To show that, we will shortly prove that: 5 < 5 for all 1 ad that 3 < for all 1 Why? Because the we ca argue by substitutio (of o-equal quatities): T ( ) = = for all 1 Thus, applyig the defiitio with C = 15/ ad N = 1, T() is O( ).

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

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

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

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

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

Advanced Course of Algorithm Design and Analysis

Advanced Course of Algorithm Design and Analysis Differet complexity measures Advaced Course of Algorithm Desig ad Aalysis Asymptotic complexity Big-Oh otatio Properties of O otatio Aalysis of simple algorithms A algorithm may may have differet executio

More information

Design and Analysis of ALGORITHM (Topic 2)

Design and Analysis of ALGORITHM (Topic 2) DR. Gatot F. Hertoo, MSc. Desig ad Aalysis of ALGORITHM (Topic 2) Algorithms + Data Structures = Programs Lessos Leared 1 Our Machie Model: Assumptios Geeric Radom Access Machie (RAM) Executes operatios

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

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

CSE 4095/5095 Topics in Big Data Analytics Spring 2017; Homework 1 Solutions

CSE 4095/5095 Topics in Big Data Analytics Spring 2017; Homework 1 Solutions CSE 09/09 Topics i ig Data Aalytics Sprig 2017; Homework 1 Solutios Note: Solutios to problems,, ad 6 are due to Marius Nicolae. 1. Cosider the followig algorithm: for i := 1 to α log e do Pick a radom

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

CS161 Design and Analysis of Algorithms. Administrative

CS161 Design and Analysis of Algorithms. Administrative CS161 Desig ad Aalysis of Algorithms Da Boeh 1 Admiistrative Lecture 1, April 3, 1 Web page http://theory.staford.edu/~dabo/cs161» Hadouts» Aoucemets» Late breakig ews Gradig ad course requiremets» Midterm/fial/hw»

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

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

Sequences and Series of Functions

Sequences and Series of Functions Chapter 6 Sequeces ad Series of Fuctios 6.1. Covergece of a Sequece of Fuctios Poitwise Covergece. Defiitio 6.1. Let, for each N, fuctio f : A R be defied. If, for each x A, the sequece (f (x)) coverges

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

Math F215: Induction April 7, 2013

Math F215: Induction April 7, 2013 Math F25: Iductio April 7, 203 Iductio is used to prove that a collectio of statemets P(k) depedig o k N are all true. A statemet is simply a mathematical phrase that must be either true or false. Here

More information

MATH301 Real Analysis (2008 Fall) Tutorial Note #7. k=1 f k (x) converges pointwise to S(x) on E if and

MATH301 Real Analysis (2008 Fall) Tutorial Note #7. k=1 f k (x) converges pointwise to S(x) on E if and MATH01 Real Aalysis (2008 Fall) Tutorial Note #7 Sequece ad Series of fuctio 1: Poitwise Covergece ad Uiform Covergece Part I: Poitwise Covergece Defiitio of poitwise covergece: A sequece of fuctios f

More information

Ch3. Asymptotic Notation

Ch3. Asymptotic Notation Ch. Asymptotic Notatio copyright 006 Preview of Chapters Chapter How to aalyze the space ad time complexities of program Chapter Review asymptotic otatios such as O, Ω, Θ, o for simplifyig the aalysis

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

Matrix Algebra 2.2 THE INVERSE OF A MATRIX Pearson Education, Inc.

Matrix Algebra 2.2 THE INVERSE OF A MATRIX Pearson Education, Inc. 2 Matrix Algebra 2.2 THE INVERSE OF A MATRIX MATRIX OPERATIONS A matrix A is said to be ivertible if there is a matrix C such that CA = I ad AC = I where, the idetity matrix. I = I I this case, C is a

More information

Sequences, Mathematical Induction, and Recursion. CSE 2353 Discrete Computational Structures Spring 2018

Sequences, Mathematical Induction, and Recursion. CSE 2353 Discrete Computational Structures Spring 2018 CSE 353 Discrete Computatioal Structures Sprig 08 Sequeces, Mathematical Iductio, ad Recursio (Chapter 5, Epp) Note: some course slides adopted from publisher-provided material Overview May mathematical

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

11.5 Alternating Series, Absolute and Conditional Convergence

11.5 Alternating Series, Absolute and Conditional Convergence .5.5 Alteratig Series, Absolute ad Coditioal Covergece We have see that the harmoic series diverges. It may come as a surprise the to lear that ) 2 + 3 4 + + )+ + = ) + coverges. To see this, let s be

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

Seunghee Ye Ma 8: Week 5 Oct 28

Seunghee Ye Ma 8: Week 5 Oct 28 Week 5 Summary I Sectio, we go over the Mea Value Theorem ad its applicatios. I Sectio 2, we will recap what we have covered so far this term. Topics Page Mea Value Theorem. Applicatios of the Mea Value

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

Read carefully the instructions on the answer book and make sure that the particulars required are entered on each answer book.

Read carefully the instructions on the answer book and make sure that the particulars required are entered on each answer book. THE UNIVERSITY OF WARWICK FIRST YEAR EXAMINATION: Jauary 2009 Aalysis I Time Allowed:.5 hours Read carefully the istructios o the aswer book ad make sure that the particulars required are etered o each

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

Solutions for Math 411 Assignment #8 1

Solutions for Math 411 Assignment #8 1 Solutios for Math Assigmet #8 A8. Fid the Lauret series of f() 3 2 + i (a) { < }; (b) { < < }; (c) { < 2 < 3}; (d) {0 < + < 2}. Solutio. We write f() as a sum of partial fractios: f() 3 2 + ( ) 2 ( + )

More information

CS161: Algorithm Design and Analysis Handout #10 Stanford University Wednesday, 10 February 2016

CS161: Algorithm Design and Analysis Handout #10 Stanford University Wednesday, 10 February 2016 CS161: Algorithm Desig ad Aalysis Hadout #10 Staford Uiversity Wedesday, 10 February 2016 Lecture #11: Wedesday, 10 February 2016 Topics: Example midterm problems ad solutios from a log time ago Sprig

More information

Parallel Vector Algorithms David A. Padua

Parallel Vector Algorithms David A. Padua Parallel Vector Algorithms 1 of 32 Itroductio Next, we study several algorithms where parallelism ca be easily expressed i terms of array operatios. We will use Fortra 90 to represet these algorithms.

More information

REVIEW 1, MATH n=1 is convergent. (b) Determine whether a n is convergent.

REVIEW 1, MATH n=1 is convergent. (b) Determine whether a n is convergent. REVIEW, MATH 00. Let a = +. a) Determie whether the sequece a ) is coverget. b) Determie whether a is coverget.. Determie whether the series is coverget or diverget. If it is coverget, fid its sum. a)

More information

x a x a Lecture 2 Series (See Chapter 1 in Boas)

x a x a Lecture 2 Series (See Chapter 1 in Boas) Lecture Series (See Chapter i Boas) A basic ad very powerful (if pedestria, recall we are lazy AD smart) way to solve ay differetial (or itegral) equatio is via a series expasio of the correspodig solutio

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

COMP26120: Introducing Complexity Analysis (2018/19) Lucas Cordeiro

COMP26120: Introducing Complexity Analysis (2018/19) Lucas Cordeiro COMP60: Itroduig Complexity Aalysis (08/9) Luas Cordeiro luas.ordeiro@mahester.a.uk Itroduig Complexity Aalysis Textbook: Algorithm Desig ad Appliatios, Goodrih, Mihael T. ad Roberto Tamassia (hapter )

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

SCORE. Exam 2. MA 114 Exam 2 Fall 2016

SCORE. Exam 2. MA 114 Exam 2 Fall 2016 MA 4 Exam Fall 06 Exam Name: Sectio ad/or TA: Do ot remove this aswer page you will retur the whole exam. You will be allowed two hours to complete this test. No books or otes may be used. You may use

More information

Topics. Homework Problems. MATH 301 Introduction to Analysis Chapter Four Sequences. 1. Definition of convergence of sequences.

Topics. Homework Problems. MATH 301 Introduction to Analysis Chapter Four Sequences. 1. Definition of convergence of sequences. MATH 301 Itroductio to Aalysis Chapter Four Sequeces Topics 1. Defiitio of covergece of sequeces. 2. Fidig ad provig the limit of sequeces. 3. Bouded covergece theorem: Theorem 4.1.8. 4. Theorems 4.1.13

More information

Introduction to Computational Biology Homework 2 Solution

Introduction to Computational Biology Homework 2 Solution Itroductio to Computatioal Biology Homework 2 Solutio Problem 1: Cocave gap pealty fuctio Let γ be a gap pealty fuctio defied over o-egative itegers. The fuctio γ is called sub-additive iff it satisfies

More information

Signals and Systems. Problem Set: From Continuous-Time to Discrete-Time

Signals and Systems. Problem Set: From Continuous-Time to Discrete-Time Sigals ad Systems Problem Set: From Cotiuous-Time to Discrete-Time Updated: October 5, 2017 Problem Set Problem 1 - Liearity ad Time-Ivariace Cosider the followig systems ad determie whether liearity ad

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

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

sin(n) + 2 cos(2n) n 3/2 3 sin(n) 2cos(2n) n 3/2 a n =

sin(n) + 2 cos(2n) n 3/2 3 sin(n) 2cos(2n) n 3/2 a n = 60. Ratio ad root tests 60.1. Absolutely coverget series. Defiitio 13. (Absolute covergece) A series a is called absolutely coverget if the series of absolute values a is coverget. The absolute covergece

More information

INFINITE SEQUENCES AND SERIES

INFINITE SEQUENCES AND SERIES 11 INFINITE SEQUENCES AND SERIES INFINITE SEQUENCES AND SERIES 11.4 The Compariso Tests I this sectio, we will lear: How to fid the value of a series by comparig it with a kow series. COMPARISON TESTS

More information

Solutions to Tutorial 3 (Week 4)

Solutions to Tutorial 3 (Week 4) The Uiversity of Sydey School of Mathematics ad Statistics Solutios to Tutorial Week 4 MATH2962: Real ad Complex Aalysis Advaced Semester 1, 2017 Web Page: http://www.maths.usyd.edu.au/u/ug/im/math2962/

More information

Randomized Algorithms I, Spring 2018, Department of Computer Science, University of Helsinki Homework 1: Solutions (Discussed January 25, 2018)

Randomized Algorithms I, Spring 2018, Department of Computer Science, University of Helsinki Homework 1: Solutions (Discussed January 25, 2018) Radomized Algorithms I, Sprig 08, Departmet of Computer Sciece, Uiversity of Helsiki Homework : Solutios Discussed Jauary 5, 08). Exercise.: Cosider the followig balls-ad-bi game. We start with oe black

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

Math 113, Calculus II Winter 2007 Final Exam Solutions

Math 113, Calculus II Winter 2007 Final Exam Solutions Math, Calculus II Witer 7 Fial Exam Solutios (5 poits) Use the limit defiitio of the defiite itegral ad the sum formulas to compute x x + dx The check your aswer usig the Evaluatio Theorem Solutio: I this

More information

Principle Of Superposition

Principle Of Superposition ecture 5: PREIMINRY CONCEP O RUCUR NYI Priciple Of uperpositio Mathematically, the priciple of superpositio is stated as ( a ) G( a ) G( ) G a a or for a liear structural system, the respose at a give

More information

Ma 530 Introduction to Power Series

Ma 530 Introduction to Power Series Ma 530 Itroductio to Power Series Please ote that there is material o power series at Visual Calculus. Some of this material was used as part of the presetatio of the topics that follow. What is a Power

More information

6.3 Testing Series With Positive Terms

6.3 Testing Series With Positive Terms 6.3. TESTING SERIES WITH POSITIVE TERMS 307 6.3 Testig Series With Positive Terms 6.3. Review of what is kow up to ow I theory, testig a series a i for covergece amouts to fidig the i= sequece of partial

More information

Infinite Sequences and Series

Infinite Sequences and Series Chapter 6 Ifiite Sequeces ad Series 6.1 Ifiite Sequeces 6.1.1 Elemetary Cocepts Simply speakig, a sequece is a ordered list of umbers writte: {a 1, a 2, a 3,...a, a +1,...} where the elemets a i represet

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

62. Power series Definition 16. (Power series) Given a sequence {c n }, the series. c n x n = c 0 + c 1 x + c 2 x 2 + c 3 x 3 +

62. Power series Definition 16. (Power series) Given a sequence {c n }, the series. c n x n = c 0 + c 1 x + c 2 x 2 + c 3 x 3 + 62. Power series Defiitio 16. (Power series) Give a sequece {c }, the series c x = c 0 + c 1 x + c 2 x 2 + c 3 x 3 + is called a power series i the variable x. The umbers c are called the coefficiets of

More information

Bertrand s Postulate

Bertrand s Postulate Bertrad s Postulate Lola Thompso Ross Program July 3, 2009 Lola Thompso (Ross Program Bertrad s Postulate July 3, 2009 1 / 33 Bertrad s Postulate I ve said it oce ad I ll say it agai: There s always a

More information

SEQUENCES AND SERIES

SEQUENCES AND SERIES 9 SEQUENCES AND SERIES INTRODUCTION Sequeces have may importat applicatios i several spheres of huma activities Whe a collectio of objects is arraged i a defiite order such that it has a idetified first

More information

Math 116 Practice for Exam 3

Math 116 Practice for Exam 3 Math 6 Practice for Eam 3 Geerated April 4, 26 Name: SOLUTIONS Istructor: Sectio Number:. This eam has questios. Note that the problems are ot of equal difficulty, so you may wat to skip over ad retur

More information

j=1 dz Res(f, z j ) = 1 d k 1 dz k 1 (z c)k f(z) Res(f, c) = lim z c (k 1)! Res g, c = f(c) g (c)

j=1 dz Res(f, z j ) = 1 d k 1 dz k 1 (z c)k f(z) Res(f, c) = lim z c (k 1)! Res g, c = f(c) g (c) Problem. Compute the itegrals C r d for Z, where C r = ad r >. Recall that C r has the couter-clockwise orietatio. Solutio: We will use the idue Theorem to solve this oe. We could istead use other (perhaps

More information

Math 61CM - Solutions to homework 3

Math 61CM - Solutions to homework 3 Math 6CM - Solutios to homework 3 Cédric De Groote October 2 th, 208 Problem : Let F be a field, m 0 a fixed oegative iteger ad let V = {a 0 + a x + + a m x m a 0,, a m F} be the vector space cosistig

More information

Chapter 2. Asymptotic Notation

Chapter 2. Asymptotic Notation Asyptotic Notatio 3 Chapter Asyptotic Notatio Goal : To siplify the aalysis of ruig tie by gettig rid of details which ay be affected by specific ipleetatio ad hardware. [1] The Big Oh (O-Notatio) : It

More information

Optimally Sparse SVMs

Optimally Sparse SVMs A. Proof of Lemma 3. We here prove a lower boud o the umber of support vectors to achieve geeralizatio bouds of the form which we cosider. Importatly, this result holds ot oly for liear classifiers, but

More information

Fall 2013 MTH431/531 Real analysis Section Notes

Fall 2013 MTH431/531 Real analysis Section Notes Fall 013 MTH431/531 Real aalysis Sectio 8.1-8. Notes Yi Su 013.11.1 1. Defiitio of uiform covergece. We look at a sequece of fuctios f (x) ad study the coverget property. Notice we have two parameters

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms Desig ad Aalysis of Algorithms Probabilistic aalysis ad Radomized algorithms Referece: CLRS Chapter 5 Topics: Hirig problem Idicatio radom variables Radomized algorithms Huo Hogwei 1 The hirig problem

More information

Arkansas Tech University MATH 2924: Calculus II Dr. Marcel B. Finan

Arkansas Tech University MATH 2924: Calculus II Dr. Marcel B. Finan Arkasas Tech Uiversity MATH 94: Calculus II Dr Marcel B Fia 85 Power Series Let {a } =0 be a sequece of umbers The a power series about x = a is a series of the form a (x a) = a 0 + a (x a) + a (x a) +

More information

Advanced Analysis. Min Yan Department of Mathematics Hong Kong University of Science and Technology

Advanced Analysis. Min Yan Department of Mathematics Hong Kong University of Science and Technology Advaced Aalysis Mi Ya Departmet of Mathematics Hog Kog Uiversity of Sciece ad Techology September 3, 009 Cotets Limit ad Cotiuity 7 Limit of Sequece 8 Defiitio 8 Property 3 3 Ifiity ad Ifiitesimal 8 4

More information

ACO Comprehensive Exam 9 October 2007 Student code A. 1. Graph Theory

ACO Comprehensive Exam 9 October 2007 Student code A. 1. Graph Theory 1. Graph Theory Prove that there exist o simple plaar triagulatio T ad two distict adjacet vertices x, y V (T ) such that x ad y are the oly vertices of T of odd degree. Do ot use the Four-Color Theorem.

More information

The Growth of Functions. Theoretical Supplement

The Growth of Functions. Theoretical Supplement The Growth of Fuctios Theoretical Supplemet The Triagle Iequality The triagle iequality is a algebraic tool that is ofte useful i maipulatig absolute values of fuctios. The triagle iequality says that

More information

Convergence of random variables. (telegram style notes) P.J.C. Spreij

Convergence of random variables. (telegram style notes) P.J.C. Spreij Covergece of radom variables (telegram style otes).j.c. Spreij this versio: September 6, 2005 Itroductio As we kow, radom variables are by defiitio measurable fuctios o some uderlyig measurable space

More information

Lecture 2. The Lovász Local Lemma

Lecture 2. The Lovász Local Lemma Staford Uiversity Sprig 208 Math 233A: No-costructive methods i combiatorics Istructor: Ja Vodrák Lecture date: Jauary 0, 208 Origial scribe: Apoorva Khare Lecture 2. The Lovász Local Lemma 2. Itroductio

More information

REAL ANALYSIS II: PROBLEM SET 1 - SOLUTIONS

REAL ANALYSIS II: PROBLEM SET 1 - SOLUTIONS REAL ANALYSIS II: PROBLEM SET 1 - SOLUTIONS 18th Feb, 016 Defiitio (Lipschitz fuctio). A fuctio f : R R is said to be Lipschitz if there exists a positive real umber c such that for ay x, y i the domai

More information

CS 336. of n 1 objects with order unimportant but repetition allowed.

CS 336. of n 1 objects with order unimportant but repetition allowed. CS 336. The importat issue is the logic you used to arrive at your aswer.. Use extra paper to determie your solutios the eatly trascribe them oto these sheets. 3. Do ot submit the scratch sheets. However,

More information

MA131 - Analysis 1. Workbook 9 Series III

MA131 - Analysis 1. Workbook 9 Series III MA3 - Aalysis Workbook 9 Series III Autum 004 Cotets 4.4 Series with Positive ad Negative Terms.............. 4.5 Alteratig Series.......................... 4.6 Geeral Series.............................

More information

Chapter 6 Infinite Series

Chapter 6 Infinite Series Chapter 6 Ifiite Series I the previous chapter we cosidered itegrals which were improper i the sese that the iterval of itegratio was ubouded. I this chapter we are goig to discuss a topic which is somewhat

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

Bertrand s Postulate. Theorem (Bertrand s Postulate): For every positive integer n, there is a prime p satisfying n < p 2n.

Bertrand s Postulate. Theorem (Bertrand s Postulate): For every positive integer n, there is a prime p satisfying n < p 2n. Bertrad s Postulate Our goal is to prove the followig Theorem Bertrad s Postulate: For every positive iteger, there is a prime p satisfyig < p We remark that Bertrad s Postulate is true by ispectio for,,

More information

HOMEWORK I: PREREQUISITES FROM MATH 727

HOMEWORK I: PREREQUISITES FROM MATH 727 HOMEWORK I: PREREQUISITES FROM MATH 727 Questio. Let X, X 2,... be idepedet expoetial radom variables with mea µ. (a) Show that for Z +, we have EX µ!. (b) Show that almost surely, X + + X (c) Fid the

More information

Math 116 Second Midterm November 13, 2017

Math 116 Second Midterm November 13, 2017 Math 6 Secod Midterm November 3, 7 EXAM SOLUTIONS. Do ot ope this exam util you are told to do so.. Do ot write your ame aywhere o this exam. 3. This exam has pages icludig this cover. There are problems.

More information

Physics 116A Solutions to Homework Set #1 Winter Boas, problem Use equation 1.8 to find a fraction describing

Physics 116A Solutions to Homework Set #1 Winter Boas, problem Use equation 1.8 to find a fraction describing Physics 6A Solutios to Homework Set # Witer 0. Boas, problem. 8 Use equatio.8 to fid a fractio describig 0.694444444... Start with the formula S = a, ad otice that we ca remove ay umber of r fiite decimals

More information

Frequentist Inference

Frequentist Inference Frequetist Iferece The topics of the ext three sectios are useful applicatios of the Cetral Limit Theorem. Without kowig aythig about the uderlyig distributio of a sequece of radom variables {X i }, for

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

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

MATH 112: HOMEWORK 6 SOLUTIONS. Problem 1: Rudin, Chapter 3, Problem s k < s k < 2 + s k+1

MATH 112: HOMEWORK 6 SOLUTIONS. Problem 1: Rudin, Chapter 3, Problem s k < s k < 2 + s k+1 MATH 2: HOMEWORK 6 SOLUTIONS CA PRO JIRADILOK Problem. If s = 2, ad Problem : Rudi, Chapter 3, Problem 3. s + = 2 + s ( =, 2, 3,... ), prove that {s } coverges, ad that s < 2 for =, 2, 3,.... Proof. The

More information

Math 61CM - Solutions to homework 1

Math 61CM - Solutions to homework 1 Math 61CM - Solutios to homework 1 Cédric De Groote October 1 st, 2018 Problem 1: Use mathematical iductio to check the validity of the formula j 3 = 2 ( + 1) 2 for = 1, 2,.... Note: The priciple of mathematical

More information

3. Z Transform. Recall that the Fourier transform (FT) of a DT signal xn [ ] is ( ) [ ] = In order for the FT to exist in the finite magnitude sense,

3. Z Transform. Recall that the Fourier transform (FT) of a DT signal xn [ ] is ( ) [ ] = In order for the FT to exist in the finite magnitude sense, 3. Z Trasform Referece: Etire Chapter 3 of text. Recall that the Fourier trasform (FT) of a DT sigal x [ ] is ω ( ) [ ] X e = j jω k = xe I order for the FT to exist i the fiite magitude sese, S = x [

More information

Complex Analysis Spring 2001 Homework I Solution

Complex Analysis Spring 2001 Homework I Solution Complex Aalysis Sprig 2001 Homework I Solutio 1. Coway, Chapter 1, sectio 3, problem 3. Describe the set of poits satisfyig the equatio z a z + a = 2c, where c > 0 ad a R. To begi, we see from the triagle

More information

Chapter 9: Numerical Differentiation

Chapter 9: Numerical Differentiation 178 Chapter 9: Numerical Differetiatio Numerical Differetiatio Formulatio of equatios for physical problems ofte ivolve derivatives (rate-of-chage quatities, such as velocity ad acceleratio). Numerical

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

Symbolic computation 2: Linear recurrences

Symbolic computation 2: Linear recurrences Bachelor of Ecole Polytechique Computatioal Mathematics, year 2, semester Lecturer: Lucas Geri (sed mail) (mailto:lucas.geri@polytechique.edu) Symbolic computatio 2: Liear recurreces Table of cotets Warm-up

More information

LECTURE SERIES WITH NONNEGATIVE TERMS (II). SERIES WITH ARBITRARY TERMS

LECTURE SERIES WITH NONNEGATIVE TERMS (II). SERIES WITH ARBITRARY TERMS LECTURE 4 SERIES WITH NONNEGATIVE TERMS II). SERIES WITH ARBITRARY TERMS Series with oegative terms II) Theorem 4.1 Kummer s Test) Let x be a series with positive terms. 1 If c ) N i 0, + ), r > 0 ad 0

More information

Lesson 10: Limits and Continuity

Lesson 10: Limits and Continuity www.scimsacademy.com Lesso 10: Limits ad Cotiuity SCIMS Academy 1 Limit of a fuctio The cocept of limit of a fuctio is cetral to all other cocepts i calculus (like cotiuity, derivative, defiite itegrals

More information

7.1 Convergence of sequences of random variables

7.1 Convergence of sequences of random variables Chapter 7 Limit Theorems Throughout this sectio we will assume a probability space (, F, P), i which is defied a ifiite sequece of radom variables (X ) ad a radom variable X. The fact that for every ifiite

More information

f(x) dx as we do. 2x dx x also diverges. Solution: We compute 2x dx lim

f(x) dx as we do. 2x dx x also diverges. Solution: We compute 2x dx lim Math 3, Sectio 2. (25 poits) Why we defie f(x) dx as we do. (a) Show that the improper itegral diverges. Hece the improper itegral x 2 + x 2 + b also diverges. Solutio: We compute x 2 + = lim b x 2 + =

More information

Math 142, Final Exam. 5/2/11.

Math 142, Final Exam. 5/2/11. Math 4, Fial Exam 5// No otes, calculator, or text There are poits total Partial credit may be give Write your full ame i the upper right corer of page Number the pages i the upper right corer Do problem

More information

n=1 a n is the sequence (s n ) n 1 n=1 a n converges to s. We write a n = s, n=1 n=1 a n

n=1 a n is the sequence (s n ) n 1 n=1 a n converges to s. We write a n = s, n=1 n=1 a n Series. Defiitios ad first properties A series is a ifiite sum a + a + a +..., deoted i short by a. The sequece of partial sums of the series a is the sequece s ) defied by s = a k = a +... + a,. k= Defiitio

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

MAT 271 Project: Partial Fractions for certain rational functions

MAT 271 Project: Partial Fractions for certain rational functions MAT 7 Project: Partial Fractios for certai ratioal fuctios Prerequisite kowledge: partial fractios from MAT 7, a very good commad of factorig ad complex umbers from Precalculus. To complete this project,

More information

Davenport-Schinzel Sequences and their Geometric Applications

Davenport-Schinzel Sequences and their Geometric Applications Advaced Computatioal Geometry Sprig 2004 Daveport-Schizel Sequeces ad their Geometric Applicatios Prof. Joseph Mitchell Scribe: Mohit Gupta 1 Overview I this lecture, we itroduce the cocept of Daveport-Schizel

More information

1 Hash tables. 1.1 Implementation

1 Hash tables. 1.1 Implementation Lecture 8 Hash Tables, Uiversal Hash Fuctios, Balls ad Bis Scribes: Luke Johsto, Moses Charikar, G. Valiat Date: Oct 18, 2017 Adapted From Virgiia Williams lecture otes 1 Hash tables A hash table is a

More information