COURSEWORK 1 FOR INF2B: FINDING THE DISTANCE OF CLOSEST PAIRS OF POINTS ISSUED: 9FEBRUARY 2017

Size: px
Start display at page:

Download "COURSEWORK 1 FOR INF2B: FINDING THE DISTANCE OF CLOSEST PAIRS OF POINTS ISSUED: 9FEBRUARY 2017"

Transcription

1 COURSEWORK 1 FOR INF2B: FINDING THE DISTANCE OF CLOSEST PAIRS OF POINTS ISSUED: 9FEBRUARY 2017 Submiion Deadline: The ourework onit of two part (of a different nature) relating to one problem. A hown below thee have eparate deadline, you annot wap the part round or ubmit either part later than the tated deadline (unle you have permiion to do o from the year organier). Part 1 onit of Exerie 1 on page 3, 2.1 and Exerie 2 on page 9, 2.2; thee involve fairly traightforward analyi. Submit Part 1 by: 4.00PM, 27 February Part 2 onit of the tak in 3; thee are all oftware related. Submit Part 2 by: 4.00PM, 10 Marh See 4 at the end of thi doument for intrution on how to ubmit. 1. Introdution In thi pratial we will onider two method of finding the ditane of a loet pair of point from a given et in the plane (i.e., we retrit to 2 dimenion). For reaon diued below, we find the quare of the ditane. It would be quite eay to hange the algorithm o that they return a loet pair of point a well without affeting their aymptoti runtime. The pratial ha everal aim: 1. Pratie at aymptoti analyi (with guidane). 2. Careful implementation of one algorithm (an implementation of the other algorithm i upplied). 3. Carry out timing experiment in order to: (a) Compare the algorithm that you implement with one that i upplied and deide the point from whih one i more effiient than the other (i.e., the overhead are overweighed by the advantage). (b) Determine the ontant for the aymptoti analyi a it applie to your partiular implementation. You an onentrate on Part 1 (i.e., thing before 3) firt and then on the ret. However it would be a good idea to read the entire doument through initially (without going into great detail) o that you know what i expeted for the omplete ourework. Note that although the doument i fairly long the tak you are required to arry out are quite modet. The emphai here i on undertanding the problem well and o plenty of diuion ha been inluded; the modet nature of the tak i deliberate o that you have time to follow up variou apet of the problem to whatever depth you like. The pratial require you to ubmit variou thing. Eah of thee ha ome appropriate mark aigned. It would however be a eriou error to aume that by arrying out only thee tak you have obtained the mot (or indeed the main) benefit from the pratial. Throughout the text you are prompted to think about variou matter that are not part of the ubmiion. You hould onider thee arefully along with poibly other iue a they our to you. In other word avoid the pitfall of jut going through the motion in a mehanial fahion. The pratial i iued to help you develop your undertanding of the material, the mark are a by-produt (of oure an important one) and far from being it only rationale. Note Good Sholarly Pratie: Pleae remember the Univerity requirement a regard all aeed work for redit. Detail and advoe about thi an be found at: and link from there. Note that, in partiular, you are required to take reaonable meaure to protet your aeed work from unauthoried ae. For example, if you put any uh work on a publi repoitory then you mut et ae permiion appropriately (generally permitting ae only to yourelf, or your group in the ae of group pratial). Following intrution: The variou part of thi pratial plae ertain requirement with a penalty if thee are not followed. No negotiation of any kind will be entered into where the requirement are not followed. The point of the requirement i to enure that in doing the variou part you pratie and demontrate kill relating to the appropriate area of the oure. What you ubmit mut be onidered work; imagine that your work wa being given to you and other a a ample anwer. If you, or other, would find it unlear and unhelpful then your work need further reviion. Regrettably the variou requirement and penaltie an appear omewhat enoriou and limiting. Thi i not the intention, indeed muh of what i tated an be een in the muh more poitive light of reaurane that the variou tak have quite imple anwer. Pleae be aured that plenty of variation i poible even when following the requirement, i.e., there in t neearily a unique way to do and preent thing learly, oniely and orretly. 2. The problem We will follow normal pratie and peify point in the plane by mean of Carteian oordinate, i.e., a a pair of number (x, y). We are given n 2 ditint point (x 1,y 1 ),...,(x n,y n ). Reall that the ditane between two point (x i,y i ) and (x j,y j ) i given by q ij = (x i x j ) 2 +(y i y j ) 2. More formally thi i the Eulidean ditane but a we will ue only thi we will jut ay ditane. The problem i to find the leat ij over all the given point (onidering only ditint pair, i.e., i 6= j). So for example if we are given the et of point {(0, 0), ( 2, 1), (3, 4), (1, 1)} it i lear that (0, 0) and (1, 1) are the loet pair with a ditane of p 2. If our input inluded the point ( 3, 2) then thi together with ( 2, 1) would alo be a loet pair. Note that when omparing ditane we an avoid quare root alulation by working with the quared ditane 1, i.e., we ue 2 ij =(x i x j ) 2 +(y i y j ) 2. Thi i not only more effiient but it alo mean that if our input are integer then we avoid floating point alulation altogether. It would be a imple matter to extend our arithmeti to fration repreented exatly (a a pair oniting of the numerator and denominator). Thi i ueful beaue there i a limit to the reliability of floating point wherea alulation with fration an be kept exat. We will not addre thi further but it i an important iue to bear in mind for writing reliable oftware. 1 Here we are uing the fat that ditane are never negative. 1 2

2 Input: A et of n point (x 1,y 1 ),...,(x n,y n ) with n 2. Output: The quared ditane of a loet pair of point. Naive-Cloet-Pair 1. d (x 1 x 2 ) 2 +(y 1 y 2 ) 2 2. for i 1 to n 1 do 3. for j i +1to n do 4. t (x i x j ) 2 +(y i y j ) 2 5. if t<dthen d t 6. return d Figure 1: Naïve algorithm for finding the quared ditane of a loet pair of point. 2.1 Naïve algorithm There i an obviou algorithm for our problem whih i given in Figure 1. Thi imply ompute the ditane for eah pair of point and keep the mallet ditane o far. The only ophitiation i that if the pair of point A, B ha been onidered then there i no need to onider the pair B,A. By the end we are guaranteed to have the leat ditane over all pair. The peudoode doe not hek that we are given at leat 2 point. Naturally any atual implementation hould do thi and take appropriate ation, if you want to ee how it an be done in pratie hek the naivecloetpair oure ode upplied a part of the pratial (intrution are given in 3.1). Exerie 1. Let T NCP (n) denote the wort ae runtime of the algorithm Naive-Cloet-Pair on input of n point. We aume that arithmeti alulation and omparion take ontant time; thi will be done throughout the doument. 1. Prove that T NCP (n) = O(n 2 ). For thi part you mut ue aymptoti notation throughout together with any tandard propertie (whih you may aume without omment); in partiular you may not ue named ontant a part of the analyi. Note alo that for full mark you mut jutify eah expreion with referene to the algorithm. [15%] 2. I it true to ay that runtime of the algorithm i the ame for all input of n point? (You need only tate the anwer to the previou quetion, no jutifiation i required.) Prove that T NCP (n) = (n 2 ). [10%] 3. I it true to ay that T NCP (n) = (n 2 )? Jutify your anwer very briefly. [5%] Note: Your anwer here and for the next exerie mut be written out in full, i.e., you mut tate your reaoning learly with appropriate onneting word. Remember the logan lear, onie and orret. If an anwer i o badly expreed that it annot be undertood within a few minute it will be deemed to be inorret; it i important that you allow enough time to produe fluently written anwer. A mere equene of expreion without any explanation will be awarded 0; the exerie tet your ability to expre the imple argument involved in an appropriate way, thi i a ignifiant part of the exerie 2.2 The Shamo algorithm We diu an algorithm due to M.I. Shamo 2 that run in time O(n lg n) whih i a very big improvement on the runtime of the naïve algorithm (ee the graph of n, n lg n, n 2 and n 3 in Leture Note 2). We will diu the algorithm a originally preented in term of the atual ditane between point but remember that in your implementation you will work with the quare of the ditane. Before looking at the algorithm itelf, it i worth noting that many algorithm in omputational geometry are quite intuitive beaue they appeal to our well developed viual ytem. However thi very feature i alo the aue of many inorret propoal beaue peial ae are eaily overlooked. In the ae of our problem we would normally think of the n point are being fairly randomly ditributed. In general thi i true but there i nothing to prelude them all lying on a line (horizontal or vertial) or in any other pattern. Any algorithm mut work for all poibilitie. Shamo algorithm ue a divide and onquer approah. It i baed on the following intuitive idea: we find a vertial dividing line o that there are a many point to the left of a to the right (a equal a poible if the number of point i odd). The loet point will either lie to the left or to the right or onit of a point on the left and one on the right of the dividing line (the ro point ae ). We reure on the left and the right whih give u the loet ditane for thoe two dijoint et (the bae ae an be taken to be any number of point but we ue 3). We have to deal with the ro point ae arefully: our analyi will how that we need only onider point within a narrow vertial trip entred around the vertial dividing line. Thi i not quite enough, in prinipal the trip ould ontain all point at leat in ome ae, but we will ee that armed with the information gathered from the reurion we an find the loet point in the trip in linear time. We ue P to denote the et of input point. The main tep of the algorithm are: 1. If n apple 3 find the loet point by the naïve method and top. 2. Find a vertial line V uh that it divide the input et into two dijoint ubet P L and P R of ize a equal a poible (i.e., of ize dn/2e and bn/2 repetively). Point to the left or on the line belong to P L and point to the right or on the line belong to P R. (Point on the line an belong to one or other of the et, more detail later.) No point belong to both ine the et are dijoint. See Figure Reurively find the ditane L of a loet pair of point in P L and the ditane R of a loet pair in P R. 4. Let =min( L, R). The ditane of a pair of loet point in the input et P i either that of the point found in the reurive tep (i.e., ) or onit of the ditane between a point in P L and a point in P R. (a) The only andidate point one from P L and one from P R mut be in a vertial trip oniting of a line at ditane to the left of the line V and a line at ditane to the right of V. (b) Let Y V be an array of the point within the trip orted by non-dereaing y oordinate (i.e., if i apple j then Y V [i].y apple Y V [j].y). 2 The algorithm i diued in the book: F.P. Preparata and M.I. Shamo Computational Geometry: An Introdution, Springer Verlag, The algorithm i alo diued in Shamo Thei, 1978, p available for free online at Another relevant paper i 3 4

3 Figure 2: An example input and dividing line (irle how point in P L and di how point in P R ). () Starting with the firt point in Y V and tepping through all exept the lat, hek the ditane of thi point with the next 5 point (or any that are left if there are not a many a 5). If a pair i found with ditane tritly le than then aign thi ditane to. 5. Return. A with many divide and onquer algorithm the idea i quite traightforward with the trikiet part being how to ue the olution of the two ub-problem to obtain a olution for the overall problem in an effiient way (thi i tep 4 of the deription above). We will diu the detail in the next ubetion but take time to undertand the overall idea firt, jut treat tep 4 a aying: find the loet ditane LR between pair of point one from P L and one from P R then return min(, LR) and aume we an do thi effiiently. Thi approah i pretty muh what i done in trying to deign uh an algorithm; formulate the overall trategy and addre detail one that i well etablihed (in reality it might be neeary to modify the overall trategy if ome detail jut annot be filled in uitably). At thi tage you are enouraged to imulate the algorithm on ome example input of your own 3 (Figure 2 how the firt tage on a mall ample input). For thi imulation you ould ue graph paper and plot the point aurately for eah part of the algorithm, thi i likely to be more meaningful to you than pair of oordinate! The deription of the algorithm ha been tated in term of atual ditane for impliity of phraing; reall that in an implementation we ue the quare of the ditane. 2.3 Filling in the detail of the Shamo algorithm Thi oneptual deription give the overall plan but we have ome iue to addre: 1. How do we find a dividing line and aign point to P L, P R effiiently? 2. How do we find the array Y V effiiently? 3. We mut jutify the laim that in looking at point within the trip around V (i.e., point from the array Y V ) we need only ompute the ditane of the urrent point with at mot the next 5 point in Y V. 3 For oniteny with the full algorithm do the following when aigning point on the dividing line. Aign a many a are needed to PL with lowet y-oordinate and the ret to PR, thi i what ha been done in Figure 2. 5 The firt iue i eay to addre: ort the input P by non-dereaing value of x oordinate and hold the reult in an array X. However, for reaon that will beome lear later, we ue a lightly more ophitiated order when orting for X. Define the order on point a follow: (x 1,y 1 ) (x 2,y 2 ) if and only if x 1 <x 2 or x 1 = x 2 and y 1 apple y 2. (1) So we ompare x oordinate and break tie by looking at the y oordinate. Note that thi i a total order on point, i.e., either (x 1,y 1 ) (x 2,y 2 ) or (x 2,y 2 ) (x 1,y 1 ) for all pair of point [why?]. The et P L at the top level of reurion an then be taken to be the entrie X[0..dn/2e 1] and the et P R i X[dn/2e..n 1]. Thu the top level reurive all ue parameter 0 and dn/2e 1 to delimit the array of value for P L while dn/2e and n 1 are the parameter for P R. In general we are at ome reurive level where the orted array of input value for thi level i X[r..] (whih we will refer to a an array portion 4 ). If r apple 2 (i.e., there are no more than 3 value, the 2 on the right hand ide i orret [why?]) we jut ue brute fore. Otherwie we make a reurive all with the array for P L at thi level being X[r..d(r + + 1)/2e 1] and the array for P R at thi level being X[d(r + + 1)/2e..]. In other word we ort only one at the top level and then the data at all level are identified by upper and lower indie into the orted array X (we never hange X itelf apart from the initial orting). You hould think arefully about why we annot afford to ort at eah level of reurion. Note that if the orted array of input value for a level of reurion i X[r..] then the vertial dividing line i given by the x-oordinate of the point X[d(r + + 1)/2e 1]. We will ue X L and X R to denote the two halve of the relevant etion of the array X at a given level of reurion (thee ontain exatly the point in P L and P R repetively at that level of reurion 5 ). The eond iue i a little ubtler, uppoe firt that we have an array Y of the point P being onidered at the level of reurion, whih i orted by y oordinate. Then finding the array Y V i imple. Suppoe we are at a level of reurion where the input point are X[r..]. Let v be the x- oordinate of the point X[d(r + + 1)/2e 1]; thu the dividing line at thi level i given by x = v. Thi mean that the hortet ditane of a point (a, b) from thi line i v a but a we are working with quared ditane we ue the quantity (v a) 2. We an now travere Y ; for eah point onidered we firt tet if (v a) 2 apple 2 and only put thi into Y V if the tet i paed. Sine we know the point being onidered at any level of reurion (a a portion of the array X) we ould form Y by opying the point into a new array and orting them by their y-oordinate. Unfortunately the orting would ot too muh overall. We have already een that a far a onidering point orted by x-oordinate i onerned we jut ort the input point in the global array X before initiating the reurive all and then jut fou on the relevant portion of the array X. However we annot do thi quite o imply with regard to forming the array Y, let ee thi with an example. Suppoe our et of point at a level of reurion i P = { ( 2, 5), ( 1, 2), (1, 6), (1, 3), (1, 10), (5, 20), (10, 0), (12, 13) }. The point P, P L and P R are thu given by the following portion of the array X: ( 2, 5) ( 1, 2) (1, 10) (1, 3) (1, 6) (5, 20) (10, 0) (12, 13) P L P R 4 Note that an array portion i jut an array but with the firt element tarting at an index that might be different from the tandard one (0 in the ae of Java). 5 The differene i that oneptually PL, PR are et while XL, XR are array oniting of the ame point orted aording to the order. Of oure in an implementation we might ue an array baed data truture to hold the member of the et and have them orted but thi i impoing extra truture that annot be aumed if all we ay i that we have a et. Indeed in our enhaned repreentation we might hold the et/array together with indie r, that identify the portion of it of interet a one ompound data truture (reord or la aording to implementation language). 6

4 Input: A et P of point (plit into P L and P R ) and an array Y of the ame input point orted in inreaing order by y-oordinate. Output: The array Y L, Y R a deribed in the text. plity 1. new array Y L, Y R of length P L.length and P R.length repetively. 2. l 0 3. r 0 4. for i 0 to Y.length 1 do 5. if Y [i] 2 P L then 6. Y L [l] Y [i] 7. l l ele 9. Y R [r] Y [i] 10. r r +1 Figure 3: Splitting the et Y. So the next level of reurion would be alled with P L and P R repetively. Now onider the array Y of the point ontained in P, whih i orted by y oordinate only; the array Y i paed by the all that initiated the urrent level of reurion. Thi i: (5, 20) (1, 10) (1, 3) (10, 0) ( 1, 2) ( 2, 5) (1, 6) (12, 13) In the two reurive all we want to pa array Y L, Y R orted by y-oordinate and oniting of thoe point of Y that belong to P L and P R repetively. Here i the array Y again but below eah entry we have indiated to whih of the two array Y L or Y R it hould belong (after their reation) (5, 20) (1, 10) (1, 3) (10, 0) ( 1, 2) ( 2, 5) (1, 6) (12, 13) Y R Y L Y L Y R Y L Y L Y R Y R So the differene i now lear. In order to obtain the array for P L, P R orted by x-oordinate (array portion X L, X R ) we jut divide the urrent portion of the array X into two part that are a equal a poible. However thi will not work a regard forming the array Y L and Y R. The reaon i imple: we are uing a vertial line to ubdivide and the y-oordinate of point in P L, P R an be arbitrarily high or low in either et. If we ued a horizontal line then the ituation jut wap over. To um up: it i a imple matter to reate the array portion X L, X R given the etion of the array X at ome level of the reurion. In order to reate the array Y L, Y R we need to do a little work uing the algorithm hown in Figure 3. There are two point to diu in onnetion with the algorithm of Figure 3. Firt, note that the array Y i given to u from the previou level of the reurive all o it i either the array Y R or Y L of the previou level aording to the branh of the reurion. The ritial point i that it i provided in orted order (we enure thi i o at the very tart by orting an initial array Y oniting of all the input point and paing it to the method that implement the reurion). Sine we examine it point in order and put them in the newly ontruted array in order it follow that thee array are alo orted. To um up: we need only ort the tarting array Y before initiating the reurion and thereafter all our array formed by plity tay orted. 7 The eond, more ubtle, point onern the memberhip tet Y [i] 2 P L of line 5. Sine P L i the orted array portion X L we ould ue binary earh, but even though thi i very effiient we an do muh better 6. Let n denote the ize of P (at the level of the all), thi i alo the ize of Y of oure. In order to meet our performane riterion we mut enure that plity run in time O(n). Well the loop on line 4 i exeuted (n) time o it body ha to run in ontant time. Everything in the loop learly meet thi requirement exept for the memberhip tet. How do we enure thi tet alo run in ontant time? Let (x L,y L ) be the lat point of the array portion X L and let (x, y) be the query point (i.e., the point in Y [i] of the memberhip tet). Now if x<x L then neearily (x, y) our in X L hene in P L. Similarly if x>x L then (x, y) i not in P L, i.e., it i in P R. But what happen if x = x L? Reall that we orted X firt by x oordinate and, if neeary, then by y oordinate. It now follow that the ae when x = x L an be reolved by omparing the y oordinate: if y apple y L then (x, y) our in P L otherwie in P R. In the example given above we have three point with equal x oordinate: (1, 10), (1, 3) and (1, 6) and (x L,y L )=(1, 3). Go through the proedure deribed in thi paragraph to ee how the plit of Y into Y L and Y R work. It follow that the memberhip tet an alo be arried out in ontant time (at mot two omparion). Finally, note that the algorithm plity an now be modified to take a parameter the et Y and the deiding point (x L,y L ), there i no need to pa P a a parameter. The array Y L, Y R an alo be reated before the all and paed a parameter. For the final iue in our lit of three on page 5, it i lear that a point in P L and a point in P R annot be of ditane le than unle they are both in the trip of width 2 entred around the dividing line. Furthermore if there are two uh point then we will find them by omparing point with lower y oordinate to one with higher (or equal) y oordinate. What remain i to prove that given a firt point (x 1,y 1 ) then we need only onider at mot the next 5 point, i.e., any other would be too far away. If we have a point (x 2,y 2 ) with y 2 >y 1 + then it i learly too far away (the quared ditane i tritly greater than (y 1 + y 1 ) 2 = 2 ). Thu the only poible andidate are within the box of width 2 and height that ha the point (x 1,y 1 ) on it lower edge and i entred around the dividing line. Thi box i made up of 8 quare of ize /2 /2. Now the differene between the x oordinate of any two point within uh a quare i at mot /2 and likewie for the y oordinate. Thu the quared ditane i at mot ( /2) 2 +( /2) 2 = 2 /2 < 2. Sine we already know that point from P L are at ditane at leat (and likewie for point in P R ) it follow that eah box ha at mot one point to be onidered, unle a box ha a point in P L and a point in P R. Thi exeptional ae an only happen if the two point are on the dividing line. So uppoe a quare S L hare a ommon edge with a quare S R on the dividing line. Moreover on thi ommon edge there i a point (x L,y L ) from P L and a point (x R,y R ) from P R. The preeding diuion how that S L annot ontain any other point from P L (we inlude the edge of the quare here) and imilarly for S R. Aigning (x L,y L ) to S L and (x R,y R ) to S R, we ee that whatever i the ae eah of the boxe ha at mot one point to be onidered, however there an only be at mot two point on the dividing line. Thi give u a maximum of 6 point 7. Sine (x 1,y 1 ), the point with whih we tart, i one of the point within the boxe we are left with at mot 5 more to ompare with (x 1,y 1 ). An alternative way to ee the previou laim i the following. If we pik any point P L in the left hand box (width and height ) and draw a dik with entre P L and radiu then the box annot ontain any other point that i in the interior of the di (it would have ditane tritly le than from P L ). Now if we have any three point within thi box whih are at ditane at leat from eah other then 6 A quetion worth aking yourelf i: would we ahieve the required aymptoti runtime if we ued binary earh? 7 You hould think arefully about the fat that we do need to enure that point onidered are within ditane of the vertial line, i.e., we annot omit the tet (v a) 2 apple 2. 8

5 their three di will over the entire left hand box. The ame argument applie to the right hand box, giving u a total of 6 point at mot. If you have time you ould try to prove the laim about the three di, it i intuitively plauible but intuition an be faulty. Exerie We want the orting of the two array X, Y (arried out before intitiating reurion) to be done in O(n lg n) time in the wort ae. Sugget one tandard algorithm that ould be ued. [5%] 2. Let T (n) be the runtime of the reurive part of the algorithm. Prove that ( O(1), if n apple 3; T (n) = T (dn/2e)+t(bn/2)+o(n), if n>3. You may aume without further proof that the runtime of plity i O(n). Dedue that T (n) =O(n lg n) by uing an appropriate reult from the note. You hould name the reult but need not tate it in full, however you mut how how you ued it to dedue the O( ) expreion. [15%] 3. Ue an appropriate property of the big-o notation to dedue that the overall running time of the algorithm i O(n lg n). [5%] You hould think about what would go wrong if the bae ae of the algorithm teted n apple 2 intead of n apple 3 and how you ould fix thing while till keeping n apple 2 a the bae ae. However do not inlude any diuion of thi in your anwer. 3. Software tak We firt give a guide to ome of the upplied lae and method (ome more are mentioned later). If, after tudying the oftware very arefully, you have any querie regarding it then ontat the Teahing Aitant for thi thread uing NB to whih you hould reeive an invitation via your univerity around the time when the ourework i releaed. 3.1 Supplied oftware The file that you will need for thi ourework an be found on-line at the ourework webpage: Thi page ontain a file alled inf2bw1.tar whih you hould download. The file i tarred o you need to extrat it, e.g. by tar -xf inf2bw1.tar, thi will reate a ubdiretory r of your urrent one that ontain the oftware. The java pakage for thi ourework i pakage loetpair. The only la that hould be hanged i the nearly empty la you will find in the file StudentCode.java whih i where you will implement your part of the projet. In fat the amount of ode you need to write i fairly modet. Prahya Boonkwan and Naum Moger have kindly written a README file giving you ome tip about what to do for uh thing a writing tet ript. Jut a importantly there are warning about what not to do with the ode. Make ure you follow their advie. The file i inluded in the pakage that you download. We repreent a point in the plane by an objet of the la Point. Thi doe the obviou thing; it hold the x and y oordinate a number o that if P i an objet of type Point then P.x and P.y 9 give the oordinate. In thi implementation we init that the oordinate are integer. Thi hoie make ene beaue under it we never need to ue floating point artihmeti (remember that we work with the quared ditane) and o we an tet two number for equality with omplete reliability. The et of input point i repreented by an objet of the la PointSet. Note that a thi i a et there an be no repetition of a point and you annot aume any ordering on the element. The following method are upplied: publi tati PointSet getpoint(string f). Thi open a file alled f and read point from it. Point are preented in the format x 1 y 1 x 2 y 2. x n y n Eah x and y value i an integer. Eah point i on a line by itelf and the end of file indiate the end of input. If any unexpeted harater are met then an exeption UnreadablePoint- SetExeption i thrown. publi Point nextpoint(pointset P). Thi i ued to iterate over the point in P. That i, the firt all return one point and eah ubequent all return a diferent point until all are returned. One all point have been returned the next all return null. Subequent all to the method will iterate over the et afreh. Note that there i no guarantee that different iteration will return the point in the ame order. The algorithm Naive-Cloet-Pair i implemented by the method publi tati Point naivecloetpair(pointset P). If there are le than two point in P then an exeption TrivialCloetPairExeption i thrown. The next method i ued to obtain tet ample of point. publi tati PointSet generatepoint(int n). Thi return a et of n point, whoe oordinate are integer. If n apple 0 then the empty et i returned. The point are generated at random but it i enured that they are indeed eparate. You are alo upplied with an effiient orting method, i.e., one that work in O(n lg n) time in the wort ae. publi Point[] ort(har ). Thi return the point in the point et in an array orted in non-dereaing order by oordinate a indiated by the parameter. Thi parameter take either the value x or the value y, an exeption UnknownSortOptionExeption i raied otherwie. If the parameter i x then the array i orted in order a defined in (1) on page 6 (firt by x, and then break tie by y). 10

6 3.2 Tak Note: You are aked to write ome ode that i in fat very imple thank to the upplied method. Any ode that i inorret will be awarded 0. Corret ode will be marked for tyle a well. Thi mean that it hould have ueful omment and helpful indentation. Note that exeive or pointle omment (e.g., tating the obviou uh a now we add the two variable together ) or exeive indentation are almot a bad a their omplete abene and will inur a penalty. The method generatepoint will upply mot et of point with whih you will be working. Of oure you an alo reate et of point for your own teting if you like. Your programing tak are a follow. 1. In the StudentCode la, provide implementation of the method publi tati int loetpair(pointset P). [10%] Thi doe the preparatory work for the reurive part of the algorithm and all the method loetpairaux for the reurive part. publi tati int loetpairaux(point [] X, Point [] Y). [15%] Thi arrie out the reurive part of the algorithm; that i, the bulk of the work. publi tati void plity(point tetpoint, Point [] Y, Point [] YL, Point [] YR) [5%] Thi implement the algorithm of Figure 3. So the upplied Point array Y i plit and the two reulting Point array are returned in YL, YR repetively. The parameter tetpoint i the deiding point (x L,y L ). Keep your ode traightforward, follow the algorithm a outlined in 2.2. Note that your ode mut work on any number of point. If le than two point are upplied then the exeption TrivialCloetPairExeption mut be raied. Tet your implementation by uing the following method in the CloetPair la: publi tati void loetpairchek(int t, int n) Generate t et of point of ize n and obtain the quared ditane of a laimed loet pair uing your implementation of the method loetpair for eah et. If all reult are orret then a meage reporting thi i returned, ele failure i reported. No further information i given. Note that t mut be tritly poitive (an exeption Invalid- NumberOfTetExeption i raied otherwie). The point et generated i aved in the file point.txt for debugging purpoe. Naturally the tet proedure doe not guarantee orretne. All we an ay i that if the ode fail the tet then there i omething wrong. If it pae all tet then i i probably orret. 2. The aim of thi part i to ompare the runtime for naivecloetpair with thoe for loetpair. We would expet that a the number of point get larger the differene would be more ignifiant. Note however that there ould be mall et of point for whih naivecloetpair run fater (you hould think about why thi an be the ae). The upplied CloetPairToolkit la method publi tati void getruntime(int p, int t, String f) doe the following: 11 (a) Generate p et of point for variou ize tarting from 10 (the et are not random o that experiment are repeatable). (b) Find a loet pair of point uing naivecloetpair and loetpair, and take the pu time for thee. () Reord the wort ae time for eah algorithm implementation taken over the p et (note that it i pefetly poible that the wort ae runtime for the two algorithm implementation our for different et). (d) Repeat the above with et of ize 20, 30,...,10t. (e) Output the reult for eah iteration on the file named f in the format input-et-ize naivecloetpair-wort-ae-runtime CloetPair-wort-ae-runtime For f you an give a path name but the implet thing i to run ode from your working diretory and ue jut the name for f; the file will be plaed in your working diretory. (Note that the data above are given on a ingle line of the file, the text i too long to fit on one line of thi doument.) Carry out experiment with inreaing value of t until you find a lear differene between the two algorithm. In order to avoid exeive waiting hooe the fairly moderate value for p. Naturally it make ene to ontinue the experiment a little beyond the point of the firt lear differene (indeed due to variou fator there might be a temporary turn around, although thi i unlikely for thi experiment). Finally, run the experiment with p=10, t=250 and keep the reult in a file with the name loetpairtime. Study the output to ee what happen in term of one algorithm outperforming the other. [10%] Ue thi file to find the roover point at whih loetpair i onitently fater than naivecloetpair. Thi i a rough and ready way of obtaining an etimate for the ettling in period before the overhead outweigh the benefit. Thi approah i open to ritiim in general (think about why thi i the ae) but i not mileading in thi ae. From now on we will fou on loetpair. 3. We know that the wort ae runtime T CP (n) of loetpair atifie T CP (n) apple n lg n for ome ontant. Of oure aymptoti notation allow for a ettling in period, i.e., from ome value n 0 of n onward. In fat thi period i not really neeary at leat from n =2 onward beaue we an jut take a larger ontant if needed (with the obviou downide that thi give a peimiti performane guarantee for all large enough value of n). It hould be fairly lear from the algorithm that the ettling in period i not long; eentially we jut need n to be big enough o that n lg n dominate the ot of initializing variable and etting up data truture. The upplied CloetPair method publi tati double[] getratio(int p, int t, int threhold, String f) i imilar to getruntime exept that for eah experiment it only ue loetpair. One it ha found the wort ae runtime for an input of ize n it reord the value of that runtime divided by n lg n. The reult are output to the file f in the format 12

7 integer-ize ratio Part A: Analyi of algorithm (both of them in hardopy only). one per line a before. At the end of thi output it alo append three extra line: Sorted ratio are: r 1,r 2,... Trunated maximum ratio i: max-ratio Trunated average ratio i: ave-ratio Ratio index thehold i: threhold Thu the final three line give u the maximum and the average of all ratio exept thoe with the index greater than the threhold index in the orted ratio array. The threhold index i peified in the threhold parameter. The ae for taking the average i that it mooth out to ome extent the effet of any garbage olletion. In a more detailed tudy we need to be more ophitiated but here we will keep thing imple and rely on the plot (ee below) to give u an idea of how ueful the average i. You an alo ue the orted ratio to get an idea of the effet of garbage olletion (we would expet ratio affeted by thi to be ignifiantly bigger than the real one). The funtion return the maximum and average ratio o they an be paed eaily to CloetPairToolkit.plotRuntime(). Ue the following value for the parameter: p et to 10, t et to 250. Finally you will plot the data from the file loetpairtime of the previou part and the wort ae runtime a determined by the theoretial analyi together with the two etimate for the ontant found by the preeding experiment (the maximum and average). Ue the upplied CloetPair method publi tati void plotruntime(float, float a, file f) to produe your plot. For ue the maximum ontant found above, for a ue the average and for the file f pa the data in the file loetpairtime from the preeding part. Thi will bring up a plot whih you hould ave in a file alled plot. To be preie thi plot will how graph of the reorded time for naivecloetpair, loetpair a well a the urve n lg n and an lg n. [5%] Compiling and Running From the ommand line, type d path-to-r-folder. Ue java loetpair/*.java to ompile. Ue the ommand java loetpair/claname to run the program (where Cla- Name i the.java file where your main() target i). A tated above your ode mut be well laid out howing it logial truture. Jut like good proe or good mathematial writing it mut be et out to aid undertanding. Thi way you and other an maintain it a well a pot any error more eaily. 1. Your anwer to Exerie 1 of Your anwer to Exerie 2 of 2.2. Part B: Software, for thi the ubmiion are eletroni only. 1. Your ode in the la file StudentCla.java. 2. loetpairtime. 3. plot.jpg. Note: Your anwer to the two exerie of Part 1 are bet handwritten (unle you have a medial ondition that prevent thi) and neatly preented following the guideline of Leture Note 2 (and the note in general). Your hardopy ubmiion hould be made at the appropriate time to: ITO, Room FH-1.B15, Forret Hill, 5 Forret Hill, Edinburgh, EH1 2QL. Important: Put your matriulation number very learly at the top of your ubmiion. You do not have to put your name; mark will be returned to the ITO by matriulation number (thi i how the ubmit ommand (ee below) organie thing. If you need to ubmit more than one piee of paper for a part pleae taple the heet together and put your matriulation number on the top of eah heet (in ae they get eparated). Do not ue folder to hold everal heet a thi hold up the marking proe ignifiantly. For eletroni ubmiion follow thee intrution. Firt put your ubmiion file (and nothing ele) into one diretory alled inf2b-w1. Submit thi diretory uing the following ommand (when logged into DICE): ubmit inf2b 1 inf2b-w1 Warning: The rule for ourework i We mark what i ubmitted. Before you ubmit your ourework, make ure that you are ubmitting the orret file. In ome previou year tudent ubmitted the wrong file and lot mark that way. Kyriako Kalorkoti Software by Prahya Boonkwan and Naum Moger Tueday 14 th February, Submitting the Courework You mut ubmit the two part of your work by the deadline given at the head of thi doument. If you omplete the ourework in full, you hould be ubmitting: 13 14

Lecture 14: Minimum Spanning Tree I

Lecture 14: Minimum Spanning Tree I COMPSCI 0: Deign and Analyi of Algorithm October 4, 07 Lecture 4: Minimum Spanning Tree I Lecturer: Rong Ge Scribe: Fred Zhang Overview Thi lecture we finih our dicuion of the hortet path problem and introduce

More information

KINEMATIC ANALYSIS OF VARIOUS ROBOT CONFIGURATIONS

KINEMATIC ANALYSIS OF VARIOUS ROBOT CONFIGURATIONS International Reearh Journal of Engineering and Tehnology (IRJET) e-in: 39-6 Volume: 4 Iue: May -7 www.irjet.net p-in: 39-7 KINEMATI ANALYI OF VARIOU ROBOT ONFIGURATION Game R. U., Davkhare A. A., Pakhale..

More information

1 The secretary problem

1 The secretary problem Thi i new material: if you ee error, pleae email jtyu at tanford dot edu 1 The ecretary problem We will tart by analyzing the expected runtime of an algorithm, a you will be expected to do on your homework.

More information

MAT 155: Describing, Exploring, and Comparing Data Page 1 of NotesCh2-3.doc

MAT 155: Describing, Exploring, and Comparing Data Page 1 of NotesCh2-3.doc MAT 155: Decribing, Exploring, and Comparing Data Page 1 of 8 001-oteCh-3.doc ote for Chapter Summarizing and Graphing Data Chapter 3 Decribing, Exploring, and Comparing Data Frequency Ditribution, Graphic

More information

A SIMPLE IMPERATIVE LANGUAGE THE STORE FUNCTION NON-TERMINATING COMMANDS

A SIMPLE IMPERATIVE LANGUAGE THE STORE FUNCTION NON-TERMINATING COMMANDS A SIMPLE IMPERATIVE LANGUAGE Eventually we will preent the emantic of a full-blown language, with declaration, type and looping. However, there are many complication, o we will build up lowly. Our firt

More information

Inverse Kinematics 1 1/29/2018

Inverse Kinematics 1 1/29/2018 Invere Kinemati 1 Invere Kinemati 2 given the poe of the end effetor, find the joint variable that produe the end effetor poe for a -joint robot, given find 1 o R T 3 2 1,,,,, q q q q q q RPP + Spherial

More information

Macrohomogenous Li-Ion-Battery Modeling - Strengths and Limitations

Macrohomogenous Li-Ion-Battery Modeling - Strengths and Limitations Marohomogenou Li-Ion-Battery Modeling - Strength and Limitation Marku Lindner Chritian Wieer Adam Opel AG Sope Purpoe of the reearh: undertand and quantify impat of implifiation in marohomogeneou model

More information

Combined Radix-10 and Radix-16 Division Unit

Combined Radix-10 and Radix-16 Division Unit Combined adix- and adix-6 Diviion Unit Tomá ang and Alberto Nannarelli Dept. of Eletrial Engineering and Computer Siene, Univerity of California, Irvine, USA Dept. of Informati & Math. Modelling, Tehnial

More information

Shortest Paths in Directed Graphs

Shortest Paths in Directed Graphs Shortet Path in Direted Graph Jonathan Turner January, 0 Thi note i adapted from Data Struture and Network Algorithm y Tarjan. Let G = (V, E) e a direted graph and let length e a real-valued funtion on

More information

Incorporating Speculative Execution into Scheduling of Control-flow Intensive Behavioral Descriptions

Incorporating Speculative Execution into Scheduling of Control-flow Intensive Behavioral Descriptions Inorporating Speulative Exeution into Sheduling of Control-flow Intenive Behavioral Deription Ganeh Lakhminarayana, Anand Raghunathan, and Niraj K. Jha Dept. of Eletrial Engineering C&C Reearh Laboratorie

More information

Shortest Paths Problem. CS 362, Lecture 20. Today s Outline. Negative Weights

Shortest Paths Problem. CS 362, Lecture 20. Today s Outline. Negative Weights Shortet Path Problem CS 6, Lecture Jared Saia Univerity of New Mexico Another intereting problem for graph i that of finding hortet path Aume we are given a weighted directed graph G = (V, E) with two

More information

Today s Outline. CS 561, Lecture 23. Negative Weights. Shortest Paths Problem. The presence of a negative cycle might mean that there is

Today s Outline. CS 561, Lecture 23. Negative Weights. Shortest Paths Problem. The presence of a negative cycle might mean that there is Today Outline CS 56, Lecture Jared Saia Univerity of New Mexico The path that can be trodden i not the enduring and unchanging Path. The name that can be named i not the enduring and unchanging Name. -

More information

Topics. Lecture 37: Global Optimization. Issues. A Simple Example: Copy Propagation X := 3 B > 0 Y := 0 X := 4 Y := Z + W A := 2 * 3X

Topics. Lecture 37: Global Optimization. Issues. A Simple Example: Copy Propagation X := 3 B > 0 Y := 0 X := 4 Y := Z + W A := 2 * 3X Lecture 37: Global Optimization [Adapted from note by R. Bodik and G. Necula] Topic Global optimization refer to program optimization that encompa multiple baic block in a function. (I have ued the term

More information

Pruning Game Tree by Rollouts

Pruning Game Tree by Rollouts Pruning Game Tree by Rollout Bojun Huang Mirooft Reearh bojhuang@mirooft.om Abtrat In thi paper we how that the α-β algorithm and it ueor MT-SSS*, a two lai minimax earh algorithm, an be implemented a

More information

Routing Definition 4.1

Routing Definition 4.1 4 Routing So far, we have only looked at network without dealing with the iue of how to end information in them from one node to another The problem of ending information in a network i known a routing

More information

Generic Traverse. CS 362, Lecture 19. DFS and BFS. Today s Outline

Generic Traverse. CS 362, Lecture 19. DFS and BFS. Today s Outline Generic Travere CS 62, Lecture 9 Jared Saia Univerity of New Mexico Travere(){ put (nil,) in bag; while (the bag i not empty){ take ome edge (p,v) from the bag if (v i unmarked) mark v; parent(v) = p;

More information

Computer Arithmetic Homework Solutions. 1 An adder for graphics. 2 Partitioned adder. 3 HDL implementation of a partitioned adder

Computer Arithmetic Homework Solutions. 1 An adder for graphics. 2 Partitioned adder. 3 HDL implementation of a partitioned adder Computer Arithmetic Homework 3 2016 2017 Solution 1 An adder for graphic In a normal ripple carry addition of two poitive number, the carry i the ignal for a reult exceeding the maximum. We ue thi ignal

More information

Lecture Outline. Global flow analysis. Global Optimization. Global constant propagation. Liveness analysis. Local Optimization. Global Optimization

Lecture Outline. Global flow analysis. Global Optimization. Global constant propagation. Liveness analysis. Local Optimization. Global Optimization Lecture Outline Global flow analyi Global Optimization Global contant propagation Livene analyi Adapted from Lecture by Prof. Alex Aiken and George Necula (UCB) CS781(Praad) L27OP 1 CS781(Praad) L27OP

More information

Description of Traffic in ATM Networks by the First Erlang Formula

Description of Traffic in ATM Networks by the First Erlang Formula 5th International Conferene on Information Tehnology and Appliation (ICITA 8) Deription of Traffi in ATM Network by the Firt Erlang Formula Erik Chromý, Matej Kavaký and Ivan Baroňák Abtrat In the paper

More information

Parametric Micro-level Performance Models for Parallel Computing

Parametric Micro-level Performance Models for Parallel Computing Computer Siene Tehnial Report Computer Siene 12-5-1994 Parametri Miro-level Performane Model for Parallel Computing Youngtae Kim Iowa State Univerity Mark Fienup Iowa State Univerity Jeffrey S. Clary Iowa

More information

CS201: Data Structures and Algorithms. Assignment 2. Version 1d

CS201: Data Structures and Algorithms. Assignment 2. Version 1d CS201: Data Structure and Algorithm Aignment 2 Introduction Verion 1d You will compare the performance of green binary earch tree veru red-black tree by reading in a corpu of text, toring the word and

More information

A note on degenerate and spectrally degenerate graphs

A note on degenerate and spectrally degenerate graphs A note on degenerate and pectrally degenerate graph Noga Alon Abtract A graph G i called pectrally d-degenerate if the larget eigenvalue of each ubgraph of it with maximum degree D i at mot dd. We prove

More information

Q1:Choose the correct answer:

Q1:Choose the correct answer: Q:Chooe the orret anwer:. Purpoe of an OS i a. Create abtration b. Multiple proee ompete for ue of proeor. Coordination. Sheduler deide a. whih proee get to ue the proeor b. when proee get to ue the proeor.

More information

1. Introduction. Abstract

1. Introduction. Abstract Automati Ontology Derivation Uing Clutering for Image Claifiation 1 Latifur Khan and Lei Wang Department of Computer Siene Univerity of Texa at Dalla, TX 75083-0688 Email: [lkhan, leiwang]@utdalla.edu

More information

Midterm 2 March 10, 2014 Name: NetID: # Total Score

Midterm 2 March 10, 2014 Name: NetID: # Total Score CS 3 : Algorithm and Model of Computation, Spring 0 Midterm March 0, 0 Name: NetID: # 3 Total Score Max 0 0 0 0 Grader Don t panic! Pleae print your name and your NetID in the boxe above. Thi i a cloed-book,

More information

Relayer Selection Strategies in Cellular Networks with Peer-to-Peer Relaying

Relayer Selection Strategies in Cellular Networks with Peer-to-Peer Relaying Relayer Seletion Strategie in Cellular Network with Peer-to-Peer Relaying V. Sreng, H. Yanikomeroglu, and D. D. Faloner Broadband Communiation and Wirele Sytem (BCWS) Centre Dept. of Sytem and Computer

More information

Advanced Encryption Standard and Modes of Operation

Advanced Encryption Standard and Modes of Operation Advanced Encryption Standard and Mode of Operation G. Bertoni L. Breveglieri Foundation of Cryptography - AES pp. 1 / 50 AES Advanced Encryption Standard (AES) i a ymmetric cryptographic algorithm AES

More information

Minimum congestion spanning trees in bipartite and random graphs

Minimum congestion spanning trees in bipartite and random graphs Minimum congetion panning tree in bipartite and random graph M.I. Otrovkii Department of Mathematic and Computer Science St. John Univerity 8000 Utopia Parkway Queen, NY 11439, USA e-mail: otrovm@tjohn.edu

More information

Calculations for multiple mixers are based on a formalism that uses sideband information and LO frequencies: ( ) sb

Calculations for multiple mixers are based on a formalism that uses sideband information and LO frequencies: ( ) sb Setting frequeny parameter in the WASP databae A. Harri 24 Aug 2003 Calulation for multiple mixer are baed on a formalim that ue ideband information and LO frequenie: b b := ign f ig f LO f IF := f ig

More information

Karen L. Collins. Wesleyan University. Middletown, CT and. Mark Hovey MIT. Cambridge, MA Abstract

Karen L. Collins. Wesleyan University. Middletown, CT and. Mark Hovey MIT. Cambridge, MA Abstract Mot Graph are Edge-Cordial Karen L. Collin Dept. of Mathematic Weleyan Univerity Middletown, CT 6457 and Mark Hovey Dept. of Mathematic MIT Cambridge, MA 239 Abtract We extend the definition of edge-cordial

More information

ES205 Analysis and Design of Engineering Systems: Lab 1: An Introductory Tutorial: Getting Started with SIMULINK

ES205 Analysis and Design of Engineering Systems: Lab 1: An Introductory Tutorial: Getting Started with SIMULINK ES05 Analyi and Deign of Engineering Sytem: Lab : An Introductory Tutorial: Getting Started with SIMULINK What i SIMULINK? SIMULINK i a oftware package for modeling, imulating, and analyzing dynamic ytem.

More information

Announcements. CSE332: Data Abstractions Lecture 19: Parallel Prefix and Sorting. The prefix-sum problem. Outline. Parallel prefix-sum

Announcements. CSE332: Data Abstractions Lecture 19: Parallel Prefix and Sorting. The prefix-sum problem. Outline. Parallel prefix-sum Announcement Homework 6 due Friday Feb 25 th at the BEGINNING o lecture CSE332: Data Abtraction Lecture 19: Parallel Preix and Sorting Project 3 the lat programming project! Verion 1 & 2 - Tue March 1,

More information

CORRECTNESS ISSUES AND LOOP INVARIANTS

CORRECTNESS ISSUES AND LOOP INVARIANTS The next everal lecture 2 Study algorithm for earching and orting array. Invetigate their complexity how much time and pace they take Formalize the notion of average-cae and wort-cae complexity CORRECTNESS

More information

The norm Package. November 15, Title Analysis of multivariate normal datasets with missing values

The norm Package. November 15, Title Analysis of multivariate normal datasets with missing values The norm Package November 15, 2003 Verion 1.0-9 Date 2002/05/06 Title Analyi of multivariate normal dataet with miing value Author Ported to R by Alvaro A. Novo . Original by Joeph

More information

Operational Semantics Class notes for a lecture given by Mooly Sagiv Tel Aviv University 24/5/2007 By Roy Ganor and Uri Juhasz

Operational Semantics Class notes for a lecture given by Mooly Sagiv Tel Aviv University 24/5/2007 By Roy Ganor and Uri Juhasz Operational emantic Page Operational emantic Cla note for a lecture given by Mooly agiv Tel Aviv Univerity 4/5/7 By Roy Ganor and Uri Juhaz Reference emantic with Application, H. Nielon and F. Nielon,

More information

Delaunay Triangulation: Incremental Construction

Delaunay Triangulation: Incremental Construction Chapter 6 Delaunay Triangulation: Incremental Contruction In the lat lecture, we have learned about the Lawon ip algorithm that compute a Delaunay triangulation of a given n-point et P R 2 with O(n 2 )

More information

ISSN (Online), Volume 1, Special Issue 2(ICITET 15), March 2015 International Journal of Innovative Trends and Emerging Technologies

ISSN (Online), Volume 1, Special Issue 2(ICITET 15), March 2015 International Journal of Innovative Trends and Emerging Technologies International Journal of Innovative Trend and Emerging Tehnologie ROBUST SCAN TECHNIQUE FOR SECURED AES AGAINST DIFFERENTIAL CRYPTANALYSIS BASED SIDE CHANNEL ATTACK A.TAMILARASAN 1, MR.A.ANBARASAN 2 1

More information

How to. write a paper. The basics writing a solid paper Different communities/different standards Common errors

How to. write a paper. The basics writing a solid paper Different communities/different standards Common errors How to write a paper The baic writing a olid paper Different communitie/different tandard Common error Reource Raibert eay My grammar point Article on a v. the Bug in writing Clarity Goal Conciene Calling

More information

Quadrilaterals. Learning Objectives. Pre-Activity

Quadrilaterals. Learning Objectives. Pre-Activity Section 3.4 Pre-Activity Preparation Quadrilateral Intereting geometric hape and pattern are all around u when we tart looking for them. Examine a row of fencing or the tiling deign at the wimming pool.

More information

Drawing Lines in 2 Dimensions

Drawing Lines in 2 Dimensions Drawing Line in 2 Dimenion Drawing a traight line (or an arc) between two end point when one i limited to dicrete pixel require a bit of thought. Conider the following line uperimpoed on a 2 dimenional

More information

Laboratory Exercise 2

Laboratory Exercise 2 Laoratory Exercie Numer and Diplay Thi i an exercie in deigning cominational circuit that can perform inary-to-decimal numer converion and inary-coded-decimal (BCD) addition. Part I We wih to diplay on

More information

Universität Augsburg. Institut für Informatik. Approximating Optimal Visual Sensor Placement. E. Hörster, R. Lienhart.

Universität Augsburg. Institut für Informatik. Approximating Optimal Visual Sensor Placement. E. Hörster, R. Lienhart. Univerität Augburg à ÊÇÅÍÆ ËÀǼ Approximating Optimal Viual Senor Placement E. Hörter, R. Lienhart Report 2006-01 Januar 2006 Intitut für Informatik D-86135 Augburg Copyright c E. Hörter, R. Lienhart Intitut

More information

xy-monotone path existence queries in a rectilinear environment

xy-monotone path existence queries in a rectilinear environment CCCG 2012, Charlottetown, P.E.I., Augut 8 10, 2012 xy-monotone path exitence querie in a rectilinear environment Gregory Bint Anil Mahehwari Michiel Smid Abtract Given a planar environment coniting of

More information

See chapter 8 in the textbook. Dr Muhammad Al Salamah, Industrial Engineering, KFUPM

See chapter 8 in the textbook. Dr Muhammad Al Salamah, Industrial Engineering, KFUPM Goal programming Objective of the topic: Indentify indutrial baed ituation where two or more objective function are required. Write a multi objective function model dla a goal LP Ue weighting um and preemptive

More information

Algorithmic Discrete Mathematics 4. Exercise Sheet

Algorithmic Discrete Mathematics 4. Exercise Sheet Algorithmic Dicrete Mathematic. Exercie Sheet Department of Mathematic SS 0 PD Dr. Ulf Lorenz 0. and. May 0 Dipl.-Math. David Meffert Verion of May, 0 Groupwork Exercie G (Shortet path I) (a) Calculate

More information

Classical Univariate Statistics

Classical Univariate Statistics 1 2 Statitial Modelling and Computing Nik Fieller Department of Probability & Statiti Unierity of Sheffield, UK Claial Uniariate Statiti (& Alternatie) Claial tatitial tet and p-alue Simple imulation method

More information

On successive packing approach to multidimensional (M-D) interleaving

On successive packing approach to multidimensional (M-D) interleaving On ucceive packing approach to multidimenional (M-D) interleaving Xi Min Zhang Yun Q. hi ankar Bau Abtract We propoe an interleaving cheme for multidimenional (M-D) interleaving. To achieved by uing a

More information

Representations and Transformations. Objectives

Representations and Transformations. Objectives Repreentation and Tranformation Objective Derive homogeneou coordinate tranformation matrice Introduce tandard tranformation - Rotation - Tranlation - Scaling - Shear Scalar, Point, Vector Three baic element

More information

Uninformed Search Complexity. Informed Search. Search Revisited. Day 2/3 of Search

Uninformed Search Complexity. Informed Search. Search Revisited. Day 2/3 of Search Informed Search ay 2/3 of Search hap. 4, Ruel & Norvig FS IFS US PFS MEM FS IS Uninformed Search omplexity N = Total number of tate = verage number of ucceor (branching factor) L = Length for tart to goal

More information

Using Bayesian Networks for Cleansing Trauma Data

Using Bayesian Networks for Cleansing Trauma Data Uing Bayeian Network for Cleaning Trauma Data Prahant J. Dohi pdohi@.ui.edu Dept. of Computer Siene Univ of Illinoi, Chiago, IL 60607 Lloyd G. Greenwald lgreenwa@.drexel.edu Dept. of Computer Siene Drexel

More information

Key Terms - MinMin, MaxMin, Sufferage, Task Scheduling, Standard Deviation, Load Balancing.

Key Terms - MinMin, MaxMin, Sufferage, Task Scheduling, Standard Deviation, Load Balancing. Volume 3, Iue 11, November 2013 ISSN: 2277 128X International Journal of Advanced Reearch in Computer Science and Software Engineering Reearch Paper Available online at: www.ijarce.com Tak Aignment in

More information

SPH3UW Unit 7.1 The Ray Model of Light Page 2 of 5. The accepted value for the speed of light inside a vacuum is c m which we usually

SPH3UW Unit 7.1 The Ray Model of Light Page 2 of 5. The accepted value for the speed of light inside a vacuum is c m which we usually SPH3UW Unit 7. The Ray Model of Light Page of 5 Note Phyi Tool box Ray light trael in traight path alled ray. Index of refration (n) i the ratio of the peed of light () in a auu to the peed of light in

More information

The Association of System Performance Professionals

The Association of System Performance Professionals The Aociation of Sytem Performance Profeional The Computer Meaurement Group, commonly called CMG, i a not for profit, worldwide organization of data proceing profeional committed to the meaurement and

More information

Floating Point CORDIC Based Power Operation

Floating Point CORDIC Based Power Operation Floating Point CORDIC Baed Power Operation Kazumi Malhan, Padmaja AVL Electrical and Computer Engineering Department School of Engineering and Computer Science Oakland Univerity, Rocheter, MI e-mail: kmalhan@oakland.edu,

More information

Chapter 13 Non Sampling Errors

Chapter 13 Non Sampling Errors Chapter 13 Non Sampling Error It i a general aumption in the ampling theory that the true value of each unit in the population can be obtained and tabulated without any error. In practice, thi aumption

More information

Lecture 8: More Pipelining

Lecture 8: More Pipelining Overview Lecture 8: More Pipelining David Black-Schaffer davidbb@tanford.edu EE8 Spring 00 Getting Started with Lab Jut get a ingle pixel calculating at one time Then look into filling your pipeline Multiplier

More information

Edits in Xylia Validity Preserving Editing of XML Documents

Edits in Xylia Validity Preserving Editing of XML Documents dit in Xylia Validity Preerving diting of XML Document Pouria Shaker, Theodore S. Norvell, and Denni K. Peter Faculty of ngineering and Applied Science, Memorial Univerity of Newfoundland, St. John, NFLD,

More information

Parallel MATLAB at FSU: Task Computing

Parallel MATLAB at FSU: Task Computing Parallel MATLAB at FSU: Tak John Burkardt Department of Scientific Florida State Univerity... 1:30-2:30 Thurday, 07 April 2011 499 Dirac Science Library... http://people.c.fu.edu/ jburkardt/preentation/...

More information

An Evolutionary Multiple Heuristic with Genetic Local Search for Solving TSP

An Evolutionary Multiple Heuristic with Genetic Local Search for Solving TSP An Evolutionary Multiple Heuriti with Geneti Loal Searh for Solving TSP Peng Gang Ihiro Iimura 2 and Shigeru Nakayama 3 Department of Information and Computer Siene Faulty of Engineering Kagohima Univerity

More information

KS3 Maths Assessment Objectives

KS3 Maths Assessment Objectives KS3 Math Aement Objective Tranition Stage 9 Ratio & Proportion Probabilit y & Statitic Appreciate the infinite nature of the et of integer, real and rational number Can interpret fraction and percentage

More information

Exercise 4: Markov Processes, Cellular Automata and Fuzzy Logic

Exercise 4: Markov Processes, Cellular Automata and Fuzzy Logic Exercie 4: Marko rocee, Cellular Automata and Fuzzy Logic Formal Method II, Fall Semeter 203 Solution Sheet Marko rocee Theoretical Exercie. (a) ( point) 0.2 0.7 0.3 tanding 0.25 lying 0.5 0.4 0.2 0.05

More information

arxiv: v1 [physics.soc-ph] 17 Oct 2013

arxiv: v1 [physics.soc-ph] 17 Oct 2013 Emergene of Blind Area in Information Sreading arxiv:131707v1 [hyi.o-h] 17 Ot 2013 Zi-Ke Zhang 1,2,, Chu-Xu Zhang 1,3,, Xiao-Pu Han 1,2 and Chuang Liu 1,2 1 Intitute of Information Eonomy, Hangzhou Normal

More information

Colouring contact graphs of squares and rectilinear polygons de Berg, M.T.; Markovic, A.; Woeginger, G.

Colouring contact graphs of squares and rectilinear polygons de Berg, M.T.; Markovic, A.; Woeginger, G. Colouring ontat graphs of squares and retilinear polygons de Berg, M.T.; Markovi, A.; Woeginger, G. Published in: nd European Workshop on Computational Geometry (EuroCG 06), 0 Marh - April, Lugano, Switzerland

More information

In-Plane Shear Behavior of SC Composite Walls: Theory vs. Experiment

In-Plane Shear Behavior of SC Composite Walls: Theory vs. Experiment Tranation, MiRT, 6- November,, New Delhi, India Div-VI: Paper ID# 764 In-Plane hear Behavior of C Compoite Wall: Theory v. Experiment Amit H. Varma, ai Zhang, Hoeok Chi 3, Peter Booth 4, Tod Baker 5 Aoiate

More information

Web Science and additionality

Web Science and additionality Admin tuff... Lecture 1: EITN01 Web Intelligence and Information Retrieval Meage, lide, handout, lab manual and link: http://www.eit.lth.e/coure/eitn01 Contact: Ander Ardö, Ander.Ardo@eit.lth.e, room:

More information

Chapter S:II (continued)

Chapter S:II (continued) Chapter S:II (continued) II. Baic Search Algorithm Sytematic Search Graph Theory Baic State Space Search Depth-Firt Search Backtracking Breadth-Firt Search Uniform-Cot Search AND-OR Graph Baic Depth-Firt

More information

Laboratory Exercise 6

Laboratory Exercise 6 Laboratory Exercie 6 Adder, Subtractor, and Multiplier The purpoe of thi exercie i to examine arithmetic circuit that add, ubtract, and multiply number. Each type of circuit will be implemented in two

More information

Visual Targeted Advertisement System Based on User Profiling and Content Consumption for Mobile Broadcasting Television

Visual Targeted Advertisement System Based on User Profiling and Content Consumption for Mobile Broadcasting Television Viual Targeted Advertiement Sytem Baed on Uer Profiling and ontent onumption for Mobile Broadating Televiion Silvia Uribe Federio Alvarez Joé Manuel Menéndez Guillermo inero Abtrat ontent peronaliation

More information

DWH Performance Tuning For Better Reporting

DWH Performance Tuning For Better Reporting DWH Performance Tuning For Better Sandeep Bhargava Reearch Scholar Naveen Hemrajani Aociate Profeor Dineh Goyal Aociate Profeor Subhah Gander IT Profeional ABSTRACT: The concept of data warehoue deal in

More information

CS 467/567: Divide and Conquer on the PRAM

CS 467/567: Divide and Conquer on the PRAM CS 467/567: Divide and Conquer on the PRAM Stefan D. Bruda Winter 2017 BINARY SEARCH Problem: Given a equence S 1..n orted in nondecreaing order and a value x, find the ubcript k uch that S i x If n proceor

More information

Performance of a Robust Filter-based Approach for Contour Detection in Wireless Sensor Networks

Performance of a Robust Filter-based Approach for Contour Detection in Wireless Sensor Networks Performance of a Robut Filter-baed Approach for Contour Detection in Wirele Senor Network Hadi Alati, William A. Armtrong, Jr., and Ai Naipuri Department of Electrical and Computer Engineering The Univerity

More information

VLSI Design 9. Datapath Design

VLSI Design 9. Datapath Design VLSI Deign 9. Datapath Deign 9. Datapath Deign Lat module: Adder circuit Simple adder Fat addition Thi module omparator Shifter Multi-input Adder Multiplier omparator detector: A = 1 detector: A = 11 111

More information

A Boyer-Moore Approach for. Two-Dimensional Matching. Jorma Tarhio. University of California. Berkeley, CA Abstract

A Boyer-Moore Approach for. Two-Dimensional Matching. Jorma Tarhio. University of California. Berkeley, CA Abstract A Boyer-Moore Approach for Two-Dimenional Matching Jorma Tarhio Computer Science Diviion Univerity of California Berkeley, CA 94720 Abtract An imple ublinear algorithm i preented for two-dimenional tring

More information

Contents. shortest paths. Notation. Shortest path problem. Applications. Algorithms and Networks 2010/2011. In the entire course:

Contents. shortest paths. Notation. Shortest path problem. Applications. Algorithms and Networks 2010/2011. In the entire course: Content Shortet path Algorithm and Network 21/211 The hortet path problem: Statement Verion Application Algorithm (for ingle ource p problem) Reminder: relaxation, Dijktra, Variant of Dijktra, Bellman-Ford,

More information

else end while End References

else end while End References 621-630. [RM89] [SK76] Roenfeld, A. and Melter, R. A., Digital geometry, The Mathematical Intelligencer, vol. 11, No. 3, 1989, pp. 69-72. Sklanky, J. and Kibler, D. F., A theory of nonuniformly digitized

More information

Refining SIRAP with a Dedicated Resource Ceiling for Self-Blocking

Refining SIRAP with a Dedicated Resource Ceiling for Self-Blocking Refining SIRAP with a Dedicated Reource Ceiling for Self-Blocking Mori Behnam, Thoma Nolte Mälardalen Real-Time Reearch Centre P.O. Box 883, SE-721 23 Väterå, Sweden {mori.behnam,thoma.nolte}@mdh.e ABSTRACT

More information

Kinematic design of a double wishbone type front suspension mechanism using multi-objective optimization

Kinematic design of a double wishbone type front suspension mechanism using multi-objective optimization 5 th utralaian Congre on pplied Mehani, CM 2007 10-12 Deember 2007, Bribane, utralia Kinemati deign of a double wihbone tpe front upenion mehanim uing multi-objetive optimiation J. S. wang 1, S. R. Kim

More information

Topics. FPGA Design EECE 277. Number Representation and Adders. Class Exercise. Laboratory Assignment #2

Topics. FPGA Design EECE 277. Number Representation and Adders. Class Exercise. Laboratory Assignment #2 FPGA Deign EECE 277 Number Repreentation and Adder Dr. William H. Robinon Februar 2, 25 Topi There are kind of people in the world, thoe that undertand binar and thoe that don't. Unknown Adminitrative

More information

Shortest Path Routing in Arbitrary Networks

Shortest Path Routing in Arbitrary Networks Journal of Algorithm, Vol 31(1), 1999 Shortet Path Routing in Arbitrary Network Friedhelm Meyer auf der Heide and Berthold Vöcking Department of Mathematic and Computer Science and Heinz Nixdorf Intitute,

More information

Markov Random Fields in Image Segmentation

Markov Random Fields in Image Segmentation Preented at SSIP 2011, Szeged, Hungary Markov Random Field in Image Segmentation Zoltan Kato Image Proceing & Computer Graphic Dept. Univerity of Szeged Hungary Zoltan Kato: Markov Random Field in Image

More information

Datum Transformations of NAV420 Reference Frames

Datum Transformations of NAV420 Reference Frames NA4CA Appliation Note Datum ranformation of NA4 Referene Frame Giri Baleri, Sr. Appliation Engineer Crobow ehnology, In. http://www.xbow.om hi appliation note explain how to onvert variou referene frame

More information

Reporting Checklist for Nature Neuroscience

Reporting Checklist for Nature Neuroscience Correponding Author: Manucript Number: Manucript Type: Jeremy Elman NNBC48172A Brief Communication Reporting Checklit for Nature Neurocience # Figure: 2 # Figure: 5 # Table: 6 # Video: 0 Thi checklit i

More information

CleanUp: Improving Quadrilateral Finite Element Meshes

CleanUp: Improving Quadrilateral Finite Element Meshes CleanUp: Improving Quadrilateral Finite Element Meshes Paul Kinney MD-10 ECC P.O. Box 203 Ford Motor Company Dearborn, MI. 8121 (313) 28-1228 pkinney@ford.om Abstrat: Unless an all quadrilateral (quad)

More information

An Intro to LP and the Simplex Algorithm. Primal Simplex

An Intro to LP and the Simplex Algorithm. Primal Simplex An Intro to LP and the Simplex Algorithm Primal Simplex Linear programming i contrained minimization of a linear objective over a olution pace defined by linear contraint: min cx Ax b l x u A i an m n

More information

DAROS: Distributed User-Server Assignment And Replication For Online Social Networking Applications

DAROS: Distributed User-Server Assignment And Replication For Online Social Networking Applications DAROS: Ditributed Uer-Server Aignment And Replication For Online Social Networking Application Thuan Duong-Ba School of EECS Oregon State Univerity Corvalli, OR 97330, USA Email: duongba@eec.oregontate.edu

More information

IMPLEMENTATION OF AREA, VOLUME AND LINE SOURCES

IMPLEMENTATION OF AREA, VOLUME AND LINE SOURCES December 01 ADMS 5 P503I1 IMPEMENTATION OF AREA, VOUME AND INE SOURCES The Met. Office (D J Thomon) and CERC 1. INTRODUCTION ADMS model line ource, and area and volume ource with conve polgon bae area.

More information

Triangles. Learning Objectives. Pre-Activity

Triangles. Learning Objectives. Pre-Activity Setion 3.2 Pre-tivity Preparation Triangles Geena needs to make sure that the dek she is building is perfetly square to the brae holding the dek in plae. How an she use geometry to ensure that the boards

More information

Shortest Paths with Single-Point Visibility Constraint

Shortest Paths with Single-Point Visibility Constraint Shortet Path with Single-Point Viibility Contraint Ramtin Khoravi Mohammad Ghodi Department of Computer Engineering Sharif Univerity of Technology Abtract Thi paper tudie the problem of finding a hortet

More information

SIMIT 7. Profinet IO Gateway. User Manual

SIMIT 7. Profinet IO Gateway. User Manual SIMIT 7 Profinet IO Gateway Uer Manual Edition January 2013 Siemen offer imulation oftware to plan, imulate and optimize plant and machine. The imulation- and optimizationreult are only non-binding uggetion

More information

Planning of scooping position and approach path for loading operation by wheel loader

Planning of scooping position and approach path for loading operation by wheel loader 22 nd International Sympoium on Automation and Robotic in Contruction ISARC 25 - September 11-14, 25, Ferrara (Italy) 1 Planning of cooping poition and approach path for loading operation by wheel loader

More information

Drawing lines. Naïve line drawing algorithm. drawpixel(x, round(y)); double dy = y1 - y0; double dx = x1 - x0; double m = dy / dx; double y = y0;

Drawing lines. Naïve line drawing algorithm. drawpixel(x, round(y)); double dy = y1 - y0; double dx = x1 - x0; double m = dy / dx; double y = y0; Naïve line drawing algorithm // Connet to grid points(x0,y0) and // (x1,y1) by a line. void drawline(int x0, int y0, int x1, int y1) { int x; double dy = y1 - y0; double dx = x1 - x0; double m = dy / dx;

More information

/06/$ IEEE 364

/06/$ IEEE 364 006 IEEE International ympoium on ignal Proceing and Information Technology oie Variance Etimation In ignal Proceing David Makovoz IPAC, California Intitute of Technology, MC-0, Paadena, CA, 95 davidm@ipac.caltech.edu;

More information

Chapter 2: Introduction to Maple V

Chapter 2: Introduction to Maple V Chapter 2: Introdution to Maple V 2-1 Working with Maple Worksheets Try It! (p. 15) Start a Maple session with an empty worksheet. The name of the worksheet should be Untitled (1). Use one of the standard

More information

AVL Tree. The height of the BST be as small as possible

AVL Tree. The height of the BST be as small as possible 1 AVL Tree re and Algorithm The height of the BST be a mall a poible The firt balanced BST. Alo called height-balanced tree. Introduced by Adel on-vel kii and Landi in 1962. BST with the following condition:

More information

Brief Announcement: Distributed 3/2-Approximation of the Diameter

Brief Announcement: Distributed 3/2-Approximation of the Diameter Brief Announcement: Ditributed /2-Approximation of the Diameter Preliminary verion of a brief announcement to appear at DISC 14 Stephan Holzer MIT holzer@mit.edu David Peleg Weizmann Intitute david.peleg@weizmann.ac.il

More information

Maneuverable Relays to Improve Energy Efficiency in Sensor Networks

Maneuverable Relays to Improve Energy Efficiency in Sensor Networks Maneuverable Relay to Improve Energy Efficiency in Senor Network Stephan Eidenbenz, Luka Kroc, Jame P. Smith CCS-5, MS M997; Lo Alamo National Laboratory; Lo Alamo, NM 87545. Email: {eidenben, kroc, jpmith}@lanl.gov

More information

Variable Resolution Discretization in the Joint Space

Variable Resolution Discretization in the Joint Space Variable Reolution Dicretization in the Joint Space Chritopher K. Monon, David Wingate, and Kevin D. Seppi {c,wingated,keppi}@c.byu.edu Computer Science, Brigham Young Univerity Todd S. Peteron peterto@uvc.edu

More information

OSI Model. SS7 Protocol Model. Application TCAP. Presentation Session Transport. ISDN-UP Null SCCP. Network. MTP Level 3 MTP Level 2 MTP Level 1

OSI Model. SS7 Protocol Model. Application TCAP. Presentation Session Transport. ISDN-UP Null SCCP. Network. MTP Level 3 MTP Level 2 MTP Level 1 Direte Event Simulation of CCS7 DAP Benjamin, AE Krzeinki and S Staven Department of Computer Siene Univerity of Stellenboh 7600 Stellenboh, South Afria fbenj,aek,taveng@.un.a.za ABSTRACT: Complex imulation

More information

A Multi-objective Genetic Algorithm for Reliability Optimization Problem

A Multi-objective Genetic Algorithm for Reliability Optimization Problem International Journal of Performability Engineering, Vol. 5, No. 3, April 2009, pp. 227-234. RAMS Conultant Printed in India A Multi-objective Genetic Algorithm for Reliability Optimization Problem AMAR

More information

CSE 250B Assignment 4 Report

CSE 250B Assignment 4 Report CSE 250B Aignment 4 Report March 24, 2012 Yuncong Chen yuncong@c.ucd.edu Pengfei Chen pec008@ucd.edu Yang Liu yal060@c.ucd.edu Abtract In thi project, we implemented the recurive autoencoder (RAE) a decribed

More information