Algorithms & Data Structures Homework 8 HS 18 Exercise Class (Room & TA): Submitted by: Peer Feedback by: Points:
|
|
- Shanna Maxwell
- 5 years ago
- Views:
Transcription
1 Eidgenössishe Tehnishe Hohshule Zürih Eole polytehnique fédérle de Zurih Politenio federle di Zurigo Federl Institute of Tehnology t Zurih Deprtement of Computer Siene. Novemer 0 Mrkus Püshel, Dvid Steurer Algorithms & Dt Strutures Homework HS Exerise Clss (Room & TA): Sumitted y: Peer Feedk y: Points: Exerise. Serh Trees.. Drw the resulting tree when the keys,,7,,,,, in this order re inserted into n initilly empty nturl serh tree. 7. Delete key in the ove tree, nd fterwrds key 7 in the resulting tree. Key hs one hild, so it n just e repled y :
2 7 Key 7 must either e repled y its suessor key,, or its preesessor key,. If key 7 is repled y its suessor: If key 7 is insted repled y its predeessor:. Drw the resulting tree when the keys re inserted into n initilly empty AVL tree. Insert nd then :
3 Insert 7: Rotte left. Pivot = 7 7 Insert nd then : 7 Rotte left. Pivot = Rotte right. Pivot = 7 7 Insert : Rotte left. Pivot = 7 7 Insert nd :
4 7. Delete key 7 in the ove tree, nd fterwrds key in the resulting tree. Delete 7: Delete : Rotte right. Pivot = Exerise. Tree Trversls. There re three essentil wys to trverse inry trees. The first one is Preorder(T ), whih t first visits the root v, then T l (v) nd then T r (v), where T l (v) is the left sutree of v nd T r (v) is the right sutree of v. The seond one is Postorder(T ), whih t first visits T l (v), then T r (v) nd then v. The third one is Inorder(T ), whih t first visits T l (v), then v nd then T r (v). In eh se the left nd right sutrees re visited reursively in the sme order.
5 . Consider this pseudoode for the Preorder proedure: Algorithm : Preorder(T ) if T is non-empty then v Root(T ); Visit(v); Preorder(T l (v)); Preorder(T r (v)); end Write pseudoodes for Postorder nd Inorder proedures. Algorithm : Postorder(T ) if T is non-empty then v Root(T ); Postorder(T l (v)); Postorder(T r (v)); Visit(v); end Algorithm : Inorder(T ) if T is non-empty then v Root(T ); Inorder(T l (v)); Visit(v); Inorder(T r (v)); end. For the ove serh trees in.. nd.. give the Preorder, the Postorder, the Inorder of the nodes. For the tree in..: Preorder:,,, 7,,,,. Postorder:,,,,, 7,,. Inorder:,,,,,, 7,. For the tree in..: Preorder:,,,,, 7,,. Postorder:,,,,,, 7,. Inorder:,,,,,, 7,.. Drw the inry tree with keys,,,,,, 7, suh tht the Preorder strts with,,, 7 nd the Postorder ends with,, 7,.
6 7 Exerise. Advned Serh Trees ( Point). In this exerise, we wish to extend the funtionlity of serh tree. We onsider inry serh tree over integers. In ddition to finding numer, we wnt to e le to nswer the following questions:. How mny elements in the tree re multiples of nd greter thn given numer k?. How mny elements in the tree re multiples of nd (stritly) etween two given numers k nd k, with k < k? Disuss how you n modify the tree so tht you n nswer these questions effiiently. Desrie how the insertion nd the removl opertion must e hnged ordingly. Inlude disussion of the running times of the modified lgorithms. Solution In ddition to the vlue of the key, we store t eh node v of the tree the numer g v of elements tht re multiples of nd re in the right sutree of v. When sked for the numer of elements tht re multiples of nd greter thn k, we look for the element k in the tree. Every time we go to the left sutree of node v (in the se where k is smller thn the key in v), we inrement ounter y g v (initilly the ounter is zero), or y g v + if v is multiple of nd greter thn k. If we go to the right sutree, we keep the ounter unhnged. If we find k in node v, then we dd one lst time g v to the ounter. Otherwise, we end up in lef v of the tree. Then, if the key of v is smller or equl to k, the ounter is lredy set to the orret numer. Otherwise, we inrese the ounter y one if the key in v is multiple of. To nswer how mny numers re multiple of nd etween k nd k in the tree, we need to determine only the vlues L, L of elements tht re multiple of nd lrger thn k nd k respetively. We hve just seen how to find these vlues. Sutrting L from L, we otin how mny suh numers x suh tht k < x k re in the tree. If k exists in the tree nd is multiple of, we thus hve to remove one from this numer. We n esily hek for this se when omputing L. The insertion of n element i works s follows. We first serh for i. If it is lredy in the tree, we do nothing. If i is not multiple of, we insert it in the lef where the serh ended nd we set g i 0. If i is multiple of, we dditionlly trverse the tree gin (i.e., serh for i gin) nd whenever we meet node v ontining smller key (i.e., we turn right ), we inrese g v y one sine i is inserted in its right sutree. The removl of n element i works s follows. Agin, we first serh for i. If it is not in the tree, we do nothing. Otherwise we ontinue in i to find its symmetril predeessor n. We will lter reple i y n. First, we need to updte ll ounters. If i is multiple of, we trverse the tree gin from the root to i (i.e., serh for i), nd whenever we turn right in node v, we derement the vlue g v. Similrly,
7 if n is multiple of, we derement the ounters on the pth from i to n t every right turn. Due to the properties of the symmetri predeessor, it holds tht g n = 0. We now set n in the old position of i. Furthermore, we set g n g i, sine n ws originlly in the left sutree of i. All new tree opertions require n dditionl effort tht is onstnt in every visited node, therefore there is no impt on the symptoti running time of Insert, Serh nd Remove. Exerise. Mximum Depth Differene of two Leves. Consider n AVL tree of height h. Wht is the mximum possile differene of the depths of two leves? Imging whih struture suh trees need to hve, nd drw exmples of orresponding trees for every h {,, }. Derive reursive formul (depending on h), solve it nd use indution to prove the orretness of your solution. Provide detiled explntion of your onsidertions. Note: For the proof the priniple of omplete indution n e used. Let A(n) e sttement for numer n N. If, for every n N, the vlidity of ll sttements A(m) for m {,..., n } implies the vlidity of A(n), then A(n) is true for every n N. ( n N : ( m {,..., n } : A(m) ) ) A(n) n N : A(n). () Thus, omplete indution llows multiple se ses nd indutive hypotheses. For n AVL-tree T with root node v nd height h, we n distinguish the following ses: Both su-trees T l (v) nd T r (v) hve height h T l (v) hs height h nd T r (v) hs height h, or T l (v) hs height h nd T r (v) hs height h As we re interested in the mximum depth differene of two leves, we n disregrd the first se, nd fous on su-trees tht hve heights tht differ y. Without loss of generlity, we n tke the seond se, ssuming tht the left su-tree will hve height of h, while the right su-tree will hve height of h. If the left su-tree is n AVL-tree of height h, then the right tree must e n AVL-tree of height h. This omes from the properties of n AVL tree, euse if t ny time they differ y more thn one, relning is done to restore this property. As result of this, the entire tree T will hve height of h nd s suh there will e lef on the left-sutree with this depth. The figure elow illustrtes the AVL trees of height h {,, }: In generl, we onsider trees with the following struture: 7
8 The left sutree T l (v) ontins lef of depth h (while T l (v) hs height of h ), the right sutree T r (v) ontins lef of depth h (while T r (v) hs height h ). The mximum possile differene of the depths of two leves in the tree (with height h) is therefore greter thn the mximum differene of the depths of two leves in the right sutree (with height h ). For h = nd h =, the mximum depth differene is extly. As result, we hve the following reursive formul for the mximum differene of the depths of two leves in tree of height h: D() =, D() =, D(h) = + D(h ) for ll h. () From the ove, we n ssume tht D(h) = h/. We prove this ssumption using indution over h. Bse se I (h = ): D() = = /. Bse se II (h = ): D() = = /. Indution hypothesis: Assume tht the property holds for some h: D(h ) = (h )/. Indutive step: ((h ) h): From the reursive definition of D(h), we hve: D(h) = + D(h ) = + (h )/ = + h/ = + h/ = h/. () Exerise. One-Column Cndy Crush ( Points.). Consider olumn of n ndies, nd ssume tht if three or more djent ndies in this olumn re equl, then these ndies n e removed, nd the olumn shrinks. Removing the ndies is done with the following tie reking rule: The ndies re removed from top to ottom, i.e., when there is more thn one group tht n e removed t the sme time, the upper group is removed first. We re interested in the numer of ndies tht n not e removed. You get this olumn of ndies stored on stk S, suh tht the first (topmost) ndy of the olumn is on the top of this stk. Rell tht the opertions on stk re top(), pop(), nd push(v) where v is ndy. Moreover, you n ess the numer of ndies in the stk. Assume tht ll these opertions require onstnt time. Your tsk is to design liner time lgorithm tht returns the numer of the remining ndies. Your lgorithm is llowed to use stk S plus one dditionl stk T, for whih you n ssume tht it is initilly empty. On top of tht, you re llowed to use only O() extr memory spe. Provide n nlysis of the tul running time of your lgorithm. We ssume tht n >, otherwise the nswer is trivil. We strt with n oservtion: whenever the topmost group of ndies e, e,..., e is removed from the olumn, then either this removl
9 T e S Figure : Exmple for the exeution of the lgorithm. leds to three or more other equl ndies e, e,..., e tht re now djent ut were split efore into two groups y the es, or the next topmost group to e removed is further down in the olumn. The ide of our lgorithm is s follows: Split the olumn into tree prts, S, e, nd T, where e is single ndy nd S nd T re stks. We will keep the following invrints: No group of ndies in T plus e n e removed The remining olumn is given y the ndies in T kwrds, e, nd the ndies in S forwrds S > 0 Initilly, the first ndy of S is popped into e. Then, intuitively the following step is repeted until S is empty.. Chek whether the top ndies in S nd T (if they exists) re oth equl to e.. If no, then e does not elong to the next group to remove. Therefore, push e to T nd pop the the top ndy of S into e.. If yes, then you hve found the topmost group of ndies to remove. Remove thus ll equl ndies on the top of T nd S. Reple the ndy in e with the top ndy of T, or if no suh ndy exists with the top ndy of S. When the lgorithm termintes, ll ndies tht nnot e removed re in T or e. Consider the pseudoode in Algorithm. An exmple is given in Figure. The running time of the lgorithm is s follows: in eh step (eh itertion in the outer while loop), the lgorithm does x pops from S (nd no pushes), nd onstnt numer of other opertions. So the totl numer of pops from S is n nd the numer of other opertions is O(#of steps) whih is lso t most n (sine when S = 0 the lgorithm termintes). Therefore, the running time of the lgorithm is in Θ(n). Sumission: On Mondy, 9..0, hnd in your solution to your TA efore the exerise lss strts. 9
10 Algorithm : One-Column_Cndy_Crush(S) e = S.pop(); while S > 0 do if ( T > 0 nd e == T.top() nd e == S.top()) then //Remove the mthing ndy from T (There n only e one!!! WHY?) T.pop(); //Remove the mthing ndies from S 7 while ( S > 0 nd S.top() == e) do S.pop(); 9 end 0 //Find new middle ndy e if ( T > 0) then e = T.pop(); else if ( S > 0) then e = S.pop(); else //Out of ndies 7 return 0; end 9 else 0 //e nnot e removed now, move it to T T.push(e); e = S.pop(); end end //No more ndies n e removed return + T ; 0
Data Structures (INE2011)
Dt Strutures (INE2011) Eletronis nd Communition Engineering Hnyng University Hewoon Nm Leture 7 INE2011 Dt Strutures 1 Binry Tree Trversl Mny inry tree opertions re done y perorming trversl o the inry
More information1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.
1 PYTHAGORAS THEOREM 1 1 Pythgors Theorem In this setion we will present geometri proof of the fmous theorem of Pythgors. Given right ngled tringle, the squre of the hypotenuse is equl to the sum of the
More information22: Union Find. CS 473u - Algorithms - Spring April 14, We want to maintain a collection of sets, under the operations of:
22: Union Fin CS 473u - Algorithms - Spring 2005 April 14, 2005 1 Union-Fin We wnt to mintin olletion of sets, uner the opertions of: 1. MkeSet(x) - rete set tht ontins the single element x. 2. Fin(x)
More informationChapter 4 State-Space Planning
Leture slides for Automted Plnning: Theory nd Prtie Chpter 4 Stte-Spe Plnning Dn S. Nu CMSC 722, AI Plnning University of Mrylnd, Spring 2008 1 Motivtion Nerly ll plnning proedures re serh proedures Different
More informationCounting Paths Between Vertices. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs
Isomorphism of Grphs Definition The simple grphs G 1 = (V 1, E 1 ) n G = (V, E ) re isomorphi if there is ijetion (n oneto-one n onto funtion) f from V 1 to V with the property tht n re jent in G 1 if
More informationLinear Algebra Introduction
Introdution Wht is Liner Alger out? Liner Alger is rnh of mthemtis whih emerged yers k nd ws one of the pioneer rnhes of mthemtis Though, initilly it strted with solving of the simple liner eqution x +
More informationTechnische Universität München Winter term 2009/10 I7 Prof. J. Esparza / J. Křetínský / M. Luttenberger 11. Februar Solution
Tehnishe Universität Münhen Winter term 29/ I7 Prof. J. Esprz / J. Křetínský / M. Luttenerger. Ferur 2 Solution Automt nd Forml Lnguges Homework 2 Due 5..29. Exerise 2. Let A e the following finite utomton:
More informationGlobal alignment. Genome Rearrangements Finding preserved genes. Lecture 18
Computt onl Biology Leture 18 Genome Rerrngements Finding preserved genes We hve seen before how to rerrnge genome to obtin nother one bsed on: Reversls Knowledge of preserved bloks (or genes) Now we re
More information5. Every rational number have either terminating or repeating (recurring) decimal representation.
CHAPTER NUMBER SYSTEMS Points to Rememer :. Numer used for ounting,,,,... re known s Nturl numers.. All nturl numers together with zero i.e. 0,,,,,... re known s whole numers.. All nturl numers, zero nd
More informationDiscrete Structures, Test 2 Monday, March 28, 2016 SOLUTIONS, VERSION α
Disrete Strutures, Test 2 Mondy, Mrh 28, 2016 SOLUTIONS, VERSION α α 1. (18 pts) Short nswer. Put your nswer in the ox. No prtil redit. () Consider the reltion R on {,,, d with mtrix digrph of R.. Drw
More informationSection 1.3 Triangles
Se 1.3 Tringles 21 Setion 1.3 Tringles LELING TRINGLE The line segments tht form tringle re lled the sides of the tringle. Eh pir of sides forms n ngle, lled n interior ngle, nd eh tringle hs three interior
More informationSolutions for HW9. Bipartite: put the red vertices in V 1 and the black in V 2. Not bipartite!
Solutions for HW9 Exerise 28. () Drw C 6, W 6 K 6, n K 5,3. C 6 : W 6 : K 6 : K 5,3 : () Whih of the following re iprtite? Justify your nswer. Biprtite: put the re verties in V 1 n the lk in V 2. Biprtite:
More informationWelcome. Balanced search trees. Balanced Search Trees. Inge Li Gørtz
Welome nge Li Gørt. everse tehing n isussion of exerises: 02110 nge Li Gørt 3 tehing ssistnts 8.00-9.15 Group work 9.15-9.45 isussions of your solutions in lss 10.00-11.15 Leture 11.15-11.45 Work on exerises
More informationLecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations.
Lecture 3 3 Solving liner equtions In this lecture we will discuss lgorithms for solving systems of liner equtions Multiplictive identity Let us restrict ourselves to considering squre mtrices since one
More informationCS 360 Exam 2 Fall 2014 Name
CS 360 Exm 2 Fll 2014 Nme 1. The lsses shown elow efine singly-linke list n stk. Write three ifferent O(n)-time versions of the reverse_print metho s speifie elow. Eh version of the metho shoul output
More information12.4 Similarity in Right Triangles
Nme lss Dte 12.4 Similrit in Right Tringles Essentil Question: How does the ltitude to the hpotenuse of right tringle help ou use similr right tringles to solve prolems? Eplore Identifing Similrit in Right
More informationIntermediate Math Circles Wednesday 17 October 2012 Geometry II: Side Lengths
Intermedite Mth Cirles Wednesdy 17 Otoer 01 Geometry II: Side Lengths Lst week we disussed vrious ngle properties. As we progressed through the evening, we proved mny results. This week, we will look t
More informationQUADRATIC EQUATION. Contents
QUADRATIC EQUATION Contents Topi Pge No. Theory 0-04 Exerise - 05-09 Exerise - 09-3 Exerise - 3 4-5 Exerise - 4 6 Answer Key 7-8 Syllus Qudrti equtions with rel oeffiients, reltions etween roots nd oeffiients,
More informationCISC 320 Introduction to Algorithms Spring 2014
CISC 20 Introdution to Algorithms Spring 2014 Leture 9 Red-Blk Trees Courtes of Prof. Lio Li 1 Binr Serh Trees (BST) ke[x]: ke stored t x. left[x]: pointer to left hild of x. right[x]: pointer to right
More informationComputational Biology Lecture 18: Genome rearrangements, finding maximal matches Saad Mneimneh
Computtionl Biology Leture 8: Genome rerrngements, finding miml mthes Sd Mneimneh We hve seen how to rerrnge genome to otin nother one sed on reversls nd the knowledge of the preserved loks or genes. Now
More informationProject 6: Minigoals Towards Simplifying and Rewriting Expressions
MAT 51 Wldis Projet 6: Minigols Towrds Simplifying nd Rewriting Expressions The distriutive property nd like terms You hve proly lerned in previous lsses out dding like terms ut one prolem with the wy
More informationp-adic Egyptian Fractions
p-adic Egyptin Frctions Contents 1 Introduction 1 2 Trditionl Egyptin Frctions nd Greedy Algorithm 2 3 Set-up 3 4 p-greedy Algorithm 5 5 p-egyptin Trditionl 10 6 Conclusion 1 Introduction An Egyptin frction
More informationA Lower Bound for the Length of a Partial Transversal in a Latin Square, Revised Version
A Lower Bound for the Length of Prtil Trnsversl in Ltin Squre, Revised Version Pooy Htmi nd Peter W. Shor Deprtment of Mthemtil Sienes, Shrif University of Tehnology, P.O.Bo 11365-9415, Tehrn, Irn Deprtment
More informationI1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3
2 The Prllel Circuit Electric Circuits: Figure 2- elow show ttery nd multiple resistors rrnged in prllel. Ech resistor receives portion of the current from the ttery sed on its resistnce. The split is
More informationLecture 6: Coding theory
Leture 6: Coing theory Biology 429 Crl Bergstrom Ferury 4, 2008 Soures: This leture loosely follows Cover n Thoms Chpter 5 n Yeung Chpter 3. As usul, some of the text n equtions re tken iretly from those
More informationNON-DETERMINISTIC FSA
Tw o types of non-determinism: NON-DETERMINISTIC FS () Multiple strt-sttes; strt-sttes S Q. The lnguge L(M) ={x:x tkes M from some strt-stte to some finl-stte nd ll of x is proessed}. The string x = is
More informationSystem Validation (IN4387) November 2, 2012, 14:00-17:00
System Vlidtion (IN4387) Novemer 2, 2012, 14:00-17:00 Importnt Notes. The exmintion omprises 5 question in 4 pges. Give omplete explntion nd do not onfine yourself to giving the finl nswer. Good luk! Exerise
More informationLecture 3: Equivalence Relations
Mthcmp Crsh Course Instructor: Pdric Brtlett Lecture 3: Equivlence Reltions Week 1 Mthcmp 2014 In our lst three tlks of this clss, we shift the focus of our tlks from proof techniques to proof concepts
More informationIntroduction to Olympiad Inequalities
Introdution to Olympid Inequlities Edutionl Studies Progrm HSSP Msshusetts Institute of Tehnology Snj Simonovikj Spring 207 Contents Wrm up nd Am-Gm inequlity 2. Elementry inequlities......................
More informationCS241 Week 6 Tutorial Solutions
241 Week 6 Tutoril olutions Lnguges: nning & ontext-free Grmmrs Winter 2018 1 nning Exerises 1. 0x0x0xd HEXINT 0x0 I x0xd 2. 0xend--- HEXINT 0xe I nd ER -- MINU - 3. 1234-120x INT 1234 INT -120 I x 4.
More informationExercise sheet 6: Solutions
Eerise sheet 6: Solutions Cvet emptor: These re merel etended hints, rther thn omplete solutions. 1. If grph G hs hromti numer k > 1, prove tht its verte set n e prtitioned into two nonempt sets V 1 nd
More informationDesigning Information Devices and Systems I Spring 2018 Homework 7
EECS 16A Designing Informtion Devices nd Systems I Spring 2018 omework 7 This homework is due Mrch 12, 2018, t 23:59. Self-grdes re due Mrch 15, 2018, t 23:59. Sumission Formt Your homework sumission should
More informationCS 491G Combinatorial Optimization Lecture Notes
CS 491G Comintoril Optimiztion Leture Notes Dvi Owen July 30, August 1 1 Mthings Figure 1: two possile mthings in simple grph. Definition 1 Given grph G = V, E, mthing is olletion of eges M suh tht e i,
More informationAVL Trees. D Oisín Kidney. August 2, 2018
AVL Trees D Oisín Kidne August 2, 2018 Astrt This is verified implementtion of AVL trees in Agd, tking ides primril from Conor MBride s pper How to Keep Your Neighours in Order [2] nd the Agd stndrd lirr
More informationMatrices SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics (c) 1. Definition of a Matrix
tries Definition of tri mtri is regulr rry of numers enlosed inside rkets SCHOOL OF ENGINEERING & UIL ENVIRONEN Emple he following re ll mtries: ), ) 9, themtis ), d) tries Definition of tri Size of tri
More informationThe University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER MACHINES AND THEIR LANGUAGES ANSWERS
The University of ottinghm SCHOOL OF COMPUTR SCIC A LVL 2 MODUL, SPRIG SMSTR 2015 2016 MACHIS AD THIR LAGUAGS ASWRS Time llowed TWO hours Cndidtes my omplete the front over of their nswer ook nd sign their
More informationFast index for approximate string matching
Fst index for pproximte string mthing Dekel Tsur Astrt We present n index tht stores text of length n suh tht given pttern of length m, ll the sustrings of the text tht re within Hmming distne (or edit
More informationAlgorithm Design and Analysis
Algorithm Design nd Anlysis LECTURE 5 Supplement Greedy Algorithms Cont d Minimizing lteness Ching (NOT overed in leture) Adm Smith 9/8/10 A. Smith; sed on slides y E. Demine, C. Leiserson, S. Rskhodnikov,
More informationTutorial Worksheet. 1. Find all solutions to the linear system by following the given steps. x + 2y + 3z = 2 2x + 3y + z = 4.
Mth 5 Tutoril Week 1 - Jnury 1 1 Nme Setion Tutoril Worksheet 1. Find ll solutions to the liner system by following the given steps x + y + z = x + y + z = 4. y + z = Step 1. Write down the rgumented mtrix
More informationCS 275 Automata and Formal Language Theory
CS 275 utomt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Prolem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) nton Setzer (Bsed on ook drft y J. V. Tucker nd K. Stephenson)
More information(a) A partition P of [a, b] is a finite subset of [a, b] containing a and b. If Q is another partition and P Q, then Q is a refinement of P.
Chpter 7: The Riemnn Integrl When the derivtive is introdued, it is not hrd to see tht the it of the differene quotient should be equl to the slope of the tngent line, or when the horizontl xis is time
More information, g. Exercise 1. Generator polynomials of a convolutional code, given in binary form, are g. Solution 1.
Exerise Genertor polynomils of onvolutionl ode, given in binry form, re g, g j g. ) Sketh the enoding iruit. b) Sketh the stte digrm. ) Find the trnsfer funtion T. d) Wht is the minimum free distne of
More informationSpacetime and the Quantum World Questions Fall 2010
Spetime nd the Quntum World Questions Fll 2010 1. Cliker Questions from Clss: (1) In toss of two die, wht is the proility tht the sum of the outomes is 6? () P (x 1 + x 2 = 6) = 1 36 - out 3% () P (x 1
More informationPYTHAGORAS THEOREM WHAT S IN CHAPTER 1? IN THIS CHAPTER YOU WILL:
PYTHAGORAS THEOREM 1 WHAT S IN CHAPTER 1? 1 01 Squres, squre roots nd surds 1 02 Pythgors theorem 1 03 Finding the hypotenuse 1 04 Finding shorter side 1 05 Mixed prolems 1 06 Testing for right-ngled tringles
More informationAlgorithm Design and Analysis
Algorithm Design nd Anlysis LECTURE 8 Mx. lteness ont d Optiml Ching Adm Smith 9/12/2008 A. Smith; sed on slides y E. Demine, C. Leiserson, S. Rskhodnikov, K. Wyne Sheduling to Minimizing Lteness Minimizing
More information2.4 Linear Inequalities and Interval Notation
.4 Liner Inequlities nd Intervl Nottion We wnt to solve equtions tht hve n inequlity symol insted of n equl sign. There re four inequlity symols tht we will look t: Less thn , Less thn or
More informationCSE 332. Sorting. Data Abstractions. CSE 332: Data Abstractions. QuickSort Cutoff 1. Where We Are 2. Bounding The MAXIMUM Problem 4
Am Blnk Leture 13 Winter 2016 CSE 332 CSE 332: Dt Astrtions Sorting Dt Astrtions QuikSort Cutoff 1 Where We Are 2 For smll n, the reursion is wste. The onstnts on quik/merge sort re higher thn the ones
More informationDiscrete Structures Lecture 11
Introdution Good morning. In this setion we study funtions. A funtion is mpping from one set to nother set or, perhps, from one set to itself. We study the properties of funtions. A mpping my not e funtion.
More informationGM1 Consolidation Worksheet
Cmridge Essentils Mthemtis Core 8 GM1 Consolidtion Worksheet GM1 Consolidtion Worksheet 1 Clulte the size of eh ngle mrked y letter. Give resons for your nswers. or exmple, ngles on stright line dd up
More informationProbability. b a b. a b 32.
Proility If n event n hppen in '' wys nd fil in '' wys, nd eh of these wys is eqully likely, then proility or the hne, or its hppening is, nd tht of its filing is eg, If in lottery there re prizes nd lnks,
More informationInstructions. An 8.5 x 11 Cheat Sheet may also be used as an aid for this test. MUST be original handwriting.
ID: B CSE 2021 Computer Orgniztion Midterm Test (Fll 2009) Instrutions This is losed ook, 80 minutes exm. The MIPS referene sheet my e used s n id for this test. An 8.5 x 11 Chet Sheet my lso e used s
More informationPart I: Study the theorem statement.
Nme 1 Nme 2 Nme 3 A STUDY OF PYTHAGORAS THEOREM Instrutions: Together in groups of 2 or 3, fill out the following worksheet. You my lift nswers from the reding, or nswer on your own. Turn in one pket for
More informationCS 573 Automata Theory and Formal Languages
Non-determinism Automt Theory nd Forml Lnguges Professor Leslie Lnder Leture # 3 Septemer 6, 2 To hieve our gol, we need the onept of Non-deterministi Finite Automton with -moves (NFA) An NFA is tuple
More informationComputing data with spreadsheets. Enter the following into the corresponding cells: A1: n B1: triangle C1: sqrt
Computing dt with spredsheets Exmple: Computing tringulr numers nd their squre roots. Rell, we showed 1 ` 2 ` `n npn ` 1q{2. Enter the following into the orresponding ells: A1: n B1: tringle C1: sqrt A2:
More informationLecture Notes No. 10
2.6 System Identifition, Estimtion, nd Lerning Leture otes o. Mrh 3, 26 6 Model Struture of Liner ime Invrint Systems 6. Model Struture In representing dynmil system, the first step is to find n pproprite
More informationSuffix Trays and Suffix Trists: Structures for Faster Text Indexing
Suffix Trys nd Suffix Trists: Strutures for Fster Text Indexing Rihrd Cole Tsvi Kopelowitz Moshe Lewenstein rxiv:1311.1762v1 [s.ds] 7 Nov 2013 Astrt Suffix trees nd suffix rrys re two of the most widely
More informationTHE PYTHAGOREAN THEOREM
THE PYTHAGOREAN THEOREM The Pythgoren Theorem is one of the most well-known nd widely used theorems in mthemtis. We will first look t n informl investigtion of the Pythgoren Theorem, nd then pply this
More informationCoalgebra, Lecture 15: Equations for Deterministic Automata
Colger, Lecture 15: Equtions for Deterministic Automt Julin Slmnc (nd Jurrin Rot) Decemer 19, 2016 In this lecture, we will study the concept of equtions for deterministic utomt. The notes re self contined
More informationArrow s Impossibility Theorem
Rep Voting Prdoxes Properties Arrow s Theorem Arrow s Impossiility Theorem Leture 12 Arrow s Impossiility Theorem Leture 12, Slide 1 Rep Voting Prdoxes Properties Arrow s Theorem Leture Overview 1 Rep
More informationMid-Term Examination - Spring 2014 Mathematical Programming with Applications to Economics Total Score: 45; Time: 3 hours
Mi-Term Exmintion - Spring 0 Mthemtil Progrmming with Applitions to Eonomis Totl Sore: 5; Time: hours. Let G = (N, E) e irete grph. Define the inegree of vertex i N s the numer of eges tht re oming into
More informationIntermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4
Intermedite Mth Circles Wednesdy, Novemer 14, 2018 Finite Automt II Nickols Rollick nrollick@uwterloo.c Regulr Lnguges Lst time, we were introduced to the ide of DFA (deterministic finite utomton), one
More information8 THREE PHASE A.C. CIRCUITS
8 THREE PHSE.. IRUITS The signls in hpter 7 were sinusoidl lternting voltges nd urrents of the so-lled single se type. n emf of suh type n e esily generted y rotting single loop of ondutor (or single winding),
More informationT b a(f) [f ] +. P b a(f) = Conclude that if f is in AC then it is the difference of two monotone absolutely continuous functions.
Rel Vribles, Fll 2014 Problem set 5 Solution suggestions Exerise 1. Let f be bsolutely ontinuous on [, b] Show tht nd T b (f) P b (f) f (x) dx [f ] +. Conlude tht if f is in AC then it is the differene
More information6.5 Improper integrals
Eerpt from "Clulus" 3 AoPS In. www.rtofprolemsolving.om 6.5. IMPROPER INTEGRALS 6.5 Improper integrls As we ve seen, we use the definite integrl R f to ompute the re of the region under the grph of y =
More informationMAT 403 NOTES 4. f + f =
MAT 403 NOTES 4 1. Fundmentl Theorem o Clulus We will proo more generl version o the FTC thn the textook. But just like the textook, we strt with the ollowing proposition. Let R[, ] e the set o Riemnn
More informationFinite State Automata and Determinisation
Finite Stte Automt nd Deterministion Tim Dworn Jnury, 2016 Lnguges fs nf re df Deterministion 2 Outline 1 Lnguges 2 Finite Stte Automt (fs) 3 Non-deterministi Finite Stte Automt (nf) 4 Regulr Expressions
More informationThe Word Problem in Quandles
The Word Prolem in Qundles Benjmin Fish Advisor: Ren Levitt April 5, 2013 1 1 Introdution A word over n lger A is finite sequene of elements of A, prentheses, nd opertions of A defined reursively: Given
More informationTOPIC: LINEAR ALGEBRA MATRICES
Interntionl Blurete LECTUE NOTES for FUTHE MATHEMATICS Dr TOPIC: LINEA ALGEBA MATICES. DEFINITION OF A MATIX MATIX OPEATIONS.. THE DETEMINANT deta THE INVESE A -... SYSTEMS OF LINEA EQUATIONS. 8. THE AUGMENTED
More informationPAIR OF LINEAR EQUATIONS IN TWO VARIABLES
PAIR OF LINEAR EQUATIONS IN TWO VARIABLES. Two liner equtions in the sme two vriles re lled pir of liner equtions in two vriles. The most generl form of pir of liner equtions is x + y + 0 x + y + 0 where,,,,,,
More informationGeneralization of 2-Corner Frequency Source Models Used in SMSIM
Generliztion o 2-Corner Frequeny Soure Models Used in SMSIM Dvid M. Boore 26 Mrh 213, orreted Figure 1 nd 2 legends on 5 April 213, dditionl smll orretions on 29 My 213 Mny o the soure spetr models ville
More informationPart 4. Integration (with Proofs)
Prt 4. Integrtion (with Proofs) 4.1 Definition Definition A prtition P of [, b] is finite set of points {x 0, x 1,..., x n } with = x 0 < x 1
More informationCS 2204 DIGITAL LOGIC & STATE MACHINE DESIGN SPRING 2014
S 224 DIGITAL LOGI & STATE MAHINE DESIGN SPRING 214 DUE : Mrh 27, 214 HOMEWORK III READ : Relte portions of hpters VII n VIII ASSIGNMENT : There re three questions. Solve ll homework n exm prolems s shown
More informationCS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions
CS 330 Forml Methods nd Models Dn Richrds, George Mson University, Spring 2016 Quiz Solutions Quiz 1, Propositionl Logic Dte: Ferury 9 1. (4pts) ((p q) (q r)) (p r), prove tutology using truth tles. p
More informationSymmetrical Components 1
Symmetril Components. Introdution These notes should e red together with Setion. of your text. When performing stedy-stte nlysis of high voltge trnsmission systems, we mke use of the per-phse equivlent
More informationArrow s Impossibility Theorem
Rep Fun Gme Properties Arrow s Theorem Arrow s Impossiility Theorem Leture 12 Arrow s Impossiility Theorem Leture 12, Slide 1 Rep Fun Gme Properties Arrow s Theorem Leture Overview 1 Rep 2 Fun Gme 3 Properties
More informationConnected-components. Summary of lecture 9. Algorithms and Data Structures Disjoint sets. Example: connected components in graphs
Prm University, Mth. Deprtment Summry of lecture 9 Algorithms nd Dt Structures Disjoint sets Summry of this lecture: (CLR.1-3) Dt Structures for Disjoint sets: Union opertion Find opertion Mrco Pellegrini
More informationNondeterministic Finite Automata
Nondeterministi Finite utomt The Power of Guessing Tuesdy, Otoer 4, 2 Reding: Sipser.2 (first prt); Stoughton 3.3 3.5 S235 Lnguges nd utomt eprtment of omputer Siene Wellesley ollege Finite utomton (F)
More informationGreen s Theorem. (2x e y ) da. (2x e y ) dx dy. x 2 xe y. (1 e y ) dy. y=1. = y e y. y=0. = 2 e
Green s Theorem. Let be the boundry of the unit squre, y, oriented ounterlokwise, nd let F be the vetor field F, y e y +, 2 y. Find F d r. Solution. Let s write P, y e y + nd Q, y 2 y, so tht F P, Q. Let
More informationChapter 8 Roots and Radicals
Chpter 8 Roots nd Rdils 7 ROOTS AND RADICALS 8 Figure 8. Grphene is n inredily strong nd flexile mteril mde from ron. It n lso ondut eletriity. Notie the hexgonl grid pttern. (redit: AlexnderAIUS / Wikimedi
More informationCS311 Computational Structures Regular Languages and Regular Grammars. Lecture 6
CS311 Computtionl Strutures Regulr Lnguges nd Regulr Grmmrs Leture 6 1 Wht we know so fr: RLs re losed under produt, union nd * Every RL n e written s RE, nd every RE represents RL Every RL n e reognized
More informationPolynomials. Polynomials. Curriculum Ready ACMNA:
Polynomils Polynomils Curriulum Redy ACMNA: 66 www.mthletis.om Polynomils POLYNOMIALS A polynomil is mthemtil expression with one vrile whose powers re neither negtive nor frtions. The power in eh expression
More informationActivities. 4.1 Pythagoras' Theorem 4.2 Spirals 4.3 Clinometers 4.4 Radar 4.5 Posting Parcels 4.6 Interlocking Pipes 4.7 Sine Rule Notes and Solutions
MEP: Demonstrtion Projet UNIT 4: Trigonometry UNIT 4 Trigonometry tivities tivities 4. Pythgors' Theorem 4.2 Spirls 4.3 linometers 4.4 Rdr 4.5 Posting Prels 4.6 Interloking Pipes 4.7 Sine Rule Notes nd
More informationAlgebra Basics. Algebra Basics. Curriculum Ready ACMNA: 133, 175, 176, 177, 179.
Curriulum Redy ACMNA: 33 75 76 77 79 www.mthletis.om Fill in the spes with nything you lredy know out Alger Creer Opportunities: Arhitets eletriins plumers et. use it to do importnt lultions. Give this
More informationILLUSTRATING THE EXTENSION OF A SPECIAL PROPERTY OF CUBIC POLYNOMIALS TO NTH DEGREE POLYNOMIALS
ILLUSTRATING THE EXTENSION OF A SPECIAL PROPERTY OF CUBIC POLYNOMIALS TO NTH DEGREE POLYNOMIALS Dvid Miller West Virgini University P.O. BOX 6310 30 Armstrong Hll Morgntown, WV 6506 millerd@mth.wvu.edu
More informationNumbers and indices. 1.1 Fractions. GCSE C Example 1. Handy hint. Key point
GCSE C Emple 7 Work out 9 Give your nswer in its simplest form Numers n inies Reiprote mens invert or turn upsie own The reiprol of is 9 9 Mke sure you only invert the frtion you re iviing y 7 You multiply
More informationfor all x in [a,b], then the area of the region bounded by the graphs of f and g and the vertical lines x = a and x = b is b [ ( ) ( )] A= f x g x dx
Applitions of Integrtion Are of Region Between Two Curves Ojetive: Fin the re of region etween two urves using integrtion. Fin the re of region etween interseting urves using integrtion. Desrie integrtion
More informationTrigonometry Revision Sheet Q5 of Paper 2
Trigonometry Revision Sheet Q of Pper The Bsis - The Trigonometry setion is ll out tringles. We will normlly e given some of the sides or ngles of tringle nd we use formule nd rules to find the others.
More informationLecture 08: Feb. 08, 2019
4CS4-6:Theory of Computtion(Closure on Reg. Lngs., regex to NDFA, DFA to regex) Prof. K.R. Chowdhry Lecture 08: Fe. 08, 2019 : Professor of CS Disclimer: These notes hve not een sujected to the usul scrutiny
More informationParse trees, ambiguity, and Chomsky normal form
Prse trees, miguity, nd Chomsky norml form In this lecture we will discuss few importnt notions connected with contextfree grmmrs, including prse trees, miguity, nd specil form for context-free grmmrs
More informationExpand the Shares Together: Envy-free Mechanisms with a Small Number of Cuts
Nonme mnusript No. (will e inserted y the editor) Expnd the Shres Together: Envy-free Mehnisms with Smll Numer of uts Msoud Seddighin Mjid Frhdi Mohmmd Ghodsi Rez Alijni Ahmd S. Tjik Reeived: dte / Aepted:
More informationTorsion in Groups of Integral Triangles
Advnces in Pure Mthemtics, 01,, 116-10 http://dxdoiorg/1046/pm011015 Pulished Online Jnury 01 (http://wwwscirporg/journl/pm) Torsion in Groups of Integrl Tringles Will Murry Deprtment of Mthemtics nd Sttistics,
More informationLesson 2: The Pythagorean Theorem and Similar Triangles. A Brief Review of the Pythagorean Theorem.
27 Lesson 2: The Pythgoren Theorem nd Similr Tringles A Brief Review of the Pythgoren Theorem. Rell tht n ngle whih mesures 90º is lled right ngle. If one of the ngles of tringle is right ngle, then we
More informationFarey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University
U.U.D.M. Project Report 07:4 Frey Frctions Rickrd Fernström Exmensrete i mtemtik, 5 hp Hledre: Andres Strömergsson Exmintor: Jörgen Östensson Juni 07 Deprtment of Mthemtics Uppsl University Frey Frctions
More informationwhere the box contains a finite number of gates from the given collection. Examples of gates that are commonly used are the following: a b
CS 294-2 9/11/04 Quntum Ciruit Model, Solovy-Kitev Theorem, BQP Fll 2004 Leture 4 1 Quntum Ciruit Model 1.1 Clssil Ciruits - Universl Gte Sets A lssil iruit implements multi-output oolen funtion f : {0,1}
More informationAssignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages
Deprtment of Computer Science, Austrlin Ntionl University COMP2600 Forml Methods for Softwre Engineering Semester 2, 206 Assignment Automt, Lnguges, nd Computility Smple Solutions Finite Stte Automt nd
More informationLecture 3. XML Into RDBMS. XML and Databases. Memory Representations. Memory Representations. Traversals and Pre/Post-Encoding. Memory Representations
Leture XML into RDBMS XML n Dtses Sestin Mneth NICTA n UNSW Leture XML Into RDBMS CSE@UNSW -- Semester, 00 Memory Representtions Memory Representtions Fts DOM is esy to use, ut memory hevy. in-memory size
More informationExercise 3 Logic Control
Exerise 3 Logi Control OBJECTIVE The ojetive of this exerise is giving n introdution to pplition of Logi Control System (LCS). Tody, LCS is implemented through Progrmmle Logi Controller (PLC) whih is lled
More informationThe Regulated and Riemann Integrals
Chpter 1 The Regulted nd Riemnn Integrls 1.1 Introduction We will consider severl different pproches to defining the definite integrl f(x) dx of function f(x). These definitions will ll ssign the sme vlue
More informationMATH FIELD DAY Contestants Insructions Team Essay. 1. Your team has forty minutes to answer this set of questions.
MATH FIELD DAY 2012 Contestnts Insructions Tem Essy 1. Your tem hs forty minutes to nswer this set of questions. 2. All nswers must be justified with complete explntions. Your nswers should be cler, grmmticlly
More informationSection 6: Area, Volume, and Average Value
Chpter The Integrl Applied Clculus Section 6: Are, Volume, nd Averge Vlue Are We hve lredy used integrls to find the re etween the grph of function nd the horizontl xis. Integrls cn lso e used to find
More information