22: Union Find. CS 473u - Algorithms - Spring April 14, We want to maintain a collection of sets, under the operations of:

Size: px
Start display at page:

Download "22: Union Find. CS 473u - Algorithms - Spring April 14, We want to maintain a collection of sets, under the operations of:"

Transcription

1 22: Union Fin CS 473u - Algorithms - Spring 2005 April 14, 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) - return the set tht ontins x. 3. Union(A,B) - return the set whih is the union of A n B. Nmely A B. Nmely, this opertion merges the two sets A n B n return the merge set. 1.1 Amortize nlysis We use t-struture s lk-ox insie n lgorithm (for exmple Union-Fin in Kruskl lgorithm for omputing minimum spnning tee). So fr, when we esign tstruture we re out worst se time for opertion. Note however, tht this is not neessrily the right mesure. Inee, we re out the overll running time spen on oing opertions in the t-struture, n less out its running time for single opertion. Formlly, the mortize running time of n opertion is the verge time it tkes to perform n opertion on the t-struture. Formlly, the mortize time of n opertion is overll running time numer of opertions. k f g h e i j Figure 1: The Union-Fin representtion of the sets A = {,,,, e} n B = {f, g, h, i, j, k}. The set A is uniquely ientifie y pointer to the root of A, whih is the noe ontining. 1

2 1.2 The t-struture To implement this opertions, we re going to use Reverse Trees. In reverse tree, every element is store in its own noe. A noe hs one pointer to its prent. A set is uniquely ientifie with the element store in the root of suh reverse tree. See Figure 1 for n exmple of how suh reverse tree looks like. We implement the opertions of the Union-Fin t struture s follows: 1. MkeSet: Crete singleton pointing to itself: 2. Fin(x): We strt from the noe tht ontins x, n we strt trversing up the tree, following the prent pointer of the urrent noe, till we get to the root, whih is just noe with its prent pointer pointing to itself. Thus, oing Fin(x) in the following reverse: Involve going up the tree from x, n returning s the set. 3. Union(, p): We merge two sets, y hnging the root of one tree, on the root of the other. Note, tht this is estrutive opertion, n the two originl sets no longer exist. x Note, tht in the worst se, epth of tree n e liner, so serh time is Ω(n) (serh time=length of pth to the root). This is. To see why this is true, imgine reting n sets of size 1, n repetely merging the urrent set with singleton. If we lwys merge (i.e., o Union) the urrent set with singleton y hnging the urrent set on the singleton, the en result woul e reverse tree whih looks like linke list of length n. Doing Fin on the eepest element, woul tke liner time. So, the question is how to further improve the performne of this t-struture. We re going to o this, y using two hks: 2

3 x x y z y z () () Figure 2: () The tree efore performing Fin(x), n () The reverse tree fter performing Fin(x) tht uses pth ompression. MkeSet(x) prent(x) x rnk(x) 0 Fin(x) if x prent(x) then prent(x) Fin(prent(x)) return prent(x) Union(x, y ) A Fin(x) B Fin(y) if rnk(a) rnk(b) then prent(b) A else prent(a) B If (rnk(a) = rnk(b)) then rnk(b) rnk(b) + 1 Figure 3: The pseuo-oe for the Union-Fin t-struture tht uses oth pthompression n union y rnk. Union y rnk Mintin for every tree, in the root, oun on its epth (lle rnk). Alwys hng the smller tree on the lrger tree. Pth Compression Sine, nywy, we trvel the pth to the root uring fin opertion, we might s well hung ll the noes on the pth iretly on the root. An exmple of the effets of pth ompression re epite in Figure 2. For the pseuooe of the MkeSet, Union n Fin using pth ompression n union y rnk, see Figure 3. 2 Anlyzing the Union-Fin Dt-Struture Definition 2.1 A noe in the Union-Fin t-struture is leer if it is the root of (reverse) tree. Lemm 2.2 One noe stop eing leer (i.e., the noe in top of tree), it n never eome leer gin. 3

4 Proof: Note, tht n element x n stop eing leer only euse of Union opertion tht hnge x on n element y. From this point on, the only opertion tht might hnge x prent pointer, is Fin opertion tht trverses through x. Sine pth-ompression n only hnge the prent pointer of x to point to some other element y, it follows tht x prent pointer will never eome equl to x gin. Nmely, one x stop eing leer, it n never e leer gin. Lemm 2.3 One noe stop eing leer thn its rnk is fixe. Proof: The rnk of n element hnges only y the Union opertion. However, the Union opertion hnges the rnk, only for elements tht re leer fter the opertion is one. As suh, if n element is no longer leer, thn its rnk is fixe. Lemm 2.4 Rnks re monotonilly inresing in the reverse trees, s we trvel from noe to the root of the tree. Proof: It is enough to prove, tht for every ege u v in the t-struture, we hve rnk(u) < rnk(v). The proof is y inution. Inee, in the eginning of time, ll sets re singletons, with rnk zero, n the lim trivilly hols. Next, ssume tht the lim hols t time t, just efore we perform n opertion. Clerly, if this opertion is Union(A, B), n ssume tht we hnge root(a) on root(b). In this se, it must e tht rnk(root(b)) is now lrger thn rnk(root(a)), s n e esily verifie. As suh, if the lim hel efore the Union opertion, then it is lso true fter it ws performe. If the opertion is Fin, n we trverse the pth π, then ll the noes of π re me to point to the lst noe v of π. However, y inution, rnk(v) is lrger thn the rnk of ll the other noes of π. In prtiulr, ll the noes tht get ompresse, the rnk of their new prent, is lrger thn their own rnk. Lemm 2.5 When noe gets rnk k thn there re t lest 2 k elements in its sutree. Proof: The proof is y inution. For k = 0 it is ovious. Next oserve tht noe gets rnk k only if the merge two roots hs rnk k 1. By inution, they hve 2 k 1 noes (eh one of them), n thus the merge tree hs 2 k k 1 = 2 k noes. Lemm 2.6 The numer of noes tht get ssigne rnk k throughout the exeution of the Union-Fin t-struture is t most n/2 k. Proof: Agin, y inution. For k = 0 it is ovious. We hrge noe v of rnk k to the two elements of rnk k 1 tht were leers tht were use to rete it one of them is v hving egree k 1, the other one is some other noe u. After the merge v is of rnk k n u is of rnk k 1 n it is no longer leer (it n not prtiipte in union s leer ny more). Thus, we n hrge this event to the two (no longer tive) noes of egree k 1. Nmely, u n v. By inution, we hve n/2 k 1 suh noes, n thus ( n/2 k 1) /2 = n/2 k suh noes of egree k. Lemm 2.7 The time to perform single Fin opertion when we perform union y rnk n pth ompression is O(log n) time. 4

5 Proof: The rnk of the leer v of reverse tree T, ouns the epth of tree T in the Union-Fin t-struture. By the ove lemm, if we hve n elements, the mximum rnk is lg n n thus the epth of tree is t most O(log n). The min result we wnt to show, is the following. Theorem 2.8 If we perform sequene of m opertions over n elements, the overll running time of the Union-Fin t-struture is O((n + m) log n). We remin the reer tht log (n) is the numer one hs to tke lg of numer to get numer smller thn two (there re other efinitions, ut they re ll equivlent, up to ing smll onstnt). Thus, log 2 = 1 n log 2 2 = 2. Similrly, log 2 22 = 1 + log (2 2 ) = 2 + log 2 = 3. Similrly, log = log (65536) = 4. Things get relly exiting, when one onsiers log = log = 5. However, log 2 is monotone inresing funtion. An β = = is huge numer (onsierly lrger thn the numer of toms in the universe). Thus, for ll prtil purposes, log returns vlue whih is smller thn 5. So Theorem 2.8 essentilly sttes in the mortize sense, Union-Fin tkes onstnt time per opertion (unless n is lrger thn β whih is extremely unlikely). It woul e useful to look on the inverse funtion to log. Definition 2.9 Tower() = 2 T ower( 1) n Tower(0) = 1. So, Tower(i) is just tower of of height i. Definition 2.10 Blok(i) ] = [T ower(i 1) + 1, T ower(i)] Blok(i) = [z, 2 z 1 for z = T ower(i 1) + 1. Oservtion 2.11 The running time of Fin(x) is proportionl to the length of the pth from x to the root of the tree tht ontins x. Inee, we strt from x n we visit the sequene: x 1 = x, x 2 = prent(x) = prent(x 1 ),..., x i = prent(x i 1 ),...,x m = root Clerly, we hve for this sequene: rnk(x 1 ) < rnk(x 2 ) < rnk(x 3 ) <... < rnk(x m ). Note, tht the time to perform fin, is proportionl to m. Definition 2.12 A noe x is in the i-th lok if rnk(x) Blok(i). We re now looking for wys to py for the fin opertion. Oservtion 2.13 The rnk of noe v is O(log n), n the numer of loks is O(log n). 5

6 Oservtion 2.14 During fin opertion, sine the rnks of the noes we visit re monotone inresing, one we pss through from noe v in the i-th lok into noe in the (i + 1)-th lok, we n never go k to the i-th lok (i.e., visit elements with rnk in the i-th lok). Lemm 2.15 During Fin opertion, the numer of jumps etween loks is O(log n). Oservtion 2.16 If x n prent(x) re in the sme lok n we perform fin opertion tht psses through x. Let r efore = rnk(prent(x)) efore the fin opertion, n let r fter e rnk(prent(x)) fter the Fin opertion. Then euse of pth ompression, we hve r fter > r efore. Nmely, when we jump insie lok, we o some work: we mke the prent pointer jump forwr. Definition 2.17 A jump uring fin opertion insie the i-th lok is lle n internl jump. Lemm 2.18 At most Blok(i) T ower(i) fin opertions n pss through n element x whih is in the i-th lok (i.e., rnk(x) Blok(i)) efore prent(x) is no longer in the i-th lok. Lemm 2.19 There re t most n/t ower(i) noes tht hve rnks in the i-th lok throughout the lgorithm exeution. Proof: Clerly, T ower(i) i=t ower(i 1)+1 n 2 i = n T ower(i) i=t ower(i 1) i n 2 T ower(i 1) = n T ower(i). Lemm 2.20 The numer of inner lok jumps performe insie the i-th lok performe uring the lifetime of the union-fin t-struture is O(n). 6

7 Proof: An element x in the i-th lok, n hve Blok(i) jumps. There re n/t ower(i) suh elements. Thus, the totl numer of internl jumps is Blok(i) n T ower(i) T ower(i) n T ower(i) = n. We re now rey for the lst step: Lemm 2.21 The numer of internl jumps performe y the Union-Fin t-struture overll is O(n log n). Proof: Every internl jump n e ssoite with the lok it is eing performe in. Every lok ontriutes O(n) internl jumps throughout the exeution of the union-fin tstrutures. There re O(log n) loks. As suh there re t most O(n log n) internl jumps. Lemm 2.22 The overll time spent on m Fin opertions is O((m + n) log n). Theorem 2.8 now follows reily from the ove isussion. 7

Lecture 6: Coding theory

Lecture 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 information

CS 491G Combinatorial Optimization Lecture Notes

CS 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 information

Connected-components. Summary of lecture 9. Algorithms and Data Structures Disjoint sets. Example: connected components in graphs

Connected-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 information

Mid-Term Examination - Spring 2014 Mathematical Programming with Applications to Economics Total Score: 45; Time: 3 hours

Mid-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 information

Counting Paths Between Vertices. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs

Counting 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 information

Welcome. Balanced search trees. Balanced Search Trees. Inge Li Gørtz

Welcome. 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 information

Algorithms & Data Structures Homework 8 HS 18 Exercise Class (Room & TA): Submitted by: Peer Feedback by: Points:

Algorithms & Data Structures Homework 8 HS 18 Exercise Class (Room & TA): Submitted by: Peer Feedback by: Points: 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

More information

Data Structures LECTURE 10. Huffman coding. Example. Coding: problem definition

Data Structures LECTURE 10. Huffman coding. Example. Coding: problem definition Dt Strutures, Spring 24 L. Joskowiz Dt Strutures LEURE Humn oing Motivtion Uniquel eipherle oes Prei oes Humn oe onstrution Etensions n pplitions hpter 6.3 pp 385 392 in tetook Motivtion Suppose we wnt

More information

Project 6: Minigoals Towards Simplifying and Rewriting Expressions

Project 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 information

CS 2204 DIGITAL LOGIC & STATE MACHINE DESIGN SPRING 2014

CS 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 information

1 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. 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 information

for 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

for 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 information

Solutions for HW9. Bipartite: put the red vertices in V 1 and the black in V 2. Not bipartite!

Solutions 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 information

Global alignment. Genome Rearrangements Finding preserved genes. Lecture 18

Global 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 information

CS311 Computational Structures Regular Languages and Regular Grammars. Lecture 6

CS311 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 information

Lecture 2: Cayley Graphs

Lecture 2: Cayley Graphs Mth 137B Professor: Pri Brtlett Leture 2: Cyley Grphs Week 3 UCSB 2014 (Relevnt soure mteril: Setion VIII.1 of Bollos s Moern Grph Theory; 3.7 of Gosil n Royle s Algeri Grph Theory; vrious ppers I ve re

More information

Spacetime and the Quantum World Questions Fall 2010

Spacetime 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 information

CS 360 Exam 2 Fall 2014 Name

CS 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 information

Lecture 3. XML Into RDBMS. XML and Databases. Memory Representations. Memory Representations. Traversals and Pre/Post-Encoding. Memory Representations

Lecture 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 information

NON-DETERMINISTIC FSA

NON-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 information

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations.

Lecture 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 information

CIT 596 Theory of Computation 1. Graphs and Digraphs

CIT 596 Theory of Computation 1. Graphs and Digraphs CIT 596 Theory of Computtion 1 A grph G = (V (G), E(G)) onsists of two finite sets: V (G), the vertex set of the grph, often enote y just V, whih is nonempty set of elements lle verties, n E(G), the ege

More information

CSE 332. Sorting. Data Abstractions. CSE 332: Data Abstractions. QuickSort Cutoff 1. Where We Are 2. Bounding The MAXIMUM Problem 4

CSE 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 information

where the box contains a finite number of gates from the given collection. Examples of gates that are commonly used are the following: a b

where 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 information

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Intermediate 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 information

p-adic Egyptian Fractions

p-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 information

Implication Graphs and Logic Testing

Implication Graphs and Logic Testing Implition Grphs n Logi Testing Vishwni D. Agrwl Jmes J. Dnher Professor Dept. of ECE, Auurn University Auurn, AL 36849 vgrwl@eng.uurn.eu www.eng.uurn.eu/~vgrwl Joint reserh with: K. K. Dve, ATI Reserh,

More information

Surds and Indices. Surds and Indices. Curriculum Ready ACMNA: 233,

Surds and Indices. Surds and Indices. Curriculum Ready ACMNA: 233, Surs n Inies Surs n Inies Curriulum Rey ACMNA:, 6 www.mthletis.om Surs SURDS & & Inies INDICES Inies n surs re very losely relte. A numer uner (squre root sign) is lle sur if the squre root n t e simplifie.

More information

T 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.

T 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 information

Tutorial Worksheet. 1. Find all solutions to the linear system by following the given steps. x + 2y + 3z = 2 2x + 3y + z = 4.

Tutorial 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 information

CISC 320 Introduction to Algorithms Spring 2014

CISC 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 information

1 From NFA to regular expression

1 From NFA to regular expression Note 1: How to convert DFA/NFA to regulr expression Version: 1.0 S/EE 374, Fll 2017 Septemer 11, 2017 In this note, we show tht ny DFA cn e converted into regulr expression. Our construction would work

More information

Now we must transform the original model so we can use the new parameters. = S max. Recruits

Now we must transform the original model so we can use the new parameters. = S max. Recruits MODEL FOR VARIABLE RECRUITMENT (ontinue) Alterntive Prmeteriztions of the pwner-reruit Moels We n write ny moel in numerous ifferent ut equivlent forms. Uner ertin irumstnes it is onvenient to work with

More information

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3

I1 = 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 information

Factorising FACTORISING.

Factorising FACTORISING. Ftorising FACTORISING www.mthletis.om.u Ftorising FACTORISING Ftorising is the opposite of expning. It is the proess of putting expressions into rkets rther thn expning them out. In this setion you will

More information

CS 275 Automata and Formal Language Theory

CS 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

2.4 Theoretical Foundations

2.4 Theoretical Foundations 2 Progrmming Lnguge Syntx 2.4 Theoretil Fountions As note in the min text, snners n prsers re se on the finite utomt n pushown utomt tht form the ottom two levels of the Chomsky lnguge hierrhy. At eh level

More information

Solutions to Problem Set #1

Solutions to Problem Set #1 CSE 233 Spring, 2016 Solutions to Prolem Set #1 1. The movie tse onsists of the following two reltions movie: title, iretor, tor sheule: theter, title The first reltion provies titles, iretors, n tors

More information

Eigenvectors and Eigenvalues

Eigenvectors and Eigenvalues MTB 050 1 ORIGIN 1 Eigenvets n Eigenvlues This wksheet esries the lger use to lulte "prinipl" "hrteristi" iretions lle Eigenvets n the "prinipl" "hrteristi" vlues lle Eigenvlues ssoite with these iretions.

More information

Bases for Vector Spaces

Bases for Vector Spaces Bses for Vector Spces 2-26-25 A set is independent if, roughly speking, there is no redundncy in the set: You cn t uild ny vector in the set s liner comintion of the others A set spns if you cn uild everything

More information

Section 6: Area, Volume, and Average Value

Section 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

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9. Regulr Expressions, Pumping Lemm, Right Liner Grmmrs Ling 106 Mrch 25, 2002 1 Regulr Expressions A regulr expression descries or genertes lnguge: it is kind of shorthnd for listing the memers of lnguge.

More information

18.06 Problem Set 4 Due Wednesday, Oct. 11, 2006 at 4:00 p.m. in 2-106

18.06 Problem Set 4 Due Wednesday, Oct. 11, 2006 at 4:00 p.m. in 2-106 8. Problem Set Due Wenesy, Ot., t : p.m. in - Problem Mony / Consier the eight vetors 5, 5, 5,..., () List ll of the one-element, linerly epenent sets forme from these. (b) Wht re the two-element, linerly

More information

Chapter 4 State-Space Planning

Chapter 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 information

Comparing the Pre-image and Image of a Dilation

Comparing the Pre-image and Image of a Dilation hpter Summry Key Terms Postultes nd Theorems similr tringles (.1) inluded ngle (.2) inluded side (.2) geometri men (.) indiret mesurement (.6) ngle-ngle Similrity Theorem (.2) Side-Side-Side Similrity

More information

Infinite Geometric Series

Infinite Geometric Series Infinite Geometric Series Finite Geometric Series ( finite SUM) Let 0 < r < 1, nd let n be positive integer. Consider the finite sum It turns out there is simple lgebric expression tht is equivlent to

More information

Lecture 09: Myhill-Nerode Theorem

Lecture 09: Myhill-Nerode Theorem CS 373: Theory of Computtion Mdhusudn Prthsrthy Lecture 09: Myhill-Nerode Theorem 16 Ferury 2010 In this lecture, we will see tht every lnguge hs unique miniml DFA We will see this fct from two perspectives

More information

Arrow s Impossibility Theorem

Arrow 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 information

Numbers and indices. 1.1 Fractions. GCSE C Example 1. Handy hint. Key point

Numbers 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 information

Algorithm Design and Analysis

Algorithm 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 information

First Midterm Examination

First Midterm Examination 24-25 Fll Semester First Midterm Exmintion ) Give the stte digrm of DFA tht recognizes the lnguge A over lphet Σ = {, } where A = {w w contins or } 2) The following DFA recognizes the lnguge B over lphet

More information

Section 2.3. Matrix Inverses

Section 2.3. Matrix Inverses Mtri lger Mtri nverses Setion.. Mtri nverses hree si opertions on mtries, ition, multiplition, n sutrtion, re nlogues for mtries of the sme opertions for numers. n this setion we introue the mtri nlogue

More information

I 3 2 = I I 4 = 2A

I 3 2 = I I 4 = 2A ECE 210 Eletril Ciruit Anlysis University of llinois t Chigo 2.13 We re ske to use KCL to fin urrents 1 4. The key point in pplying KCL in this prolem is to strt with noe where only one of the urrents

More information

Electromagnetism Notes, NYU Spring 2018

Electromagnetism Notes, NYU Spring 2018 Eletromgnetism Notes, NYU Spring 208 April 2, 208 Ation formultion of EM. Free field desription Let us first onsider the free EM field, i.e. in the bsene of ny hrges or urrents. To tret this s mehnil system

More information

Fast index for approximate string matching

Fast 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 information

Arrow s Impossibility Theorem

Arrow 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 information

Introduction to Olympiad Inequalities

Introduction 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 information

Algorithm Design and Analysis

Algorithm 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 information

MATH 409 Advanced Calculus I Lecture 22: Improper Riemann integrals.

MATH 409 Advanced Calculus I Lecture 22: Improper Riemann integrals. MATH 409 Advned Clulus I Leture 22: Improper Riemnn integrls. Improper Riemnn integrl If funtion f : [,b] R is integrble on [,b], then the funtion F(x) = x f(t)dt is well defined nd ontinuous on [,b].

More information

Lecture 2: January 27

Lecture 2: January 27 CS 684: Algorithmic Gme Theory Spring 217 Lecturer: Év Trdos Lecture 2: Jnury 27 Scrie: Alert Julius Liu 2.1 Logistics Scrie notes must e sumitted within 24 hours of the corresponding lecture for full

More information

A Primer on Continuous-time Economic Dynamics

A Primer on Continuous-time Economic Dynamics Eonomis 205A Fll 2008 K Kletzer A Primer on Continuous-time Eonomi Dnmis A Liner Differentil Eqution Sstems (i) Simplest se We egin with the simple liner first-orer ifferentil eqution The generl solution

More information

Nondeterministic Finite Automata

Nondeterministic 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 information

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.) CS 373, Spring 29. Solutions to Mock midterm (sed on first midterm in CS 273, Fll 28.) Prolem : Short nswer (8 points) The nswers to these prolems should e short nd not complicted. () If n NF M ccepts

More information

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true. York University CSE 2 Unit 3. DFA Clsses Converting etween DFA, NFA, Regulr Expressions, nd Extended Regulr Expressions Instructor: Jeff Edmonds Don t chet y looking t these nswers premturely.. For ech

More information

Lecture 2e Orthogonal Complement (pages )

Lecture 2e Orthogonal Complement (pages ) Lecture 2e Orthogonl Complement (pges -) We hve now seen tht n orthonorml sis is nice wy to descrie suspce, ut knowing tht we wnt n orthonorml sis doesn t mke one fll into our lp. In theory, the process

More information

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique? XII. LINEAR ALGEBRA: SOLVING SYSTEMS OF EQUATIONS Tody we re going to tlk out solving systems of liner equtions. These re prolems tht give couple of equtions with couple of unknowns, like: 6= x + x 7=

More information

Homework Solution - Set 5 Due: Friday 10/03/08

Homework Solution - Set 5 Due: Friday 10/03/08 CE 96 Introduction to the Theory of Computtion ll 2008 Homework olution - et 5 Due: ridy 10/0/08 1. Textook, Pge 86, Exercise 1.21. () 1 2 Add new strt stte nd finl stte. Mke originl finl stte non-finl.

More information

Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 17

Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 17 CS 70 Discrete Mthemtics nd Proility Theory Summer 2014 Jmes Cook Note 17 I.I.D. Rndom Vriles Estimting the is of coin Question: We wnt to estimte the proportion p of Democrts in the US popultion, y tking

More information

1 This diagram represents the energy change that occurs when a d electron in a transition metal ion is excited by visible light.

1 This diagram represents the energy change that occurs when a d electron in a transition metal ion is excited by visible light. 1 This igrm represents the energy hnge tht ours when eletron in trnsition metl ion is exite y visile light. Give the eqution tht reltes the energy hnge ΔE to the Plnk onstnt, h, n the frequeny, v, of the

More information

Outline Data Structures and Algorithms. Data compression. Data compression. Lossy vs. Lossless. Data Compression

Outline Data Structures and Algorithms. Data compression. Data compression. Lossy vs. Lossless. Data Compression 5-2 Dt Strutures n Algorithms Dt Compression n Huffmn s Algorithm th Fe 2003 Rjshekr Rey Outline Dt ompression Lossy n lossless Exmples Forml view Coes Definition Fixe length vs. vrile length Huffmn s

More information

Minimal DFA. minimal DFA for L starting from any other

Minimal DFA. minimal DFA for L starting from any other Miniml DFA Among the mny DFAs ccepting the sme regulr lnguge L, there is exctly one (up to renming of sttes) which hs the smllest possile numer of sttes. Moreover, it is possile to otin tht miniml DFA

More information

6.5 Improper integrals

6.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 information

Compression of Palindromes and Regularity.

Compression of Palindromes and Regularity. Compression of Plinromes n Regulrity. Kyoko Shikishim-Tsuji Center for Lierl Arts Eution n Reserh Tenri University 1 Introution In [1], property of likstrem t t view of tse is isusse n it is shown tht

More information

Necessary and sucient conditions for some two. Abstract. Further we show that the necessary conditions for the existence of an OD(44 s 1 s 2 )

Necessary and sucient conditions for some two. Abstract. Further we show that the necessary conditions for the existence of an OD(44 s 1 s 2 ) Neessry n suient onitions for some two vrile orthogonl esigns in orer 44 C. Koukouvinos, M. Mitrouli y, n Jennifer Seerry z Deite to Professor Anne Penfol Street Astrt We give new lgorithm whih llows us

More information

CS 573 Automata Theory and Formal Languages

CS 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 information

MAT 403 NOTES 4. f + f =

MAT 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 information

Convert the NFA into DFA

Convert the NFA into DFA Convert the NF into F For ech NF we cn find F ccepting the sme lnguge. The numer of sttes of the F could e exponentil in the numer of sttes of the NF, ut in prctice this worst cse occurs rrely. lgorithm:

More information

Lecture 08: Feb. 08, 2019

Lecture 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 information

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies Stte spce systems nlysis (continued) Stbility A. Definitions A system is sid to be Asymptoticlly Stble (AS) when it stisfies ut () = 0, t > 0 lim xt () 0. t A system is AS if nd only if the impulse response

More information

Designing Information Devices and Systems I Discussion 8B

Designing Information Devices and Systems I Discussion 8B Lst Updted: 2018-10-17 19:40 1 EECS 16A Fll 2018 Designing Informtion Devices nd Systems I Discussion 8B 1. Why Bother With Thévenin Anywy? () Find Thévenin eqiuvlent for the circuit shown elow. 2kΩ 5V

More information

Discrete Mathematics and Probability Theory Spring 2013 Anant Sahai Lecture 17

Discrete Mathematics and Probability Theory Spring 2013 Anant Sahai Lecture 17 EECS 70 Discrete Mthemtics nd Proility Theory Spring 2013 Annt Shi Lecture 17 I.I.D. Rndom Vriles Estimting the is of coin Question: We wnt to estimte the proportion p of Democrts in the US popultion,

More information

Lesson 2.1 Inductive Reasoning

Lesson 2.1 Inductive Reasoning Lesson 2.1 Inutive Resoning Nme Perio Dte For Eerises 1 7, use inutive resoning to fin the net two terms in eh sequene. 1. 4, 8, 12, 16,, 2. 400, 200, 100, 50, 25,, 3. 1 8, 2 7, 1 2, 4, 5, 4. 5, 3, 2,

More information

On a Class of Planar Graphs with Straight-Line Grid Drawings on Linear Area

On a Class of Planar Graphs with Straight-Line Grid Drawings on Linear Area Journl of Grph Algorithms n Applitions http://jg.info/ vol. 13, no. 2, pp. 153 177 (2009) On Clss of Plnr Grphs with Stright-Line Gri Drwings on Liner Are M. Rezul Krim 1,2 M. Siur Rhmn 1 1 Deprtment of

More information

50 AMC Lectures Problem Book 2 (36) Substitution Method

50 AMC Lectures Problem Book 2 (36) Substitution Method 0 AMC Letures Prolem Book Sustitution Metho PROBLEMS Prolem : Solve for rel : 9 + 99 + 9 = Prolem : Solve for rel : 0 9 8 8 Prolem : Show tht if 8 Prolem : Show tht + + if rel numers,, n stisf + + = Prolem

More information

Regular expressions, Finite Automata, transition graphs are all the same!!

Regular expressions, Finite Automata, transition graphs are all the same!! CSI 3104 /Winter 2011: Introduction to Forml Lnguges Chpter 7: Kleene s Theorem Chpter 7: Kleene s Theorem Regulr expressions, Finite Automt, trnsition grphs re ll the sme!! Dr. Neji Zgui CSI3104-W11 1

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.

(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

AP CALCULUS Test #6: Unit #6 Basic Integration and Applications

AP CALCULUS Test #6: Unit #6 Basic Integration and Applications AP CALCULUS Test #6: Unit #6 Bsi Integrtion nd Applitions A GRAPHING CALCULATOR IS REQUIRED FOR SOME PROBLEMS OR PARTS OF PROBLEMS IN THIS PART OF THE EXAMINATION. () The ext numeril vlue of the orret

More information

10. AREAS BETWEEN CURVES

10. AREAS BETWEEN CURVES . AREAS BETWEEN CURVES.. Ares etween curves So res ove the x-xis re positive nd res elow re negtive, right? Wrong! We lied! Well, when you first lern out integrtion it s convenient fiction tht s true in

More information

Polynomials. Polynomials. Curriculum Ready ACMNA:

Polynomials. 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 information

8 THREE PHASE A.C. CIRCUITS

8 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 information

SIMPLE NONLINEAR GRAPHS

SIMPLE NONLINEAR GRAPHS S i m p l e N o n l i n e r G r p h s SIMPLE NONLINEAR GRAPHS www.mthletis.om.u Simple SIMPLE Nonliner NONLINEAR Grphs GRAPHS Liner equtions hve the form = m+ where the power of (n ) is lws. The re lle

More information

Part 4. Integration (with Proofs)

Part 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 information

Data Compression Techniques (Spring 2012) Model Solutions for Exercise 4

Data Compression Techniques (Spring 2012) Model Solutions for Exercise 4 58487 Dt Compressio Tehiques (Sprig 0) Moel Solutios for Exerise 4 If you hve y fee or orretios, plese ott jro.lo t s.helsii.fi.. Prolem: Let T = Σ = {,,, }. Eoe T usig ptive Huffm oig. Solutio: R 4 U

More information

5. Every rational number have either terminating or repeating (recurring) decimal representation.

5. 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 information

6. Suppose lim = constant> 0. Which of the following does not hold?

6. Suppose lim = constant> 0. Which of the following does not hold? CSE 0-00 Nme Test 00 points UTA Stuent ID # Multiple Choie Write your nswer to the LEFT of eh prolem 5 points eh The k lrgest numers in file of n numers n e foun using Θ(k) memory in Θ(n lg k) time using

More information

2.4 Linear Inequalities and Interval Notation

2.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 information

Discrete Structures Lecture 11

Discrete 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 information

Instructions. An 8.5 x 11 Cheat Sheet may also be used as an aid for this test. MUST be original handwriting.

Instructions. 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 information

Subsequence Automata with Default Transitions

Subsequence Automata with Default Transitions Susequene Automt with Defult Trnsitions Philip Bille, Inge Li Gørtz, n Freerik Rye Skjoljensen Tehnil University of Denmrk {phi,inge,fskj}@tu.k Astrt. Let S e string of length n with hrters from n lphet

More information

(e) if x = y + z and a divides any two of the integers x, y, or z, then a divides the remaining integer

(e) if x = y + z and a divides any two of the integers x, y, or z, then a divides the remaining integer Divisibility In this note we introduce the notion of divisibility for two integers nd b then we discuss the division lgorithm. First we give forml definition nd note some properties of the division opertion.

More information