the beginning of the program in order for it to work correctly. Similarly, a Confirm

Size: px
Start display at page:

Download "the beginning of the program in order for it to work correctly. Similarly, a Confirm"

Transcription

1 I our sytax, a Assume statemet will be used to record what must be true at the begiig of the program i order for it to work correctly. Similarly, a Cofirm statemet is used to record what should be true after the code is executed. Assume y ¹ 0; z : = w/y; if z ³ 0 the abs := z else abs := -z edif; Cofirm abs = w/y ; This program computes a real quotiet, so we must be sure that the divisor y is ozero. The Assume clause accomplishes this. The Cofirm statemet claims that, upo executio of the code, the value of the variable abs will be the absolute value of the quotiet w/y. We ca see that the Assume ad Cofirm clauses together serve to specify what the program does, by first screeig out usatisfactory iput ad fially by statig what will be true after program executio. I additio to providig formal specificatios, these assertios permit verificatio by formig a basis for developig appropriate proof rules. I the absolute value program, the costructs used are the If the else ad the assigmet statemets, ad so we eed proof rules for these costructs ad a explaatio of what they mea. The form of typical proof rules is illustrated by the rule for if the else statemets: code: Assume B; code1; Cofirm Q; code; Assume B; code2; Cofirm Q; code; If B the code1 else code2; edif; Cofirm Q; The meaig of this rule (ad of all future rules) is that the correctess of the bottom lie ca be deduced from the correctess of the top lies. The code at the 1

2 begiig of each of the above lies is a sequece of statemets, the first of which is usually a Assume statemet. Similarly, code1 ad code2 also represet sequeces of statemets. To illustrate this rule we apply it to the absolute value example, but first we eed a basic uderstadig of the overall proof process. I geeral, we will have a proof rule to cover each differet kid of statemet i our programmig laguage, ad our proof costructio process will ivolve the creatio of a successio of lemmas. This process begis with the statemet immediately precedig the fial Cofirm statemet ad progresses backward through the code, applyig the appropriate rule at each poit. More will be said about this order of rule applicatio later. I our example, the code precedig the If the else statemet cosists of a Assume statemet ad a assigmet. Applyig the If the else rule backwards yields two assertive programs which must the be proved correct: (1) Assume y ¹ 0; z : = w/y; Assume z ³ 0 ; abs := z; Cofirm abs = w/y ; (2) Assume y ¹ 0; z : = w/y; Assume ( z ³ 0) ; abs := -z; Cofirm abs = w/y ; We ote that whe we applied this rule, the If the else costruct itself disappeared, havig bee replaced by two hypotheses, each cotaiig fewer programmig costructs tha the origial program. Sice both these hypotheses cotai assigmet statemets, we look ext at the proof rule for assigmets: 2

3 x ; code; x := exp; Cofirm Q; code; Cofirm Q[ exp] As usual, the meaig of the rule is that i order to prove the bottom lie, it is sufficiet to prove the top lie. The symbol ca be read as replaced by. This rule says that we omit the assigmet statemet ad rewrite the Cofirm clause Q replacig all the istaces of x by the expressio exp, which was to have bee assiged to x. Applyig this rule to our absolute value proof, we get: (1) Assume y ¹ 0; z := w/y; Assume z ³ 0; Cofirm z = w/y ; (2) Assume y ¹ 0; z := w/y; z ³ 0 ; Assume ( ) Cofirm z = w/y ; We ow eed a rule for Assume statemets: code; Cofirm P Þ Q; code; Assume P; Cofirm Q; Applyig the rule for Assume, we obtai: (1) Assume y ¹ 0 ; z := w/y; Cofirm z ³ 0 Þ z = w/y ; (2) Assume y ¹ 0; z := w/y; Cofirm z < 0 Þ -z = w/y ; Now we apply the assigmet rule to each brach: (1) Assume y ¹ 0; Cofirm w/y ³ 0 Þ w/y = w/y ; (2) Assume y ¹ 0 ; Cofirm w/y < 0 Þ - w/y = w/y ; 3

4 Aother applicatio of the Assume rule yields: w/y ³ 0 Þ w/y = w/y ; (1) Cofirm y ¹ 0 Þ ( ) (2) Cofirm y ¹ 0 Þ ( w/y 0Þ w/y = - w/y ) < ; To complete the proof we eed a rule for Cofirm: Q Cofirm Q; Applyig the Cofirm rule produces the followig mathematical propositios: w/y ³ 0 Þ w/y = w/y (1) y ¹ 0 Þ ( ) (2) y ¹ 0 Þ ( w/y < 0Þ - w/y = w/y ) As the example illustrates, every reverse rule applicatio produces oe or more ew hypotheses, each of which has fewer programmig costructs tha the coclusio lie. Ultimately, all the programmig laguage sytax disappears, leavig hypothesis writte strictly i the laguage of the uderlyig mathematical theory. I this case that theory happes to be real umber theory, which allows us to coclude that both of these assertios are true from the defiitio of absolute value. The part of the proof ivolvig oly the mathematical theory may strike the reader as particularly easy, ad oe may fear that oly such obviously cotrived examples as this will be so simple to verify. However, throughout this thesis, example after example will show that this pheomeo is ot peculiar to this simple program, but rather is a commo occurrece. I fact, we have ot yet foud ay example i which the proof of program correctess requiresd more tha simple use of mathematical defiitios ad straightforward applicatios of the appropriate theory. This is really o surprise if oe stops to cosider that, i order to write the correct code, the programmer must kow at a ituitive level whatever theorems uderlie the reasoig he is usig for program developmet. 4

5 I the verificatio literature, associated with every loop is a clause called the loop ivariat. As the ame suggests, the loop ivariat is a assertio, which is true both before ad after each iteratio of the loop. The sytactic marker for the loop ivariat is the keyword Maitaiig. A simple example illustratig the while loop costruct is: Assume ³ 0; sum := 0; i := 0; Maitaiig i while i < do i := i + 1; sum := sum +1; ed; Cofirm sum = Ù sum = å j å j i Here the ivariat states that i ever exceeds ad that at the begiig or ed of ay iteratio, the variable sum cotais the total of the first i itegers. This exactly describes what the loop is doig, amely computig a sequece of partial sums util it fially has the sum of the first itegers. For coveiece i what follows, we will ame this particular loop ivariat Sum_Iv. That is, Sum_Iv = i Ù sum = i å j. I order to verify this program, we will eed the proof rule for while statemets: code; Cofirm Iv; Assume Iv Ù B; body; Cofirm Iv; Assume Iv Ù B; Cofirm Q; code; Maitaiig Iv while B do body ed; Cofirm Q: Here the first hypothesis is that the ivariat Iv be true before the loop is executed. The secod hypothesis requires that if Iv is true ad the coditioal B for the 5

6 loop is true ad the body is executed, the Iv is true after executio, i.e., that Iv truly is a ivariat. The third says that the truth of Q should follow from the truth of Iv ad B, sice they will both hold true whe the loop termiates. We will ow use this rule i establishig the correctess of the summatio program. As before, we will take for grated that the variables have bee declared. Sice the while loop is the last costruct of this program, we apply that rule first, obtaiig three hypotheses: (1) Assume ³ 0; sum := 0; i := 0; Cofirm Sum_Iv; (2) Assume Sum_Iv Ù i < ; i := i + 1; sum := sum + i; Cofirm Sum_Iv; (3) Assume Sum_Iv Ù i ³ ; Cofirm sum = å j; To prove correctess of the program, we must apply the appropriate proof rules to each of these hypotheses. For the first, applyig the assigmet rule to i := 0 yields: (1) Assume ³ 0; sum := 0; Cofirm 0 Ù sum = 0 å j ; Applyig the assigmet rule to sum := 0 leads to: Assume ³ 0; Cofirm 0 Ù 0 = 0 å j; Fially, usig the rule for Assume, followed by the Cofirm rule, we obtai: ³ 0 Þ 0 Ù 0 = å j; This follows from the defiitio of å. I hypothesis (2), the body of the loop cosists of two assigmets, so we apply the assigmet rule twice to obtai: (2) Assume i < Ù Sum_Iv; Cofirm i + 1 Ù sum + i + 1 = i + 1 å j; j= 1 Applyig the Assume ad Cofirm rules, we get 6

7 i < Ù i Ù sum = i å j Þ j= 1 i + 1 Ù sum + i + 1 = i + 1 å j j= 1 This ca be see to be correct by addig i + 1 to both sides of the equatio for sum i the hypothesis. Hypothesis (3) expads out to: (3) Assume i Ù sum = å j Cofirm sum = å j; i Ù i ³ ; Applyig the rules for Assume ad Cofirm, we obtai: From i Ù sum = sum = å j i å j Ù i ³ Þ i ad i ³, it follows that i =, ad we have the desired result. To write the loop ivariat, the programmer eeded to kow that the loop will have the total of the first i itegers i sum after i iteratios ad that the highest value i will achieve is. But, of course, had the programmer ot kow both of those facts implicity, he would ot have bee able to write this program. The poit here is that loop ivariats are ot mysterious, or do they requires deep mathematical isights, which most programmers are ulikely to have. Loop ivariats are simply descriptios of what the loop does. Just as a compiler must keep iformatio about procedures so that it ca do type checkig of parameters ad ca fid appropriate code ito which to trasfer cotrol, the verifier must kow certai iformatio about procedures i order to be able to geerate correctess proofs. 7

8 Whe a procedure call is made i a program, the verifier does ot eed to see the code for that procedure at all, but rather it must kow what the code does, i.e. what its specificatios are. So wheever a procedure is declared, the headig, which cotais its specificatios, is recorded i what we will call the program s cotext. To illustrate how procedures look, what the headig is, ad where the specificatios appear, we will preset a example of a program fragmet i which the umber of permutatios of objects take r at a time is computed. To facilitate the computatio, a procedure for calculatig factorials is used. The declaratio of the factorial procedure is show first: Proc Fid_Factorial (cost : iteger, var fact: iteger) requires ³ 0; esures fact =!; fact := 1; i := 0; Maitaiig fact = i! Ù i while i < do i := i + 1; fact := i * fact ed ed; The requires clause is a programmer supplied assertio which tells what restrictios must be met i order that, if the code is correct, the esures clause will hold upo completio of the procedure body. Together, the requires ad esures clauses form the specificatios of the procedure. The headig of the procedure cosists of the first lie ad the specificatios: Proc Fid_Factorial (cost : iteger, var fact: iteger); requires ³ 0; esures fact =!; 8

9 For ay give block of code, the verifier will first look at the declaratios ad put appropriate iformatio ito the cotext, i.e., save iformatio which will be eeded i order to apply the proof rules. The the verifier begis at the peultimate statemet ad proceeds toward the begiig of the program (usually a Assume statemet), applyig the appropriate rule as we have see i the proceedig examples. So, i this example, the verifier will have to put the headig of Fid_Factorial ito the correct cotext before applyig the other rules ecessary for provig correctess. Hece, if ad whe Fid_Fact is called, the specificatios tellig what Fid_Factorial does will be available. It is clear that we eed two ew proof rules, oe to hadle procedure declaratios ad oe for procedure calls. The followig is a simplified versio of the procedure declaratio rule: C È {p_headig} \ Assume pre; Remember x; body; Cofirm post; C È {p_headig} \ code; Cofirm Q; C \ Proc p(var x: T); requires pre; esures post; body; ed code; Cofirm Q; Both hypotheses of the declaratio rule idicate that the headig of the procedure beig declared (but ot its body) is to be placed i the cotext. This makes all the ecessary iformatio about the procedure available so that it ca be called from ay part of the program, icludig from withi itself. The first hypothesis of the rule establishes that the procedure works as specified by requirig that, if the requires clause is met, the the esures clause is true upo completio of the body of the procedure. The requires clause pre is called the precoditio of the procedure ad the esures clause post is called the postcoditio. I applyig the procedure declaratio rule to Fid_Factorial, we ote that the first hypothesis to cosider will be: 9

10 C È {Fid_Fact_Headig} \ Assume ³ 0; Fid_Fact_Body; Cofirm fact =!; Here C stads for whatever cotext already exists at the poit of declaratio of Fid_Factorial, ad as the rule shows, the Fid_Fact_Headig is added to that cotext by the verifier. The \ mark separates the cotext from the assertive program to be proved correct. Fid_Fact_Body is a abbreviatio to stad for the code i the body of the Fid_Factorial procedure. We ote that this hypothesis is i a already familiar form because it looks just like the precedig examples. Ideed, i order to establish the stated hypothesis, we proceed exactly as we did i the examples already give, ad we will fid that the rules we eed are oes we have see before. Sice the body of Fid_Factorial eds with a while loop, it is the while rule that we apply first, thereby geeratig three hypotheses to check: (1) Assume ³ 0; fact := 1; i := 0; Cofirm fact = i! Ù i ; (2) Assume fact = i! Ù i Ù i < ; i := i + 1; fact := i * fact; Cofirm fact = i! Ù i ; (3) Assume fact = i! Ù i Ù i ³ ; Cofirm fact =!; For (1) we apply the assigmet rule twice, obtaiig: (1) Assume ³ 0; Cofirm 1 = 0! Ù 0 ; Applyig the rules for Assume ad Cofirm, we get: ³ 0 Þ1= 0! Ù 0 ; The fact that 1 = 0! is a defiitio from umber theory. Hypothesis (2) also requires two applicatios of the assigmet rule ad use of the rules for Assume ad Cofirm. The result is: 10

11 fact = i! Ù i Ù i < Þ (i + 1) * fact = (i + 1)! Ù i + 1 The first part of the coclusio ca be prove by multiplyig both sides of the equatio fact = i! by i + 1. The other part of the coclusio is obvious sice i <. For hypothesis (3) we eed to verify: (3) Assume fact = i! Ù i Ù i ³ ; Cofirm fact =!; Applyig the assume ad cofirm rules yields: fact = i! Ù i Ù i ³ Þ fact =!; Sice i ad i ³, i =. Hece fact = i! implies that fact =!. We have see that a applicatio of the proof rule for procedure declaratios causes the cotext to be eriched with the procedure headig. Such a applicatio also establishes that if the parameters to the procedure meet the requires clause, the upo completio of the procedure body, the esures clause is met. I case the post coditio refers to old values of oe of the parameters, we eed the Remember rule: C \ code; Cofirm RP[@s t]; C \ code; Remember s, t; Cofirm RP/_ u, v, _\; Next we will see how procedure calls work by examiig a call to Fid_Factorial. The followig program fragmet computes the umber of permutatios of objects take r at a time: C \ Assume ³ r ³ 0; Fid_Factorial(, fact); d := r; 11

12 Fid_Factorial(d, dfact); Perm := fact/dfact; Cofirm Perm = P ; r To show correctess of this program fragmet, we will eed to apply the assigmet rule first, followed by two applicatios of the call rule with a assigmet betwee the two calls. The followig is a simple versio of the proof rule for procedure calls: C \ code; Cofirm pre[x a] C \ code; Cofirm "?a: T, post[@x a, x?a] Þ Q[a?a] C \ code; p(a); Cofirm Q Sice the declaratio rule establishes that if the requires clause is satisfied, the the esures clause is met upo completio of the procedure body, the first hypothesis of the call rule checks that the requiresclause pre holds whe the actual parameter a is substituted for the formal parameter x. The secod hypothesis asks that the esures clause post imply Q. sig i frot of the variable x refers to the value of x at the begiig of the procedure. This distiguishes the old value of x from the curret value. The extra complicatio here is the itroductio of a ew variable?a to stad for the value of the actual parameter a after the procedure p has modified it. The call rule is simpler to uderstad i the versio preseted above, but i ormal usage we do t wat to break out two separate hypotheses whe a sigle, slightly legthier oe will do. So we ordiarily combie this rule i a sigle hypothesis rule: C \ code; Cofirm pre[x a] Ù "?a: T, post[@x a, x?a] Þ Q[a?a] C\ code; p(a); Cofirm Q 12

13 With this rule available to us, we are ready to establish correctess of our program fragmet. Sice the last executable statemet i our fragmet is a assigmet, we apply the assigmet rule first, obtaiig: C \ Assume ³ r ³ 0 ; Fid_Factorial(, fact); d := r; Fid_Factorial(d, dfact); Cofirm fact/dfact = P ; r Next we eed the call rule; C \ Assume ³ r ³ 0 ; Fid_Factorial(, fact); d := r; Cofirm d ³ 0 Ù "?dfact : iteger,?dfact! fact/?dfact = P ; r Applyig the assigmet rule results i: C \ Assume ³ r ³ 0 ; Fid_Factorial(, fact); Cofirm - r ³ 0 Ù "?dfact fact/?dfact = P ; r Þ : iteger,?dfact Aother applicatio of the call rule yields: C \ Assume ³ r ³ 0 ; Cofirm ³ 0 Ù "?fact,?fact =! Þ - r ³ 0 Ù "?dfact : iteger,?dfact = ( - r)! Þ?fact/?dfact = P ; r = ( - r)! Þ Upo applyig the rules for Assume ad Cofirm, we get a implicatio: ³ r ³ 0 Þ ³ 0 Ù "?fact,?fact =! Þ ( - r ³ 0 Ù "?dfact : iteger,?dfact = ( - r)! Þ?fact/?dfact = P ; r 13

14 Sice ³ r ³ 0, ³ 0. Sice?fact =! ad?dfact = ( r)!, by a defiitio i combiatorics,?fact/?dfact = is correct. P, sice r P =!/( r)! Hece our program fragmet r The two examples we have just preseted performed calculatios o itegers i a programmig style, which is typical for maipulatig small objects, i.e., a costat parameter was passed to a procedure which performed some calculatios ad the assiged the resultig value to a variable parameter. This is typical ad reasoable because small objects take up little space, ad psychologically it seems reasoable to have a ew variable to represet the result of the operatio while the origial variable retais its value. I the case of Fid_Factorial, the costat parameter remaied fixed while the variable parameter fact had a ew value after the computatio was completed. Our simplified procedure declaratio rule was sufficiet for provig the correctess of procedures writte i this style. However, this programmig style is ot desirable whe programmig with large objects, or eve small oes i some cases. For example, i sortig the elemets of a array, a programmer would ot wat to create a ew array each time a permutatio of the give elemets is made. I order to cosume both time ad space, it is preferable to modify the existig array. This meas that there must be a way to specify what modificatio has bee made, ad this requires us to referece values of variables both before ad after the chage takes place. To accommodate this eed we have itroduced the use of the to be placed i frot of a variable var_ame to idicate that its value at a give poit i the program must be remembered 14

15 To illustrate the use of this idea, cosider a trivial procedure which icremets a give iteger by a costat value. Here, eve though it may ot require a lot of space to create a ew iteger to hold the icremeted value, psychologically we expect the give variable to have its old value destroyed ad replaced by its icremeted value. This procedure might be part of a iteger package: Procedure Icremet(var : iteger, cost c: iteger); requires mi_it + c max_it; esures + c; := + c; ed; The requires clause makes sure that the result is withi the bouds permitted for itegers. The esures clause states that the ew value of will be the old value of icremeted by c. Verificatio of procedures whose clauses refer to old values requires us to supplemet our declaratio rule as follows: C È {p_headig} \ Remember; Assume pre; body; Cofirm post; code; Cofirm Q; C \ Proc p(var x, cost y); requires pre; esures post; code; Cofirm Q; The ew keyword, which appears here idicates that values of all variables are to be saved as of this poit i the program. The proof rule for Remember is: C \ code; Cofirm Shift(Q); C \ code; Remember; Cofirm Q; where Shift(Q) is defied by: Shift(x) = x Shift(c) = c for ay costat c Shift(@x) = x Shift(f(e1,e2)) = f(shift(e1), Shift(e2)) The Shift fuctio removes oe-poud sig from ay give variable if oe is there. 15

16 At this poit, we ca ow make some geeral observatios about how our proof system works. Although the programmer must supply certai clauses specifyig program behavior, the geeratio of itermediate assertios is mechaical. A automated verifier ca determie sytactically what rule to apply at each step of the proof. Moreover, whe all the pertiet rules have bee applied, the statemet which remai are oes ivolvig oly the mathematical theory for the give program, ad the proof reasoig ca the be completed usig oly traditioal mathematical reasoig. A automatic verifier will perform three major tasks: (1) geeratio of assertios by applyig the rules, (2) simplificatio of these assertios, probably as the verifier proceeds through the code, rather tha all at oce, ad (3) applicatio of axioms ad theorems of the uderlyig mathematical theories i a attempt to prove the fial assertio. 16

Analysis Metrics. Intro to Algorithm Analysis. Slides. 12. Alg Analysis. 12. Alg Analysis

Analysis Metrics. Intro to Algorithm Analysis. Slides. 12. Alg Analysis. 12. Alg Analysis Itro to Algorithm Aalysis Aalysis Metrics Slides. Table of Cotets. Aalysis Metrics 3. Exact Aalysis Rules 4. Simple Summatio 5. Summatio Formulas 6. Order of Magitude 7. Big-O otatio 8. Big-O Theorems

More information

. Written in factored form it is easy to see that the roots are 2, 2, i,

. Written in factored form it is easy to see that the roots are 2, 2, i, CMPS A Itroductio to Programmig Programmig Assigmet 4 I this assigmet you will write a java program that determies the real roots of a polyomial that lie withi a specified rage. Recall that the roots (or

More information

Chapter 1. Introduction to Computers and C++ Programming. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 1. Introduction to Computers and C++ Programming. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 1 Itroductio to Computers ad C++ Programmig Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 1.1 Computer Systems 1.2 Programmig ad Problem Solvig 1.3 Itroductio to C++ 1.4 Testig

More information

Chapter 9. Pointers and Dynamic Arrays. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 9. Pointers and Dynamic Arrays. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 9 Poiters ad Dyamic Arrays Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 9.1 Poiters 9.2 Dyamic Arrays Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Slide 9-3

More information

Ones Assignment Method for Solving Traveling Salesman Problem

Ones Assignment Method for Solving Traveling Salesman Problem Joural of mathematics ad computer sciece 0 (0), 58-65 Oes Assigmet Method for Solvig Travelig Salesma Problem Hadi Basirzadeh Departmet of Mathematics, Shahid Chamra Uiversity, Ahvaz, Ira Article history:

More information

CIS 121 Data Structures and Algorithms with Java Spring Stacks and Queues Monday, February 12 / Tuesday, February 13

CIS 121 Data Structures and Algorithms with Java Spring Stacks and Queues Monday, February 12 / Tuesday, February 13 CIS Data Structures ad Algorithms with Java Sprig 08 Stacks ad Queues Moday, February / Tuesday, February Learig Goals Durig this lab, you will: Review stacks ad queues. Lear amortized ruig time aalysis

More information

Chapter 3 Classification of FFT Processor Algorithms

Chapter 3 Classification of FFT Processor Algorithms Chapter Classificatio of FFT Processor Algorithms The computatioal complexity of the Discrete Fourier trasform (DFT) is very high. It requires () 2 complex multiplicatios ad () complex additios [5]. As

More information

Big-O Analysis. Asymptotics

Big-O Analysis. Asymptotics Big-O Aalysis 1 Defiitio: Suppose that f() ad g() are oegative fuctios of. The we say that f() is O(g()) provided that there are costats C > 0 ad N > 0 such that for all > N, f() Cg(). Big-O expresses

More information

CS 11 C track: lecture 1

CS 11 C track: lecture 1 CS 11 C track: lecture 1 Prelimiaries Need a CMS cluster accout http://acctreq.cms.caltech.edu/cgi-bi/request.cgi Need to kow UNIX IMSS tutorial liked from track home page Track home page: http://courses.cms.caltech.edu/courses/cs11/material

More information

COSC 1P03. Ch 7 Recursion. Introduction to Data Structures 8.1

COSC 1P03. Ch 7 Recursion. Introduction to Data Structures 8.1 COSC 1P03 Ch 7 Recursio Itroductio to Data Structures 8.1 COSC 1P03 Recursio Recursio I Mathematics factorial Fiboacci umbers defie ifiite set with fiite defiitio I Computer Sciece sytax rules fiite defiitio,

More information

1.2 Binomial Coefficients and Subsets

1.2 Binomial Coefficients and Subsets 1.2. BINOMIAL COEFFICIENTS AND SUBSETS 13 1.2 Biomial Coefficiets ad Subsets 1.2-1 The loop below is part of a program to determie the umber of triagles formed by poits i the plae. for i =1 to for j =

More information

Lecture 1: Introduction and Strassen s Algorithm

Lecture 1: Introduction and Strassen s Algorithm 5-750: Graduate Algorithms Jauary 7, 08 Lecture : Itroductio ad Strasse s Algorithm Lecturer: Gary Miller Scribe: Robert Parker Itroductio Machie models I this class, we will primarily use the Radom Access

More information

Pseudocode ( 1.1) Analysis of Algorithms. Primitive Operations. Pseudocode Details. Running Time ( 1.1) Estimating performance

Pseudocode ( 1.1) Analysis of Algorithms. Primitive Operations. Pseudocode Details. Running Time ( 1.1) Estimating performance Aalysis of Algorithms Iput Algorithm Output A algorithm is a step-by-step procedure for solvig a problem i a fiite amout of time. Pseudocode ( 1.1) High-level descriptio of a algorithm More structured

More information

Python Programming: An Introduction to Computer Science

Python Programming: An Introduction to Computer Science Pytho Programmig: A Itroductio to Computer Sciece Chapter 1 Computers ad Programs 1 Objectives To uderstad the respective roles of hardware ad software i a computig system. To lear what computer scietists

More information

Chapter 5. Functions for All Subtasks. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 5. Functions for All Subtasks. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 5 Fuctios for All Subtasks Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 5.1 void Fuctios 5.2 Call-By-Referece Parameters 5.3 Usig Procedural Abstractio 5.4 Testig ad Debuggig

More information

Python Programming: An Introduction to Computer Science

Python Programming: An Introduction to Computer Science Pytho Programmig: A Itroductio to Computer Sciece Chapter 6 Defiig Fuctios Pytho Programmig, 2/e 1 Objectives To uderstad why programmers divide programs up ito sets of cooperatig fuctios. To be able to

More information

CSC165H1 Worksheet: Tutorial 8 Algorithm analysis (SOLUTIONS)

CSC165H1 Worksheet: Tutorial 8 Algorithm analysis (SOLUTIONS) CSC165H1, Witer 018 Learig Objectives By the ed of this worksheet, you will: Aalyse the ruig time of fuctios cotaiig ested loops. 1. Nested loop variatios. Each of the followig fuctios takes as iput a

More information

Bezier curves. Figure 2 shows cubic Bezier curves for various control points. In a Bezier curve, only

Bezier curves. Figure 2 shows cubic Bezier curves for various control points. In a Bezier curve, only Edited: Yeh-Liag Hsu (998--; recommeded: Yeh-Liag Hsu (--9; last updated: Yeh-Liag Hsu (9--7. Note: This is the course material for ME55 Geometric modelig ad computer graphics, Yua Ze Uiversity. art of

More information

CS : Programming for Non-Majors, Summer 2007 Programming Project #3: Two Little Calculations Due by 12:00pm (noon) Wednesday June

CS : Programming for Non-Majors, Summer 2007 Programming Project #3: Two Little Calculations Due by 12:00pm (noon) Wednesday June CS 1313 010: Programmig for No-Majors, Summer 2007 Programmig Project #3: Two Little Calculatios Due by 12:00pm (oo) Wedesday Jue 27 2007 This third assigmet will give you experiece writig programs that

More information

Chapter 10. Defining Classes. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 10. Defining Classes. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 10 Defiig Classes Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 10.1 Structures 10.2 Classes 10.3 Abstract Data Types 10.4 Itroductio to Iheritace Copyright 2015 Pearso Educatio,

More information

CSC 220: Computer Organization Unit 11 Basic Computer Organization and Design

CSC 220: Computer Organization Unit 11 Basic Computer Organization and Design College of Computer ad Iformatio Scieces Departmet of Computer Sciece CSC 220: Computer Orgaizatio Uit 11 Basic Computer Orgaizatio ad Desig 1 For the rest of the semester, we ll focus o computer architecture:

More information

The Magma Database file formats

The Magma Database file formats The Magma Database file formats Adrew Gaylard, Bret Pikey, ad Mart-Mari Breedt Johaesburg, South Africa 15th May 2006 1 Summary Magma is a ope-source object database created by Chris Muller, of Kasas City,

More information

On Infinite Groups that are Isomorphic to its Proper Infinite Subgroup. Jaymar Talledo Balihon. Abstract

On Infinite Groups that are Isomorphic to its Proper Infinite Subgroup. Jaymar Talledo Balihon. Abstract O Ifiite Groups that are Isomorphic to its Proper Ifiite Subgroup Jaymar Talledo Baliho Abstract Two groups are isomorphic if there exists a isomorphism betwee them Lagrage Theorem states that the order

More information

Octahedral Graph Scaling

Octahedral Graph Scaling Octahedral Graph Scalig Peter Russell Jauary 1, 2015 Abstract There is presetly o strog iterpretatio for the otio of -vertex graph scalig. This paper presets a ew defiitio for the term i the cotext of

More information

Chapter 4. Procedural Abstraction and Functions That Return a Value. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 4. Procedural Abstraction and Functions That Return a Value. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 4 Procedural Abstractio ad Fuctios That Retur a Value Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 4.1 Top-Dow Desig 4.2 Predefied Fuctios 4.3 Programmer-Defied Fuctios 4.4

More information

Computers and Scientific Thinking

Computers and Scientific Thinking Computers ad Scietific Thikig David Reed, Creighto Uiversity Chapter 15 JavaScript Strigs 1 Strigs as Objects so far, your iteractive Web pages have maipulated strigs i simple ways use text box to iput

More information

Chapter 11. Friends, Overloaded Operators, and Arrays in Classes. Copyright 2014 Pearson Addison-Wesley. All rights reserved.

Chapter 11. Friends, Overloaded Operators, and Arrays in Classes. Copyright 2014 Pearson Addison-Wesley. All rights reserved. Chapter 11 Frieds, Overloaded Operators, ad Arrays i Classes Copyright 2014 Pearso Addiso-Wesley. All rights reserved. Overview 11.1 Fried Fuctios 11.2 Overloadig Operators 11.3 Arrays ad Classes 11.4

More information

Homework 1 Solutions MA 522 Fall 2017

Homework 1 Solutions MA 522 Fall 2017 Homework 1 Solutios MA 5 Fall 017 1. Cosider the searchig problem: Iput A sequece of umbers A = [a 1,..., a ] ad a value v. Output A idex i such that v = A[i] or the special value NIL if v does ot appear

More information

Lecture 5. Counting Sort / Radix Sort

Lecture 5. Counting Sort / Radix Sort Lecture 5. Coutig Sort / Radix Sort T. H. Corme, C. E. Leiserso ad R. L. Rivest Itroductio to Algorithms, 3rd Editio, MIT Press, 2009 Sugkyukwa Uiversity Hyuseug Choo choo@skku.edu Copyright 2000-2018

More information

Elementary Educational Computer

Elementary Educational Computer Chapter 5 Elemetary Educatioal Computer. Geeral structure of the Elemetary Educatioal Computer (EEC) The EEC coforms to the 5 uits structure defied by vo Neuma's model (.) All uits are preseted i a simplified

More information

Recursion. Computer Science S-111 Harvard University David G. Sullivan, Ph.D. Review: Method Frames

Recursion. Computer Science S-111 Harvard University David G. Sullivan, Ph.D. Review: Method Frames Uit 4, Part 3 Recursio Computer Sciece S-111 Harvard Uiversity David G. Sulliva, Ph.D. Review: Method Frames Whe you make a method call, the Java rutime sets aside a block of memory kow as the frame of

More information

9.1. Sequences and Series. Sequences. What you should learn. Why you should learn it. Definition of Sequence

9.1. Sequences and Series. Sequences. What you should learn. Why you should learn it. Definition of Sequence _9.qxd // : AM Page Chapter 9 Sequeces, Series, ad Probability 9. Sequeces ad Series What you should lear Use sequece otatio to write the terms of sequeces. Use factorial otatio. Use summatio otatio to

More information

CIS 121 Data Structures and Algorithms with Java Spring Stacks, Queues, and Heaps Monday, February 18 / Tuesday, February 19

CIS 121 Data Structures and Algorithms with Java Spring Stacks, Queues, and Heaps Monday, February 18 / Tuesday, February 19 CIS Data Structures ad Algorithms with Java Sprig 09 Stacks, Queues, ad Heaps Moday, February 8 / Tuesday, February 9 Stacks ad Queues Recall the stack ad queue ADTs (abstract data types from lecture.

More information

MR-2010I %MktBSize Macro 989. %MktBSize Macro

MR-2010I %MktBSize Macro 989. %MktBSize Macro MR-2010I %MktBSize Macro 989 %MktBSize Macro The %MktBSize autocall macro suggests sizes for balaced icomplete block desigs (BIBDs). The sizes that it reports are sizes that meet ecessary but ot sufficiet

More information

Convergence results for conditional expectations

Convergence results for conditional expectations Beroulli 11(4), 2005, 737 745 Covergece results for coditioal expectatios IRENE CRIMALDI 1 ad LUCA PRATELLI 2 1 Departmet of Mathematics, Uiversity of Bologa, Piazza di Porta Sa Doato 5, 40126 Bologa,

More information

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 4. The Processor. Part A Datapath Design

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 4. The Processor. Part A Datapath Design COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Iterface 5 th Editio Chapter The Processor Part A path Desig Itroductio CPU performace factors Istructio cout Determied by ISA ad compiler. CPI ad

More information

n n B. How many subsets of C are there of cardinality n. We are selecting elements for such a

n n B. How many subsets of C are there of cardinality n. We are selecting elements for such a 4. [10] Usig a combiatorial argumet, prove that for 1: = 0 = Let A ad B be disjoit sets of cardiality each ad C = A B. How may subsets of C are there of cardiality. We are selectig elemets for such a subset

More information

Math Section 2.2 Polynomial Functions

Math Section 2.2 Polynomial Functions Math 1330 - Sectio. Polyomial Fuctios Our objectives i workig with polyomial fuctios will be, first, to gather iformatio about the graph of the fuctio ad, secod, to use that iformatio to geerate a reasoably

More information

5.3 Recursive definitions and structural induction

5.3 Recursive definitions and structural induction /8/05 5.3 Recursive defiitios ad structural iductio CSE03 Discrete Computatioal Structures Lecture 6 A recursively defied picture Recursive defiitios e sequece of powers of is give by a = for =0,,, Ca

More information

CIS 121 Data Structures and Algorithms with Java Fall Big-Oh Notation Tuesday, September 5 (Make-up Friday, September 8)

CIS 121 Data Structures and Algorithms with Java Fall Big-Oh Notation Tuesday, September 5 (Make-up Friday, September 8) CIS 11 Data Structures ad Algorithms with Java Fall 017 Big-Oh Notatio Tuesday, September 5 (Make-up Friday, September 8) Learig Goals Review Big-Oh ad lear big/small omega/theta otatios Practice solvig

More information

Appendix D. Controller Implementation

Appendix D. Controller Implementation COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Iterface 5 th Editio Appedix D Cotroller Implemetatio Cotroller Implemetatios Combiatioal logic (sigle-cycle); Fiite state machie (multi-cycle, pipelied);

More information

On (K t e)-saturated Graphs

On (K t e)-saturated Graphs Noame mauscript No. (will be iserted by the editor O (K t e-saturated Graphs Jessica Fuller Roald J. Gould the date of receipt ad acceptace should be iserted later Abstract Give a graph H, we say a graph

More information

top() Applications of Stacks

top() Applications of Stacks CS22 Algorithms ad Data Structures MW :00 am - 2: pm, MSEC 0 Istructor: Xiao Qi Lecture 6: Stacks ad Queues Aoucemets Quiz results Homework 2 is available Due o September 29 th, 2004 www.cs.mt.edu~xqicoursescs22

More information

Matrix representation of a solution of a combinatorial problem of the group theory

Matrix representation of a solution of a combinatorial problem of the group theory Matrix represetatio of a solutio of a combiatorial problem of the group theory Krasimir Yordzhev, Lilyaa Totia Faculty of Mathematics ad Natural Scieces South-West Uiversity 66 Iva Mihailov Str, 2700 Blagoevgrad,

More information

APPLICATION NOTE PACE1750AE BUILT-IN FUNCTIONS

APPLICATION NOTE PACE1750AE BUILT-IN FUNCTIONS APPLICATION NOTE PACE175AE BUILT-IN UNCTIONS About This Note This applicatio brief is iteded to explai ad demostrate the use of the special fuctios that are built ito the PACE175AE processor. These powerful

More information

Data diverse software fault tolerance techniques

Data diverse software fault tolerance techniques Data diverse software fault tolerace techiques Complemets desig diversity by compesatig for desig diversity s s limitatios Ivolves obtaiig a related set of poits i the program data space, executig the

More information

Exact Minimum Lower Bound Algorithm for Traveling Salesman Problem

Exact Minimum Lower Bound Algorithm for Traveling Salesman Problem Exact Miimum Lower Boud Algorithm for Travelig Salesma Problem Mohamed Eleiche GeoTiba Systems mohamed.eleiche@gmail.com Abstract The miimum-travel-cost algorithm is a dyamic programmig algorithm to compute

More information

A New Morphological 3D Shape Decomposition: Grayscale Interframe Interpolation Method

A New Morphological 3D Shape Decomposition: Grayscale Interframe Interpolation Method A ew Morphological 3D Shape Decompositio: Grayscale Iterframe Iterpolatio Method D.. Vizireau Politehica Uiversity Bucharest, Romaia ae@comm.pub.ro R. M. Udrea Politehica Uiversity Bucharest, Romaia mihea@comm.pub.ro

More information

Big-O Analysis. Asymptotics

Big-O Analysis. Asymptotics Big-O Aalysis 1 Defiitio: Suppose that f() ad g() are oegative fuctios of. The we say that f() is O(g()) provided that there are costats C > 0 ad N > 0 such that for all > N, f() Cg(). Big-O expresses

More information

EVALUATION OF TRIGONOMETRIC FUNCTIONS

EVALUATION OF TRIGONOMETRIC FUNCTIONS EVALUATION OF TRIGONOMETRIC FUNCTIONS Whe first exposed to trigoometric fuctios i high school studets are expected to memorize the values of the trigoometric fuctios of sie cosie taget for the special

More information

It just came to me that I 8.2 GRAPHS AND CONVERGENCE

It just came to me that I 8.2 GRAPHS AND CONVERGENCE 44 Chapter 8 Discrete Mathematics: Fuctios o the Set of Natural Numbers (a) Take several odd, positive itegers for a ad write out eough terms of the 3N sequece to reach a repeatig loop (b) Show that ot

More information

How do we evaluate algorithms?

How do we evaluate algorithms? F2 Readig referece: chapter 2 + slides Algorithm complexity Big O ad big Ω To calculate ruig time Aalysis of recursive Algorithms Next time: Litterature: slides mostly The first Algorithm desig methods:

More information

Structuring Redundancy for Fault Tolerance. CSE 598D: Fault Tolerant Software

Structuring Redundancy for Fault Tolerance. CSE 598D: Fault Tolerant Software Structurig Redudacy for Fault Tolerace CSE 598D: Fault Tolerat Software What do we wat to achieve? Versios Damage Assessmet Versio 1 Error Detectio Iputs Versio 2 Voter Outputs State Restoratio Cotiued

More information

Recursion. Recursion. Mathematical induction: example. Recursion. The sum of the first n odd numbers is n 2 : Informal proof: Principle:

Recursion. Recursion. Mathematical induction: example. Recursion. The sum of the first n odd numbers is n 2 : Informal proof: Principle: Recursio Recursio Jordi Cortadella Departmet of Computer Sciece Priciple: Reduce a complex problem ito a simpler istace of the same problem Recursio Itroductio to Programmig Dept. CS, UPC 2 Mathematical

More information

Abstract. Chapter 4 Computation. Overview 8/13/18. Bjarne Stroustrup Note:

Abstract. Chapter 4 Computation. Overview 8/13/18. Bjarne Stroustrup   Note: Chapter 4 Computatio Bjare Stroustrup www.stroustrup.com/programmig Abstract Today, I ll preset the basics of computatio. I particular, we ll discuss expressios, how to iterate over a series of values

More information

Major CSL Write your name and entry no on every sheet of the answer script. Time 2 Hrs Max Marks 70

Major CSL Write your name and entry no on every sheet of the answer script. Time 2 Hrs Max Marks 70 NOTE:. Attempt all seve questios. Major CSL 02 2. Write your ame ad etry o o every sheet of the aswer script. Time 2 Hrs Max Marks 70 Q No Q Q 2 Q 3 Q 4 Q 5 Q 6 Q 7 Total MM 6 2 4 0 8 4 6 70 Q. Write a

More information

Project 2.5 Improved Euler Implementation

Project 2.5 Improved Euler Implementation Project 2.5 Improved Euler Implemetatio Figure 2.5.10 i the text lists TI-85 ad BASIC programs implemetig the improved Euler method to approximate the solutio of the iitial value problem dy dx = x+ y,

More information

n Some thoughts on software development n The idea of a calculator n Using a grammar n Expression evaluation n Program organization n Analysis

n Some thoughts on software development n The idea of a calculator n Using a grammar n Expression evaluation n Program organization n Analysis Overview Chapter 6 Writig a Program Bjare Stroustrup Some thoughts o software developmet The idea of a calculator Usig a grammar Expressio evaluatio Program orgaizatio www.stroustrup.com/programmig 3 Buildig

More information

FREQUENCY ESTIMATION OF INTERNET PACKET STREAMS WITH LIMITED SPACE: UPPER AND LOWER BOUNDS

FREQUENCY ESTIMATION OF INTERNET PACKET STREAMS WITH LIMITED SPACE: UPPER AND LOWER BOUNDS FREQUENCY ESTIMATION OF INTERNET PACKET STREAMS WITH LIMITED SPACE: UPPER AND LOWER BOUNDS Prosejit Bose Evagelos Kraakis Pat Mori Yihui Tag School of Computer Sciece, Carleto Uiversity {jit,kraakis,mori,y

More information

Lecture 18. Optimization in n dimensions

Lecture 18. Optimization in n dimensions Lecture 8 Optimizatio i dimesios Itroductio We ow cosider the problem of miimizig a sigle scalar fuctio of variables, f x, where x=[ x, x,, x ]T. The D case ca be visualized as fidig the lowest poit of

More information

Combination Labelings Of Graphs

Combination Labelings Of Graphs Applied Mathematics E-Notes, (0), - c ISSN 0-0 Available free at mirror sites of http://wwwmaththuedutw/ame/ Combiatio Labeligs Of Graphs Pak Chig Li y Received February 0 Abstract Suppose G = (V; E) is

More information

27 Refraction, Dispersion, Internal Reflection

27 Refraction, Dispersion, Internal Reflection Chapter 7 Refractio, Dispersio, Iteral Reflectio 7 Refractio, Dispersio, Iteral Reflectio Whe we talked about thi film iterferece, we said that whe light ecouters a smooth iterface betwee two trasparet

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe Copyright 2016 Ramez Elmasri ad Shamkat B. Navathe CHAPTER 19 Query Optimizatio Copyright 2016 Ramez Elmasri ad Shamkat B. Navathe Itroductio Query optimizatio Coducted by a query optimizer i a DBMS Goal:

More information

Solution printed. Do not start the test until instructed to do so! CS 2604 Data Structures Midterm Spring, Instructions:

Solution printed. Do not start the test until instructed to do so! CS 2604 Data Structures Midterm Spring, Instructions: CS 604 Data Structures Midterm Sprig, 00 VIRG INIA POLYTECHNIC INSTITUTE AND STATE U T PROSI M UNI VERSI TY Istructios: Prit your ame i the space provided below. This examiatio is closed book ad closed

More information

% Sun Logo for. X3T10/95-229, Revision 0. April 18, 1998

% Sun Logo for. X3T10/95-229, Revision 0. April 18, 1998 Su Microsystems, Ic. 2550 Garcia Aveue Moutai View, CA 94045 415 960-1300 X3T10/95-229, Revisio 0 April 18, 1998 % Su Logo for Joh Lohmeyer Chairperso, X3T10 Symbios Logic Ic. 1635 Aeroplaza Drive Colorado

More information

The Adjacency Matrix and The nth Eigenvalue

The Adjacency Matrix and The nth Eigenvalue Spectral Graph Theory Lecture 3 The Adjacecy Matrix ad The th Eigevalue Daiel A. Spielma September 5, 2012 3.1 About these otes These otes are ot ecessarily a accurate represetatio of what happeed i class.

More information

Examples and Applications of Binary Search

Examples and Applications of Binary Search Toy Gog ITEE Uiersity of Queeslad I the secod lecture last week we studied the biary search algorithm that soles the problem of determiig if a particular alue appears i a sorted list of iteger or ot. We

More information

CMPT 125 Assignment 2 Solutions

CMPT 125 Assignment 2 Solutions CMPT 25 Assigmet 2 Solutios Questio (20 marks total) a) Let s cosider a iteger array of size 0. (0 marks, each part is 2 marks) it a[0]; I. How would you assig a poiter, called pa, to store the address

More information

Polynomial Functions and Models. Learning Objectives. Polynomials. P (x) = a n x n + a n 1 x n a 1 x + a 0, a n 0

Polynomial Functions and Models. Learning Objectives. Polynomials. P (x) = a n x n + a n 1 x n a 1 x + a 0, a n 0 Polyomial Fuctios ad Models 1 Learig Objectives 1. Idetify polyomial fuctios ad their degree 2. Graph polyomial fuctios usig trasformatios 3. Idetify the real zeros of a polyomial fuctio ad their multiplicity

More information

Lower Bounds for Sorting

Lower Bounds for Sorting Liear Sortig Topics Covered: Lower Bouds for Sortig Coutig Sort Radix Sort Bucket Sort Lower Bouds for Sortig Compariso vs. o-compariso sortig Decisio tree model Worst case lower boud Compariso Sortig

More information

l-1 text string ( l characters : 2lbytes) pointer table the i-th word table of coincidence number of prex characters. pointer table the i-th word

l-1 text string ( l characters : 2lbytes) pointer table the i-th word table of coincidence number of prex characters. pointer table the i-th word A New Method of N-gram Statistics for Large Number of ad Automatic Extractio of Words ad Phrases from Large Text Data of Japaese Makoto Nagao, Shisuke Mori Departmet of Electrical Egieerig Kyoto Uiversity

More information

Evaluation scheme for Tracking in AMI

Evaluation scheme for Tracking in AMI A M I C o m m u i c a t i o A U G M E N T E D M U L T I - P A R T Y I N T E R A C T I O N http://www.amiproject.org/ Evaluatio scheme for Trackig i AMI S. Schreiber a D. Gatica-Perez b AMI WP4 Trackig:

More information

New Results on Energy of Graphs of Small Order

New Results on Energy of Graphs of Small Order Global Joural of Pure ad Applied Mathematics. ISSN 0973-1768 Volume 13, Number 7 (2017), pp. 2837-2848 Research Idia Publicatios http://www.ripublicatio.com New Results o Eergy of Graphs of Small Order

More information

Outline and Reading. Analysis of Algorithms. Running Time. Experimental Studies. Limitations of Experiments. Theoretical Analysis

Outline and Reading. Analysis of Algorithms. Running Time. Experimental Studies. Limitations of Experiments. Theoretical Analysis Outlie ad Readig Aalysis of Algorithms Iput Algorithm Output Ruig time ( 3.) Pseudo-code ( 3.2) Coutig primitive operatios ( 3.3-3.) Asymptotic otatio ( 3.6) Asymptotic aalysis ( 3.7) Case study Aalysis

More information

Lecture Notes 6 Introduction to algorithm analysis CSS 501 Data Structures and Object-Oriented Programming

Lecture Notes 6 Introduction to algorithm analysis CSS 501 Data Structures and Object-Oriented Programming Lecture Notes 6 Itroductio to algorithm aalysis CSS 501 Data Structures ad Object-Orieted Programmig Readig for this lecture: Carrao, Chapter 10 To be covered i this lecture: Itroductio to algorithm aalysis

More information

1 Graph Sparsfication

1 Graph Sparsfication CME 305: Discrete Mathematics ad Algorithms 1 Graph Sparsficatio I this sectio we discuss the approximatio of a graph G(V, E) by a sparse graph H(V, F ) o the same vertex set. I particular, we cosider

More information

CHAPTER IV: GRAPH THEORY. Section 1: Introduction to Graphs

CHAPTER IV: GRAPH THEORY. Section 1: Introduction to Graphs CHAPTER IV: GRAPH THEORY Sectio : Itroductio to Graphs Sice this class is called Number-Theoretic ad Discrete Structures, it would be a crime to oly focus o umber theory regardless how woderful those topics

More information

The Closest Line to a Data Set in the Plane. David Gurney Southeastern Louisiana University Hammond, Louisiana

The Closest Line to a Data Set in the Plane. David Gurney Southeastern Louisiana University Hammond, Louisiana The Closest Lie to a Data Set i the Plae David Gurey Southeaster Louisiaa Uiversity Hammod, Louisiaa ABSTRACT This paper looks at three differet measures of distace betwee a lie ad a data set i the plae:

More information

A Generalized Set Theoretic Approach for Time and Space Complexity Analysis of Algorithms and Functions

A Generalized Set Theoretic Approach for Time and Space Complexity Analysis of Algorithms and Functions Proceedigs of the 10th WSEAS Iteratioal Coferece o APPLIED MATHEMATICS, Dallas, Texas, USA, November 1-3, 2006 316 A Geeralized Set Theoretic Approach for Time ad Space Complexity Aalysis of Algorithms

More information

Running Time. Analysis of Algorithms. Experimental Studies. Limitations of Experiments

Running Time. Analysis of Algorithms. Experimental Studies. Limitations of Experiments Ruig Time Aalysis of Algorithms Iput Algorithm Output A algorithm is a step-by-step procedure for solvig a problem i a fiite amout of time. Most algorithms trasform iput objects ito output objects. The

More information

MAXIMUM MATCHINGS IN COMPLETE MULTIPARTITE GRAPHS

MAXIMUM MATCHINGS IN COMPLETE MULTIPARTITE GRAPHS Fura Uiversity Electroic Joural of Udergraduate Matheatics Volue 00, 1996 6-16 MAXIMUM MATCHINGS IN COMPLETE MULTIPARTITE GRAPHS DAVID SITTON Abstract. How ay edges ca there be i a axiu atchig i a coplete

More information

Running Time ( 3.1) Analysis of Algorithms. Experimental Studies. Limitations of Experiments

Running Time ( 3.1) Analysis of Algorithms. Experimental Studies. Limitations of Experiments Ruig Time ( 3.1) Aalysis of Algorithms Iput Algorithm Output A algorithm is a step- by- step procedure for solvig a problem i a fiite amout of time. Most algorithms trasform iput objects ito output objects.

More information

Analysis of Algorithms

Analysis of Algorithms Aalysis of Algorithms Iput Algorithm Output A algorithm is a step-by-step procedure for solvig a problem i a fiite amout of time. Ruig Time Most algorithms trasform iput objects ito output objects. The

More information

Task scenarios Outline. Scenarios in Knowledge Extraction. Proposed Framework for Scenario to Design Diagram Transformation

Task scenarios Outline. Scenarios in Knowledge Extraction. Proposed Framework for Scenario to Design Diagram Transformation 6-0-0 Kowledge Trasformatio from Task Scearios to View-based Desig Diagrams Nima Dezhkam Kamra Sartipi {dezhka, sartipi}@mcmaster.ca Departmet of Computig ad Software McMaster Uiversity CANADA SEKE 08

More information

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 13 Control and Sequencing: Hardwired and Microprogrammed Control

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 13 Control and Sequencing: Hardwired and Microprogrammed Control EE 459/500 HDL Based Digital Desig with Programmable Logic Lecture 13 Cotrol ad Sequecig: Hardwired ad Microprogrammed Cotrol Refereces: Chapter s 4,5 from textbook Chapter 7 of M.M. Mao ad C.R. Kime,

More information

Fast Fourier Transform (FFT) Algorithms

Fast Fourier Transform (FFT) Algorithms Fast Fourier Trasform FFT Algorithms Relatio to the z-trasform elsewhere, ozero, z x z X x [ ] 2 ~ elsewhere,, ~ e j x X x x π j e z z X X π 2 ~ The DFS X represets evely spaced samples of the z- trasform

More information

Data Structures and Algorithms. Analysis of Algorithms

Data Structures and Algorithms. Analysis of Algorithms Data Structures ad Algorithms Aalysis of Algorithms Outlie Ruig time Pseudo-code Big-oh otatio Big-theta otatio Big-omega otatio Asymptotic algorithm aalysis Aalysis of Algorithms Iput Algorithm Output

More information

3D Model Retrieval Method Based on Sample Prediction

3D Model Retrieval Method Based on Sample Prediction 20 Iteratioal Coferece o Computer Commuicatio ad Maagemet Proc.of CSIT vol.5 (20) (20) IACSIT Press, Sigapore 3D Model Retrieval Method Based o Sample Predictio Qigche Zhag, Ya Tag* School of Computer

More information

6.854J / J Advanced Algorithms Fall 2008

6.854J / J Advanced Algorithms Fall 2008 MIT OpeCourseWare http://ocw.mit.edu 6.854J / 18.415J Advaced Algorithms Fall 2008 For iformatio about citig these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. 18.415/6.854 Advaced Algorithms

More information

Review: The ACID properties

Review: The ACID properties Recovery Review: The ACID properties A tomicity: All actios i the Xactio happe, or oe happe. C osistecy: If each Xactio is cosistet, ad the DB starts cosistet, it eds up cosistet. I solatio: Executio of

More information

Lecture 7 7 Refraction and Snell s Law Reading Assignment: Read Kipnis Chapter 4 Refraction of Light, Section III, IV

Lecture 7 7 Refraction and Snell s Law Reading Assignment: Read Kipnis Chapter 4 Refraction of Light, Section III, IV Lecture 7 7 Refractio ad Sell s Law Readig Assigmet: Read Kipis Chapter 4 Refractio of Light, Sectio III, IV 7. History I Eglish-speakig coutries, the law of refractio is kow as Sell s Law, after the Dutch

More information

Classes and Objects. Again: Distance between points within the first quadrant. José Valente de Oliveira 4-1

Classes and Objects. Again: Distance between points within the first quadrant. José Valente de Oliveira 4-1 Classes ad Objects jvo@ualg.pt José Valete de Oliveira 4-1 Agai: Distace betwee poits withi the first quadrat Sample iput Sample output 1 1 3 4 2 jvo@ualg.pt José Valete de Oliveira 4-2 1 The simplest

More information

End Semester Examination CSE, III Yr. (I Sem), 30002: Computer Organization

End Semester Examination CSE, III Yr. (I Sem), 30002: Computer Organization Ed Semester Examiatio 2013-14 CSE, III Yr. (I Sem), 30002: Computer Orgaizatio Istructios: GROUP -A 1. Write the questio paper group (A, B, C, D), o frot page top of aswer book, as per what is metioed

More information

Module 8-7: Pascal s Triangle and the Binomial Theorem

Module 8-7: Pascal s Triangle and the Binomial Theorem Module 8-7: Pascal s Triagle ad the Biomial Theorem Gregory V. Bard April 5, 017 A Note about Notatio Just to recall, all of the followig mea the same thig: ( 7 7C 4 C4 7 7C4 5 4 ad they are (all proouced

More information

Introduction to Sigma Notation

Introduction to Sigma Notation Itroductio to Siga Notatio Steph de Silva //207 What is siga otatio? is the capital Greek letter for the soud s I this case, it s just shorthad for su Siga otatio is what we use whe we have a series of

More information

CS 683: Advanced Design and Analysis of Algorithms

CS 683: Advanced Design and Analysis of Algorithms CS 683: Advaced Desig ad Aalysis of Algorithms Lecture 6, February 1, 2008 Lecturer: Joh Hopcroft Scribes: Shaomei Wu, Etha Feldma February 7, 2008 1 Threshold for k CNF Satisfiability I the previous lecture,

More information

GE FUNDAMENTALS OF COMPUTING AND PROGRAMMING UNIT III

GE FUNDAMENTALS OF COMPUTING AND PROGRAMMING UNIT III GE2112 - FUNDAMENTALS OF COMPUTING AND PROGRAMMING UNIT III PROBLEM SOLVING AND OFFICE APPLICATION SOFTWARE Plaig the Computer Program Purpose Algorithm Flow Charts Pseudocode -Applicatio Software Packages-

More information

Lecture 6. Lecturer: Ronitt Rubinfeld Scribes: Chen Ziv, Eliav Buchnik, Ophir Arie, Jonathan Gradstein

Lecture 6. Lecturer: Ronitt Rubinfeld Scribes: Chen Ziv, Eliav Buchnik, Ophir Arie, Jonathan Gradstein 068.670 Subliear Time Algorithms November, 0 Lecture 6 Lecturer: Roitt Rubifeld Scribes: Che Ziv, Eliav Buchik, Ophir Arie, Joatha Gradstei Lesso overview. Usig the oracle reductio framework for approximatig

More information

n The C++ template facility provides the ability to define n A generic facility allows code to be written once then

n The C++ template facility provides the ability to define n A generic facility allows code to be written once then UCLA PIC 10 B Problem Solvig usig C++ Programmig Ivo Diov, Asst. Prof. i Mathematics, Neurology, Statistics Istructor: Teachig Assistat: Suzae Nezzar, Mathematics Chapter 13 Templates for More Abstractio

More information

One advantage that SONAR has over any other music-sequencing product I ve worked

One advantage that SONAR has over any other music-sequencing product I ve worked *gajedra* D:/Thomso_Learig_Projects/Garrigus_163132/z_productio/z_3B2_3D_files/Garrigus_163132_ch17.3d, 14/11/08/16:26:39, 16:26, page: 647 17 CAL 101 Oe advatage that SONAR has over ay other music-sequecig

More information