Average-Case Analysis of QuickSort

Size: px
Start display at page:

Download "Average-Case Analysis of QuickSort"

Transcription

1 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 time of QuickSort is obtaied as a applicatios of this idea.. Average-Case Aalysis Usig Recurrece Relatios I class we showed that whe the search key X is i the list L of size, the c A () + where A is Liear Search. Ofte the aalysis ca be doe usig recurrece relatios rather tha evaluatig a sum directly. For coveiece, let f() c A (). We ca write a recurrece relatio for f() uder the assumptio that X is i the list, amely, ½,if f(). f( ),if + How did we arrive at this recurrece? Thik about applyig Liear Search to a usorted list. We must compare the Þrst elemet of the list to the search key X. I other words, the probability of ispectig the Þrst elemet of the list is. How may comparisos do we make whe we ispect the Þrst elemet of the list? We make exactly oe compariso. Now havig compared the Þrst elemet of the list with X, how may comparisos do we make o average to search the rest of the list? Well, it depeds o whether the search key X was foud i positio oe of the list. The probability that we eve have to search the rest of the list is sice the probability of the search key beig i the Þrst positio is /. The expressio f( ) is the average-case ruig time of A o a list of size. Therefore, the quatity f( ) represets the average-case ruig

2 time of A o the remaiig positios i L discouted by the probability that we will eve have to search the last positios. Puttig it all together, we obtai that the average-case ruig time of Liear Search o a list of size is + f( ). Let us ow solve this recurrece by urollig it! f() + + f( ) + f( ) ( + + +( )) + ( ) + + Notice that we obtai the same result that we did whe we evaluated the sum directly from the deþitio.. Average-Case Aalysis of QuickSort We are ow ready to tackle the mai task at had, a aalysis of the averagecase ruig time of QuickSort. We will adopt the approach of the last Sectio, amely, to develop a recurrece relatio for the average-case ruig time ad the solve it. Let A be QuickSort, ad for coveiece, let f() c A (). We ca write a recurrece relatio for the average-case ruig time of QuickSort as 0,if f() P ( ) + (f(i ) + f( i)),if i To uderstad this recurrece, we must cosider it term by term. The term is eeded sice method Split does exactly comparisos. Recall that method Split returs the positio (speciþcally, pivotloc) where the list will be

3 partitioed. Certaily, o radom data, this positio could be the Þrst oe, the secod oe, etc. Sice there are possible positios ad each oe is equally likely, the probability that pivotloc will be ay oe of the possible positios is. What about the term f(i ) + f( i)? (Notice that we are multiplyig this term by.) To uderstad what this sum meas, let s cosider a speciþc example. Suppose 0, ad suppose Split returs the value pivotloc 5. (Let s further suppose that the array is idexed startig at, ot0. Therefore, the idices rage from to 0, ot 0 to 9.) QuickSort is ow called recursively, Þrst o the left subarray of legth four ad the o the right subarray of legth Þve. This situatio is accouted for by takig i 5i the sum of the recurrece formula. That is, we will be addig i the term 0 (f(5 ) + f(0 5)) (f(4) + f(5)). 0 to the total. The quatities f(4) ad f(5) represet the average-case ruig time of QuickSort o arrays of size four ad Þve respectively. However, we discout this term by multiplyig it by the probability that the array will be partitioed i this particular maer! As i rus through its values from to, the list is beig partitioed i all the possible ways. The recurrece relatio is ow see to correctly represet the average-case ruig time of QuickSort o lists of size. Now for the fu part! We must solve the recurrece. The Þrst step is to simplify as much as possible the sum i the recurrece. X (f(i ) + f( i)) i (f(0) + f( )) + (f() + f( )) + + (f( ) + f()) + (f( ) + f(0)) (f() + f()) + (f(3) + f(3)) + + (f( ) + f( )) X f(i) Therefore, we have simpliþed the sum cosiderably as i X (f(i ) + f( i)) X f(i) 3

4 So ow the recurrece has the form 0,if f() ( ) + P f(i),if Let s Þrst multiply through by to clear fractios. X f() ( ) + f(i) To have ay hope of solvig the recurrece, we must get rid of the sum. A trick that is ofte used is to subtract successive values of the recurrece. I other words, let us compute the quatity X f() ( )f( ) ( ) + f(i) X ( )( ) f(i) ( ) + f( ) Notice that all but oe of the terms of the sum cacelled out! have gotte rid of a sum completely! So ow we have I this way, we f() ( )f( ) ( ) + f( ) Therefore, So we ow have f() ( )f( ) + f( ) + ( ) ( +)f( ) + ( ) f() ( +)f( ) + ( ) Dividig both sides through by ( +),weget f() f( ) ( ) + + ( +) 4

5 What we have actually ow doe is formulate a ew recurrece relatio! g() f(). The, clearly, + ( 0,if g() g( ) + ( ),if (+) Let Let s ow solve this recurrece relatio by urollig it. ( ) g() g( ) + ( +) ( ) ( ) g( ) + + ( ) ( +) g() + ( ) ( +) ( ) + + (sice g() 0) 3 ( +) X (i ) i(i +) X i i(i +) If we ca evaluate this last sum, we would be almost doe. Let us ow try to do this. Computig, we obtai X i i(i +) X i + i + X X i + i (we use the method of partial fractios here)

6 Let H The umber H is called the th harmoic umber. (We have ecoutered this umber before i class.) Cotiuig, H H + Therefore, we have show that X Gettig back to g(), g() X i i(i +) H + i i(i +) H H We are ow almost doe! Recall that Therefore, we have show that f() ( +)g() ( +) H 4 + ( +)H 4 H +H 4 f() H +H 4 Now it was proved o Test # (see your test) that H Θ(l ). Sice the logarithms all have the same growth rate, H Θ(log ). Therefore, the expressio H +H 4 Θ( log ). Therefore, we have proved that c A () f() Θ( log ) So, the average-case ruig time of QuickSort is Θ( log ). This ruig time is dramatically differet from its worst-case ruig time which, as we kow, is Θ( ). 6

7 The istructor has doe some computig ad has produced the followig table with the help of Maple c. log c A () ( +)H 4 c A () log It is iterestig to cosider c A () log H +H 4 log H log + H log 4 log H O Test #, it was show that l. Therefore, sice log log e l, So, H log + Computig, we obtai H log log e H log c A () log log e 4 log log e +0+0 log e Note that our aswer makes perfectly good sese give our computatioal results! Therefore, c A () log e ( log ) 7

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

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 155 (Lecture 3)

Math 155 (Lecture 3) Math 55 (Lecture 3) September 8, I this lecture, we ll cosider the aswer to oe of the most basic coutig problems i combiatorics Questio How may ways are there to choose a -elemet subset of the set {,,,

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

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

Math 475, Problem Set #12: Answers

Math 475, Problem Set #12: Answers Math 475, Problem Set #12: Aswers A. Chapter 8, problem 12, parts (b) ad (d). (b) S # (, 2) = 2 2, sice, from amog the 2 ways of puttig elemets ito 2 distiguishable boxes, exactly 2 of them result i oe

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

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

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

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

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

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

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

Math 25 Solutions to practice problems

Math 25 Solutions to practice problems Math 5: Advaced Calculus UC Davis, Sprig 0 Math 5 Solutios to practice problems Questio For = 0,,, 3,... ad 0 k defie umbers C k C k =! k!( k)! (for k = 0 ad k = we defie C 0 = C = ). by = ( )... ( k +

More information

SEQUENCE AND SERIES NCERT

SEQUENCE AND SERIES NCERT 9. Overview By a sequece, we mea a arragemet of umbers i a defiite order accordig to some rule. We deote the terms of a sequece by a, a,..., etc., the subscript deotes the positio of the term. I view of

More information

NAME: ALGEBRA 350 BLOCK 7. Simplifying Radicals Packet PART 1: ROOTS

NAME: ALGEBRA 350 BLOCK 7. Simplifying Radicals Packet PART 1: ROOTS NAME: ALGEBRA 50 BLOCK 7 DATE: Simplifyig Radicals Packet PART 1: ROOTS READ: A square root of a umber b is a solutio of the equatio x = b. Every positive umber b has two square roots, deoted b ad b or

More information

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

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER / Statistics ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER 1 018/019 DR. ANTHONY BROWN 8. Statistics 8.1. Measures of Cetre: Mea, Media ad Mode. If we have a series of umbers 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

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

Section 11.8: Power Series

Section 11.8: Power Series Sectio 11.8: Power Series 1. Power Series I this sectio, we cosider geeralizig the cocept of a series. Recall that a series is a ifiite sum of umbers a. We ca talk about whether or ot it coverges ad i

More information

Chapter 4. Fourier Series

Chapter 4. Fourier Series Chapter 4. Fourier Series At this poit we are ready to ow cosider the caoical equatios. Cosider, for eample the heat equatio u t = u, < (4.) subject to u(, ) = si, u(, t) = u(, t) =. (4.) Here,

More information

The Binomial Theorem

The Binomial Theorem The Biomial Theorem Robert Marti Itroductio The Biomial Theorem is used to expad biomials, that is, brackets cosistig of two distict terms The formula for the Biomial Theorem is as follows: (a + b ( k

More information

You may work in pairs or purely individually for this assignment.

You may work in pairs or purely individually for this assignment. CS 04 Problem Solvig i Computer Sciece OOC Assigmet 6: Recurreces You may work i pairs or purely idividually for this assigmet. Prepare your aswers to the followig questios i a plai ASCII text file or

More information

The picture in figure 1.1 helps us to see that the area represents the distance traveled. Figure 1: Area represents distance travelled

The picture in figure 1.1 helps us to see that the area represents the distance traveled. Figure 1: Area represents distance travelled 1 Lecture : Area Area ad distace traveled Approximatig area by rectagles Summatio The area uder a parabola 1.1 Area ad distace Suppose we have the followig iformatio about the velocity of a particle, how

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

Topic 1 2: Sequences and Series. A sequence is an ordered list of numbers, e.g. 1, 2, 4, 8, 16, or

Topic 1 2: Sequences and Series. A sequence is an ordered list of numbers, e.g. 1, 2, 4, 8, 16, or Topic : Sequeces ad Series A sequece is a ordered list of umbers, e.g.,,, 8, 6, or,,,.... A series is a sum of the terms of a sequece, e.g. + + + 8 + 6 + or... Sigma Notatio b The otatio f ( k) is shorthad

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

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

SOME TRIBONACCI IDENTITIES

SOME TRIBONACCI IDENTITIES Mathematics Today Vol.7(Dec-011) 1-9 ISSN 0976-38 Abstract: SOME TRIBONACCI IDENTITIES Shah Devbhadra V. Sir P.T.Sarvajaik College of Sciece, Athwalies, Surat 395001. e-mail : drdvshah@yahoo.com The sequece

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

6.046 Recitation 5: Binary Search Trees Bill Thies, Fall 2004 Outline

6.046 Recitation 5: Binary Search Trees Bill Thies, Fall 2004 Outline 6.046 Recitatio 5: Biary Search Trees Bill Thies, Fall 2004 Outlie My cotact iformatio: Bill Thies thies@mit.edu Office hours: Sat 1-3pm, 36-153 Recitatio website: http://cag.lcs.mit.edu/~thies/6.046/

More information

NICK DUFRESNE. 1 1 p(x). To determine some formulas for the generating function of the Schröder numbers, r(x) = a(x) =

NICK DUFRESNE. 1 1 p(x). To determine some formulas for the generating function of the Schröder numbers, r(x) = a(x) = AN INTRODUCTION TO SCHRÖDER AND UNKNOWN NUMBERS NICK DUFRESNE Abstract. I this article we will itroduce two types of lattice paths, Schröder paths ad Ukow paths. We will examie differet properties of each,

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

7 Sequences of real numbers

7 Sequences of real numbers 40 7 Sequeces of real umbers 7. Defiitios ad examples Defiitio 7... A sequece of real umbers is a real fuctio whose domai is the set N of atural umbers. Let s : N R be a sequece. The the values of s are

More information

Once we have a sequence of numbers, the next thing to do is to sum them up. Given a sequence (a n ) n=1

Once we have a sequence of numbers, the next thing to do is to sum them up. Given a sequence (a n ) n=1 . Ifiite Series Oce we have a sequece of umbers, the ext thig to do is to sum them up. Give a sequece a be a sequece: ca we give a sesible meaig to the followig expressio? a = a a a a While summig ifiitely

More information

Number of fatalities X Sunday 4 Monday 6 Tuesday 2 Wednesday 0 Thursday 3 Friday 5 Saturday 8 Total 28. Day

Number of fatalities X Sunday 4 Monday 6 Tuesday 2 Wednesday 0 Thursday 3 Friday 5 Saturday 8 Total 28. Day LECTURE # 8 Mea Deviatio, Stadard Deviatio ad Variace & Coefficiet of variatio Mea Deviatio Stadard Deviatio ad Variace Coefficiet of variatio First, we will discuss it for the case of raw data, ad the

More information

Output Analysis and Run-Length Control

Output Analysis and Run-Length Control IEOR E4703: Mote Carlo Simulatio Columbia Uiversity c 2017 by Marti Haugh Output Aalysis ad Ru-Legth Cotrol I these otes we describe how the Cetral Limit Theorem ca be used to costruct approximate (1 α%

More information

Assignment 2 Solutions SOLUTION. ϕ 1 Â = 3 ϕ 1 4i ϕ 2. The other case can be dealt with in a similar way. { ϕ 2 Â} χ = { 4i ϕ 1 3 ϕ 2 } χ.

Assignment 2 Solutions SOLUTION. ϕ 1  = 3 ϕ 1 4i ϕ 2. The other case can be dealt with in a similar way. { ϕ 2 Â} χ = { 4i ϕ 1 3 ϕ 2 } χ. PHYSICS 34 QUANTUM PHYSICS II (25) Assigmet 2 Solutios 1. With respect to a pair of orthoormal vectors ϕ 1 ad ϕ 2 that spa the Hilbert space H of a certai system, the operator  is defied by its actio

More information

Calculus with Analytic Geometry 2

Calculus with Analytic Geometry 2 Calculus with Aalytic Geometry Fial Eam Study Guide ad Sample Problems Solutios The date for the fial eam is December, 7, 4-6:3p.m. BU Note. The fial eam will cosist of eercises, ad some theoretical questios,

More information

SNAP Centre Workshop. Basic Algebraic Manipulation

SNAP Centre Workshop. Basic Algebraic Manipulation SNAP Cetre Workshop Basic Algebraic Maipulatio 8 Simplifyig Algebraic Expressios Whe a expressio is writte i the most compact maer possible, it is cosidered to be simplified. Not Simplified: x(x + 4x)

More information

Problem Set 2 Solutions

Problem Set 2 Solutions CS271 Radomess & Computatio, Sprig 2018 Problem Set 2 Solutios Poit totals are i the margi; the maximum total umber of poits was 52. 1. Probabilistic method for domiatig sets 6pts Pick a radom subset S

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

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

= 4 and 4 is the principal cube root of 64.

= 4 and 4 is the principal cube root of 64. Chapter Real Numbers ad Radicals Day 1: Roots ad Radicals A2TH SWBAT evaluate radicals of ay idex Do Now: Simplify the followig: a) 2 2 b) (-2) 2 c) -2 2 d) 8 2 e) (-8) 2 f) 5 g)(-5) Based o parts a ad

More information

Lecture 4 The Simple Random Walk

Lecture 4 The Simple Random Walk Lecture 4: The Simple Radom Walk 1 of 9 Course: M36K Itro to Stochastic Processes Term: Fall 014 Istructor: Gorda Zitkovic Lecture 4 The Simple Radom Walk We have defied ad costructed a radom walk {X }

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

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

Dynamic Programming. Sequence Of Decisions

Dynamic Programming. Sequence Of Decisions Dyamic Programmig Sequece of decisios. Problem state. Priciple of optimality. Dyamic Programmig Recurrece Equatios. Solutio of recurrece equatios. Sequece Of Decisios As i the greedy method, the solutio

More information

Dynamic Programming. Sequence Of Decisions. 0/1 Knapsack Problem. Sequence Of Decisions

Dynamic Programming. Sequence Of Decisions. 0/1 Knapsack Problem. Sequence Of Decisions Dyamic Programmig Sequece Of Decisios Sequece of decisios. Problem state. Priciple of optimality. Dyamic Programmig Recurrece Equatios. Solutio of recurrece equatios. As i the greedy method, the solutio

More information

Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 15

Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 15 CS 70 Discrete Mathematics ad Probability Theory Summer 2014 James Cook Note 15 Some Importat Distributios I this ote we will itroduce three importat probability distributios that are widely used to model

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

Lecture 2: April 3, 2013

Lecture 2: April 3, 2013 TTIC/CMSC 350 Mathematical Toolkit Sprig 203 Madhur Tulsiai Lecture 2: April 3, 203 Scribe: Shubhedu Trivedi Coi tosses cotiued We retur to the coi tossig example from the last lecture agai: Example. Give,

More information

Series: Infinite Sums

Series: Infinite Sums Series: Ifiite Sums Series are a way to mae sese of certai types of ifiitely log sums. We will eed to be able to do this if we are to attai our goal of approximatig trascedetal fuctios by usig ifiite degree

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

5.6 Absolute Convergence and The Ratio and Root Tests

5.6 Absolute Convergence and The Ratio and Root Tests 5.6 Absolute Covergece ad The Ratio ad Root Tests Bria E. Veitch 5.6 Absolute Covergece ad The Ratio ad Root Tests Recall from our previous sectio that diverged but ( ) coverged. Both of these sequeces

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

CHAPTER 10 INFINITE SEQUENCES AND SERIES

CHAPTER 10 INFINITE SEQUENCES AND SERIES CHAPTER 10 INFINITE SEQUENCES AND SERIES 10.1 Sequeces 10.2 Ifiite Series 10.3 The Itegral Tests 10.4 Compariso Tests 10.5 The Ratio ad Root Tests 10.6 Alteratig Series: Absolute ad Coditioal Covergece

More information

Lecture 2: Monte Carlo Simulation

Lecture 2: Monte Carlo Simulation STAT/Q SCI 43: Itroductio to Resamplig ethods Sprig 27 Istructor: Ye-Chi Che Lecture 2: ote Carlo Simulatio 2 ote Carlo Itegratio Assume we wat to evaluate the followig itegratio: e x3 dx What ca we do?

More information

Riemann Sums y = f (x)

Riemann Sums y = f (x) Riema Sums Recall that we have previously discussed the area problem I its simplest form we ca state it this way: The Area Problem Let f be a cotiuous, o-egative fuctio o the closed iterval [a, b] Fid

More information

CALCULATION OF FIBONACCI VECTORS

CALCULATION OF FIBONACCI VECTORS CALCULATION OF FIBONACCI VECTORS Stuart D. Aderso Departmet of Physics, Ithaca College 953 Daby Road, Ithaca NY 14850, USA email: saderso@ithaca.edu ad Dai Novak Departmet of Mathematics, Ithaca College

More information

UC Berkeley CS 170: Efficient Algorithms and Intractable Problems Handout 17 Lecturer: David Wagner April 3, Notes 17 for CS 170

UC Berkeley CS 170: Efficient Algorithms and Intractable Problems Handout 17 Lecturer: David Wagner April 3, Notes 17 for CS 170 UC Berkeley CS 170: Efficiet Algorithms ad Itractable Problems Hadout 17 Lecturer: David Wager April 3, 2003 Notes 17 for CS 170 1 The Lempel-Ziv algorithm There is a sese i which the Huffma codig was

More information

Discrete Mathematics Recurrences

Discrete Mathematics Recurrences Discrete Mathematics Recurreces Saad Meimeh 1 What is a recurrece? It ofte happes that, i studyig a sequece of umbers a, a coectio betwee a ad a 1, or betwee a ad several of the previous a i, i

More information

Complex Numbers Primer

Complex Numbers Primer Complex Numbers Primer Complex Numbers Primer Before I get started o this let me first make it clear that this documet is ot iteded to teach you everythig there is to kow about complex umbers. That is

More information

Complex Numbers Primer

Complex Numbers Primer Before I get started o this let me first make it clear that this documet is ot iteded to teach you everythig there is to kow about complex umbers. That is a subject that ca (ad does) take a whole course

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

Sigma notation. 2.1 Introduction

Sigma notation. 2.1 Introduction Sigma otatio. Itroductio We use sigma otatio to idicate the summatio process whe we have several (or ifiitely may) terms to add up. You may have see sigma otatio i earlier courses. It is used to idicate

More information

MATH 21 SECTION NOTES

MATH 21 SECTION NOTES MATH SECTION NOTES EVAN WARNER. March 9.. Admiistrative miscellay. These weekly sectios will be for some review ad may example problems, i geeral. Attedace will be take as per class policy. We will be

More information

ORIE 633 Network Flows September 27, Lecture 8

ORIE 633 Network Flows September 27, Lecture 8 ORIE 633 Network Flows September 7, 007 Lecturer: David P. Williamso Lecture 8 Scribe: Gema Plaza-Martíez 1 Global mi-cuts i udirected graphs 1.1 Radom cotractio Recall from last time we itroduced the

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

1 Statement of the Game

1 Statement of the Game ANALYSIS OF THE CHOW-ROBBINS GAME JON LU May 10, 2016 Abstract Flip a coi repeatedly ad stop wheever you wat. Your payoff is the proportio of heads ad you wish to maximize this payoff i expectatio. I this

More information

The Random Walk For Dummies

The Random Walk For Dummies The Radom Walk For Dummies Richard A Mote Abstract We look at the priciples goverig the oe-dimesioal discrete radom walk First we review five basic cocepts of probability theory The we cosider the Beroulli

More information

Physics 232 Gauge invariance of the magnetic susceptibilty

Physics 232 Gauge invariance of the magnetic susceptibilty Physics 232 Gauge ivariace of the magetic susceptibilty Peter Youg (Dated: Jauary 16, 2006) I. INTRODUCTION We have see i class that the followig additioal terms appear i the Hamiltoia o addig a magetic

More information

FLC Ch 8 & 9. Evaluate. Check work. a) b) c) d) e) f) g) h) i) j) k) l) m) n) o) 3. p) q) r) s) t) 3.

FLC Ch 8 & 9. Evaluate. Check work. a) b) c) d) e) f) g) h) i) j) k) l) m) n) o) 3. p) q) r) s) t) 3. Math 100 Elemetary Algebra Sec 8.1: Radical Expressios List perfect squares ad evaluate their square root. Kow these perfect squares for test. Def The positive (pricipal) square root of x, writte x, is

More information

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 22

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 22 CS 70 Discrete Mathematics for CS Sprig 2007 Luca Trevisa Lecture 22 Aother Importat Distributio The Geometric Distributio Questio: A biased coi with Heads probability p is tossed repeatedly util the first

More information

Roberto s Notes on Series Chapter 2: Convergence tests Section 7. Alternating series

Roberto s Notes on Series Chapter 2: Convergence tests Section 7. Alternating series Roberto s Notes o Series Chapter 2: Covergece tests Sectio 7 Alteratig series What you eed to kow already: All basic covergece tests for evetually positive series. What you ca lear here: A test for series

More information

Section 6.4: Series. Section 6.4 Series 413

Section 6.4: Series. Section 6.4 Series 413 ectio 64 eries 4 ectio 64: eries A couple decides to start a college fud for their daughter They pla to ivest $50 i the fud each moth The fud pays 6% aual iterest, compouded mothly How much moey will they

More information

Section 1.1. Calculus: Areas And Tangents. Difference Equations to Differential Equations

Section 1.1. Calculus: Areas And Tangents. Difference Equations to Differential Equations Differece Equatios to Differetial Equatios Sectio. Calculus: Areas Ad Tagets The study of calculus begis with questios about chage. What happes to the velocity of a swigig pedulum as its positio chages?

More information

Math 113 Exam 3 Practice

Math 113 Exam 3 Practice Math Exam Practice Exam will cover.-.9. This sheet has three sectios. The first sectio will remid you about techiques ad formulas that you should kow. The secod gives a umber of practice questios for you

More information

1 Inferential Methods for Correlation and Regression Analysis

1 Inferential Methods for Correlation and Regression Analysis 1 Iferetial Methods for Correlatio ad Regressio Aalysis I the chapter o Correlatio ad Regressio Aalysis tools for describig bivariate cotiuous data were itroduced. The sample Pearso Correlatio Coefficiet

More information

Proof of Fermat s Last Theorem by Algebra Identities and Linear Algebra

Proof of Fermat s Last Theorem by Algebra Identities and Linear Algebra Proof of Fermat s Last Theorem by Algebra Idetities ad Liear Algebra Javad Babaee Ragai Youg Researchers ad Elite Club, Qaemshahr Brach, Islamic Azad Uiversity, Qaemshahr, Ira Departmet of Civil Egieerig,

More information

Estimation for Complete Data

Estimation for Complete Data Estimatio for Complete Data complete data: there is o loss of iformatio durig study. complete idividual complete data= grouped data A complete idividual data is the oe i which the complete iformatio of

More information

Linear Regression Demystified

Linear Regression Demystified Liear Regressio Demystified Liear regressio is a importat subject i statistics. I elemetary statistics courses, formulae related to liear regressio are ofte stated without derivatio. This ote iteds to

More information

The Discrete Fourier Transform

The Discrete Fourier Transform The Discrete Fourier Trasform Complex Fourier Series Represetatio Recall that a Fourier series has the form a 0 + a k cos(kt) + k=1 b k si(kt) This represetatio seems a bit awkward, sice it ivolves two

More information

6.003 Homework #3 Solutions

6.003 Homework #3 Solutions 6.00 Homework # Solutios Problems. Complex umbers a. Evaluate the real ad imagiary parts of j j. π/ Real part = Imagiary part = 0 e Euler s formula says that j = e jπ/, so jπ/ j π/ j j = e = e. Thus the

More information

CS284A: Representations and Algorithms in Molecular Biology

CS284A: Representations and Algorithms in Molecular Biology CS284A: Represetatios ad Algorithms i Molecular Biology Scribe Notes o Lectures 3 & 4: Motif Discovery via Eumeratio & Motif Represetatio Usig Positio Weight Matrix Joshua Gervi Based o presetatios by

More information

Let us give one more example of MLE. Example 3. The uniform distribution U[0, θ] on the interval [0, θ] has p.d.f.

Let us give one more example of MLE. Example 3. The uniform distribution U[0, θ] on the interval [0, θ] has p.d.f. Lecture 5 Let us give oe more example of MLE. Example 3. The uiform distributio U[0, ] o the iterval [0, ] has p.d.f. { 1 f(x =, 0 x, 0, otherwise The likelihood fuctio ϕ( = f(x i = 1 I(X 1,..., X [0,

More information

Math 216A Notes, Week 5

Math 216A Notes, Week 5 Math 6A Notes, Week 5 Scribe: Ayastassia Sebolt Disclaimer: These otes are ot early as polished (ad quite possibly ot early as correct) as a published paper. Please use them at your ow risk.. Thresholds

More information

Let us consider the following problem to warm up towards a more general statement.

Let us consider the following problem to warm up towards a more general statement. Lecture 4: Sequeces with repetitios, distributig idetical objects amog distict parties, the biomial theorem, ad some properties of biomial coefficiets Refereces: Relevat parts of chapter 15 of the Math

More information

Math 609/597: Cryptography 1

Math 609/597: Cryptography 1 Math 609/597: Cryptography 1 The Solovay-Strasse Primality Test 12 October, 1993 Burt Roseberg Revised: 6 October, 2000 1 Itroductio We describe the Solovay-Strasse primality test. There is quite a bit

More information

Chapter 6 Overview: Sequences and Numerical Series. For the purposes of AP, this topic is broken into four basic subtopics:

Chapter 6 Overview: Sequences and Numerical Series. For the purposes of AP, this topic is broken into four basic subtopics: Chapter 6 Overview: Sequeces ad Numerical Series I most texts, the topic of sequeces ad series appears, at first, to be a side topic. There are almost o derivatives or itegrals (which is what most studets

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

September 2012 C1 Note. C1 Notes (Edexcel) Copyright - For AS, A2 notes and IGCSE / GCSE worksheets 1

September 2012 C1 Note. C1 Notes (Edexcel) Copyright   - For AS, A2 notes and IGCSE / GCSE worksheets 1 September 0 s (Edecel) Copyright www.pgmaths.co.uk - For AS, A otes ad IGCSE / GCSE worksheets September 0 Copyright www.pgmaths.co.uk - For AS, A otes ad IGCSE / GCSE worksheets September 0 Copyright

More information

Disjoint set (Union-Find)

Disjoint set (Union-Find) CS124 Lecture 7 Fall 2018 Disjoit set (Uio-Fid) For Kruskal s algorithm for the miimum spaig tree problem, we foud that we eeded a data structure for maitaiig a collectio of disjoit sets. That is, we eed

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

Posted-Price, Sealed-Bid Auctions

Posted-Price, Sealed-Bid Auctions Posted-Price, Sealed-Bid Auctios Professors Greewald ad Oyakawa 207-02-08 We itroduce the posted-price, sealed-bid auctio. This auctio format itroduces the idea of approximatios. We describe how well this

More information

Activity 3: Length Measurements with the Four-Sided Meter Stick

Activity 3: Length Measurements with the Four-Sided Meter Stick Activity 3: Legth Measuremets with the Four-Sided Meter Stick OBJECTIVE: The purpose of this experimet is to study errors ad the propagatio of errors whe experimetal data derived usig a four-sided meter

More information

Chapter 7: Numerical Series

Chapter 7: Numerical Series Chapter 7: Numerical Series Chapter 7 Overview: Sequeces ad Numerical Series I most texts, the topic of sequeces ad series appears, at first, to be a side topic. There are almost o derivatives or itegrals

More information

RADICAL EXPRESSION. If a and x are real numbers and n is a positive integer, then x is an. n th root theorems: Example 1 Simplify

RADICAL EXPRESSION. If a and x are real numbers and n is a positive integer, then x is an. n th root theorems: Example 1 Simplify Example 1 Simplify 1.2A Radical Operatios a) 4 2 b) 16 1 2 c) 16 d) 2 e) 8 1 f) 8 What is the relatioship betwee a, b, c? What is the relatioship betwee d, e, f? If x = a, the x = = th root theorems: RADICAL

More information

U8L1: Sec Equations of Lines in R 2

U8L1: Sec Equations of Lines in R 2 MCVU U8L: Sec. 8.9. Equatios of Lies i R Review of Equatios of a Straight Lie (-D) Cosider the lie passig through A (-,) with slope, as show i the diagram below. I poit slope form, the equatio of the lie

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