Fast index for approximate string matching

Size: px
Start display at page:

Download "Fast index for approximate string matching"

Transcription

1 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 distne) t most k from the pttern re reported in O(m+ loglogn + #mthes) time (for onstnt k). The spe omplexity of the index is O(n 1+ǫ ) for ny onstnt ǫ > 0. 1 Introdution One of the fundmentl prolems in pttern mthing is indexing text t suh tht given query pttern p, ll the ourrenes of p in t n e reported effiiently. This n e solved optimlly using suffix trees [12]: The onstrution time nd spe omplexity of the index is O(n), nd the query time is O(m + #mthes), where n is the length of t, m is the length of p, nd #mthes is the numer of times p ppers in t. For simpliity, we shll ssume throughout the pper tht the size of the lphet is onstnt. A nturl extension of text indexing is to llow pproximte serh in the index. Formlly, given text t nd n integer k, the gol is to uild n index for t suh tht given query string p, ll the sustrings of t with Hmming distne (or edit distne) t most k from p n e reported effiiently. Agin for simpliity, we ssume throughout tht k is onstnt. Building n pproximte index with lmost liner spe nd query time ws mjor open prolem. The first effiient pproximte index ws otined for the se k = 1 y Amir et l. [1]. The index of Amir et l. uses O(nlog 2 n) spe, nd nswer queries in time O(mlognloglogn+ #mthes). A fster query time is otined using the dt-struture of [2]. Liner spe indies tht support one error were given in [7,8]. A ig rekthrough ws otinedy Cole et l. [4] whih presented n index tht supports n ritrry numer of errors. The index of Cole et l. uses O(nlog k n) spendnswers queries intimeo(m+log k n loglogn+#mthes). Chnet l.[3] gve n O(n)-spe index tht nswers queries in time O(m+(logn) k(k+1) loglogn+ #mthes). Most of the results ove work for oth Hmming distne or edit distne. We note tht the query time omplexity of the edit distne index in [4] is O(m+log k n Deprtment of Computer Siene, Ben-Gurion University of the Negev. Emil: dekelts@s. gu..il 1

2 loglogn+3 k #mthes). However, s we ssume here tht k is onstnt, the time omplexity eomes O(m+log k n loglogn+#mthes). The indies mentioned ove hve worst se performne gurntees. Indies with good performne on verge were given in [5,6,9 11]. In this pper, we show how to speed-up the query time in the index of Cole et l. This omes t ost of inresing the spe omplexity of the index. More preisely, we show tht for every integer α with 2 α n/2, there is n O(n(αlogαlogn) k )- spe index (for Hmming distne or edit distne) tht nswers queries in time O(m + (log α n) k loglogn + #mthes). In prtiulr, for every fixed ǫ > 0, one n tke α = log ǫ/2k n nd get n index with spe omplexity O(nlog k+ǫ n) nd query time O(m + log k n/(loglogn) k 1 + #mthes) (rell tht k is ssumed to e onstnt, so log α n = Θ(log/loglogn)). To get fster query time, one n tke α = n ǫ/2k for some ǫ > 0 nd get n index with spe omplexity O(n 1+ǫ ) nd query time O(m+loglogn+#mthes). 2 Preliminries Let s 1,...,s n e olletion of strings, where eh string ends with the hrter, nd does not pper elsewhere in s 1,...,s n. A ompressed trie for s 1,...,s n isrootedtreet ththsnleves ndeh internl vertex hstlest two hildren. Every edge of T is leled y string. Every string s i orresponds to distint lef v i of T suh tht the ontention of the lels of the edges on the pth from the root of T to v i is extly s i. A lotion l on ompressed trie T is pir (v,s) where v is vertex of T nd s is n empty string or proper prefix of the lel of some edge etween v nd hild of v. We will sometimes refer to vertex v s lotion (v,ǫ) nd vie vers. For vertex v in ompressed trie T, the string tht orresponds to v is the ontention of the lels on the pth from the root of T to v. For lotion l = (v,s), the string tht orresponds to l, denoted str(l), is the ontention of the string tht orresponds to v nd s. The weight of vertex v in tree T is the numer of desendent leves of v. A pth [v 1,...,v d ] in tree T is hevy pth if (1) v 1 is the root of T, (2) v d is lef, nd (3) for every i < d, there is no hild of v i with weight greter thn the weight of v i+1. A hevy pth deomposition of tree T is set C of pths in T suh tht (1) C ontins hevy pth C of T, nd (2) for every onneted omponent T in T C, C ontins the pths in hevy pth deomposition of T (T C is the grph otined from T y removing the verties of C). For hevy pth deomposition C define T C to e rooted tree whose set of verties is C, nd there is n edge from C to C in T C if there is vertex v C suh tht the topmost vertex in C is hild of v in T. Given hevy pth deomposition C of ompressed trie T nd lotion l = (v,s) in T, nextlo(l) is the lotion rehed when moving from l one hrter long thepth C C tht ontins v. Formlly, nextlo(l) is thelotionl = (v,s ) suh tht the string str(l ) is the prefix of length str(l) + 1 of the string tht orresponds to the ottommost vertex of C. If there is no suh lotion l then 2

3 nextlo(l) is undefined. We lso define next(l) to e the lst hrter of the string tht orresponds to nextlo(l). For vertex v in ompressed trie T, nexthrs(v) is the set of ll first hrters in the lels of the edges etween v nd its hildren. For hrter nexthrs(v), let w e the hild of v suh tht the first hrter of the lel of the edge (v,w) is. We define Su(T,v,) to e the tree otined y first tking the sutree of T indued y v, w, nd ll the desendents of w. Furthermore, if the lel of (v,w) ontins only one hrter then the vertex v nd the edge (v,w) re removed from Su(T,v,). Otherwise, the first hrter of the lel of (v,w) is ersed. Let T 1,...,T d e ompressed tries. The merge of T 1,...,T d is ompressed trie whose strings set is the union of the strings sets of T 1,...,T d. 3 k-mismthes index The following prolem is generliztion of the indexing prolem tht ws disussed in the introdution. Input A ompressed trie T over strings s 1,...,s n. Query A string p, nd lotion l on T. Output Allthestringss i suh thtstr(l) isprefix ofs i ndthehmming distne etween p nd s i [ str(l) +1.. str(l) +m] is extly k, where m is the length of p. A dt-struture tht solves the prolem ove is lled n unrooted k-mismthes index. A dt-struture tht solves simpler vrint of the prolem in whih str(l) is lwys empty is lled rooted k-mismthes index. To solve the indexing prolem mentioned in the introdution, one n onstrut rooted k -mismthes index on ll the suffixes of the input string t for ll k k. We note tht we use Hmming distne to simplify the presenttion. The sme tehniques n lso e used for edit distne. We first desrie the k-mismthes index of Cole et l. [4]. The min ide is to define new ompressed tries lled group trees, nd reursively uild rooted (k 1)-mismthes index on eh group tree (the reursion stops when k is equl to 0). A k-mismthes query on T is nswered y mking (k 1)-mismthes queries on O(logn) group trees. Let T e ompressed trie of the strings s 1,...,s n, nd let C e hevy pth deomposition of T. Consider some hevy pth C C, nd let v 1,...,v d e the verties long the pth C (where v 1 is the topmost vertex in the pth). We define error trees s follows: For every vertex v i nd every nexthrs(v i )\{next(v i )}, the error tree Err(T,v i,) is equl to Su(T,v i,). The error tree Err(T,v i ) is the tree otined y merging the trees Su(T,v i,) for every nexthrs(v i ) \ {next(v i )}. Then, if the root u of the resulting tree hs more thn one hild we dd new root u nd n edge (u,u) with lel s, where s is the string otined y ontenting the lels of the edges on the pth from v 1 to v i, nd the hrter 3

4 d d () () () (d) Figure 1: Exmple of error trees. Figure () shows hevy pth v 1,v 2,... nd the verties hnging from this pth. The error trees Err(T,v 2,) nd Err(T,v 2,) re shown in Figures () nd (), respetively. Figure (d) shows the error tree Err(T,v 2 ), whih is otined y merging Err(T,v 2,) nd Err(T,v 2,), nd dding new root u. next(v i ). If u hs only one hild we prepend the string s to lel of the edge etween u nd its hild. See Figure 1 for exmples of the definitions ove. The next step is to onstrut group trees from the error trees. Let w i e the numer of leves in the tree Err(T,v i ). For eh vertex v i we ssign n intervl I i = [ j<i w j, j i w j). For n intervl I = [,), we will denote left(i) = nd right(i) =. The merge of Err(T,v i ),...,Err(T,v j ) will e denoted Group 1 (T,v i,v j )ndwillelledtype 1 grouptree. WedonotreteGroup 1 (T,v i,v j ) for ll i nd j (s this would tke too muh spe). Insted, the type 1 group trees re onstruted y the following proedure (n exmple is given in Figure 2). 1: For every C C whih is not lef in T C do 2: Let v 1,...,v d e the verties of C with intervls I 1,...,I d. 3: L 1 {(1,d)}. 4: t 1. 5: While L t do 6: L t+1. 7: For every (i,i ) L t do 8: left(i i ), right(i i ). 9: Let j e the index suh tht + I 2 j. 10: If j i+1 then uild the group tree Group 1 (T,v i,v j 1 ) 11: Build the group tree Group 1 (T,v j,v j ). 12: If j i 1 then uild the group tree Group 1 (T,v j+1,v i ) 13: If j > i+1 then dd (i,j 1) to L t+1. 14: If j < i 1 then dd (j +1,i ) to L t+1. 4

5 Figure 2: An exmple of type 1 group tree onstrution. The top line shows intervls I 1,...,I 7 nd the point + I 2 3. Thus, the first itertion retes the group trees Group 1 (T,v 1,v 2 ), Group 1 (T,v 3,v 3 ), nd Group 1 (T,v 4,v 7 ). In the nextitertion, thefollowingtreesrereted: Group 1 (T,v 1,v 1 ), Group 1 (T,v 2,v 2 ), Group 1 (T,v 4,v 4 ), Group 1 (T,v 5,v 5 ), nd Group 1 (T,v 6,v 7 ). In the finl itertion, the group trees Group 1 (T,v 6,v 6 ) nd Group 1 (T,v 7,v 7 ) re reted. 15: t t+1. For every vertex v in T we rete group trees from the error trees Err(T,v,) in similr wy. These trees will e lled type 2 group trees. On every group tree (of type 1 or 2) we uild rooted (k 1)-mismthes index. Also, we uild n unrooted (k 1)-mismthes index on T. We now desrie how to nswer rooted query p. This is done y performing (k 1)-mismthes queries on some group trees or on T. Let l e the lotion in T suh tht str(l) is prefix of p, nd str(l) is mximl. The pth tht orresponds to p is the pth from the root of T to l. Let C 1,...,C r e the pths of C through whih the pth tht orresponds to p psses, in order from top to ottom. For t = 1,...,r, let l t e the lst lotion on C t through whih the pth tht orresponds to p psses. Note tht for t < r, l t must e vertex. For every pth C t, let v 1,...,v d e the verties of the pth, nd let j e the minimum index suh tht str(v j ) str(l t ). The following queries re performed: 1. If l t is not lef, do n unrooted (k 1)-mismthes query on T with query string p[ str(l t ) +2..m] nd strt position nextlo(l t ). 2. Identify the type 1 group trees whose merge inludes preisely the error trees Err(T,v 1 ),...,Err(T,v j 1 ). On eh group tree, do (k 1)-mismthes query with query string p[ str(v 1 ) +1..m]. 3. If l t = v j nd l t is not lef, identify the type 2 group trees whose merge inludes preisely the error trees Err(T,v j,) for ll p[ str(v j ) +1]. On eh group tree, do (k 1)-mismthes query with query string p[ str(v j ) + 2..m]. Hndling n unrooted query is done similrly: In this se the pth tht orresponds to p strts t the query lotion l insted of the strting t the root. Hndling the pths C 2,...,C r is the sme s efore. For the pth C 1, the type 1 group trees tht re queried re the trees whose merge inludes preisely the error trees Err(T,v i ),...,Err(T,v j 1 ), where i is the minimum index suh tht str(v i ) str(l) nd j is defined s efore. 5

6 4 New index Our onstrution is similr to the onstrution of Cole et l. We uild more group trees in order to redue the numer of group trees tht re serhed when nswering query. In prtiulr, while in the onstrution of Cole et l. group tree onsists of error trees tht ome from one hevy pth, in our onstrution some group trees (lled type 3 group trees) onsist of error trees from severl hevy pths. Let α e some integer with 2 α n/2. The type 1 group trees re uilt using proedure Build desried elow. 1: For every C C whih is not lef in T C do 2: Let v 1,...,v d e the verties of C with intervls I 1,...,I d. 3: L 1 {(1,d)}. 4: t 1. 5: While L t do 6: L t+1. 7: For every (i,i ) L t do 8: left(i i ), right(i i ). 9: i 0 i 1. 10: For j = 1,...,α 1 do 11: Let i j e the index suh tht + j ( ) I α i j. 12: If i j > i j 1 then 13: If i j i+1 then uild the group tree Group 1 (T,v i,v ij 1). 14: Build the group tree Group 1 (T,v ij,v ij ). 15: If i j i 1 then uild the group tree Group 1 (T,v ij +1,v i ). 16: If i j > i j 1 +2 then dd (i j 1 +1,i j 1) to L t+1. 17: If i α 1 < i 1 then dd (i α 1 +1,i ) to L t+1. 18: t t+1. The type 2 group trees re uilt similrly. We lso define type 3 group trees s follows. The weight of pth C C is the weight of the topmost vertex in C. A pth C C is lled d if weight(c ) > 1 weight(c), where C is the prent of C α in T C. We sn the verties of the tree T C in preorder. When we reh vertex C tht hs t lest one d hild, we uilt set B(C) ontining the pth C nd ll pths C C suh tht C is desendent of C in T C nd weight(c ) > 1 weight(c). α Note tht every C B(C)\{C} is d pth. For every C,C B(C) suh tht C is desendent of C we rete type 3 group tree, denoted Group 3 (T,C,C ), in the following wy. Let C = C 1,C 2,...,C r 1,C r = C e the pth from C to C in T C. Let u i e the first vertex in the pth C i, nd for i < r let v i e the prent of u i+1 in T (note tht v i C i ). Let i e the first hrter of the lel of the edge (v i,u i+1 ). Let s i e the ontention of the lels of the edges on the pth from u 1 to u i, nd let s i e the ontention of the lels of the edges on the pth from u 1 to v i, nd the hrter i. The group tree Group 3 (T,C,C ) is the merge of the following trees. 1. For every i < r nd every v C i whih is n nestor of v i, the tree otined y tking Err(T,v) nd prepending the string s i to the lel of the edge 6

7 d d d e d e () () () (d) Figure 3: Exmple of type 3 group trees. The pths C = C 1, C 2, nd C = C 3 re shown in Figure (). Two of the trees tht re merged when reting Group 3 (T,C,C ) re shown in () nd (d). The tree in () is otined from Err(T,v) (shown in ()) y dding the string s 2 = to the lel of the edge etween the root nd its hild. The tree in (d) is otined from Su(T,v 2,) y dding new root, where the lel of the new edge is s 2 =. etween the root of Err(T,v) nd its only hild. 2. For every i < r nd every nexthrs(v i ) \ { i } (note tht this inludes = next(v i )), the tree otined y tking Su(T,v i,) nd if the root of this tree hs only one hild, prepending the string s i to the edge etween the root nd its hild. Otherwise, new root is dded nd onneted to the old root y n edge, where the lel of the edge is s i. An exmple is given in Figure 3. Answering n unrooted query p is performed s follows. Let C 1,...,C r e the pths of C through whih the pth tht orresponds to p in T psses. Strt with t = 1. At eh itertion, if t = r or C t+1 is not d pth, perform queries for C t s desried in the previous setion, nd inrese t y 1. Otherwise, do rooted 7

8 (k 1)-mismthes query on Group 3 (T,C t,c t ) nd set t to t, where t > t is the mximum index suh tht C t B(C t ). In more detils, the lgorithm is s follows (we omit the queries on type 2 grouptrees whih re hndled similrly to the queries on type 1 group trees). 1: Let C 1,...,C r e the pths of C through whih the pth tht orresponds to p in T psses. 2: t 1. 3: While t r do 4: Let v 1,...,v d e the verties of C t, with intervls I 1,...,I d. 5: If t < r nd C t+1 is d pth 6: Let t > t e the mximum index suh tht C t B(C t ). 7: Do rooted (k 1)-mismthes query on Group 3 (T,C t,c t ) with query string p[ str(v 1 ) +1..m]. 8: t t. 9: Else 10: Let l t e the lst lotion on C t through whih the pth tht orresponds to p psses. 11: If l t is not lef then do n unrooted (k 1)-mismthes query on T with query string p[ str(l t ) +2..m] nd strt position nextlo(l t ). 12: Let j e the minimum index suh tht str(v j ) str(l t ). 13: p p[ str(v j ) +1..m]. 14: i 1, i d. 15: While i < j do 16: left(i i ), right(i i ). 17: Let β e the mximum integer suh tht + β ( ) < right(i α j). 18: If β > 0 then let j 1 e the index suh tht + β ( ) I α j 1 else j 1 i 1. 19: If β < α 1 then let j 2 e the index suh tht + β+1 α j 2 else j 2 i : If j 1 i+1thendorooted(k 1)-mismthesqueryonGroup 1 (T,v i,v j1 1) with query string p. 21: If i j 1 < j thendorooted(k 1)-mismthesqueryonGroup 1 (T,v j1,v j1 ) with query string p. 22: i j 1 +1, i j : t t+1 For n unrooted query, the pth C 1 is hndled s in the hndling of unrooted queries desried in the previous setion. Then, C 2,...,C r re hndled using the lgorithm ove. Theorem1. Thetime fornsweringqueryis O(m+(log α n) k loglogn+#mthes). Proof. Let t 1,...,t r e the different vlues of t during the run of the lgorithm. We first give ound on r. We lim tht for every i r 2, weight(c ti+2 ) 1 weight(c α t i ): If C ti +1 is not d pth then t i+1 = t i + 1 nd weight(c ti+1 ) 1 weight(c α t i ). Sine weight(c 1 ) > weight(c 2 ) > > weight(c t ) nd t i+2 t i+1, 8

9 we otin tht weight(c ti+2 ) 1 α weight(c t i ). If C ti +1 is d pth then C ti+1 +1 is not in B(C t ). Therefore, weight(c ti+2 ) weight(c ti+1 +1) 1 α weight(c t i ). Sine weight(c 1 ) = n nd weight(c t ) 1, we onlude tht r 2 + 2log α n. Therefore, the numer of (k 1)-mismthes queries performed t lines 7 nd 11 is t most r 2+2log α n. We next ound the numer of queries performed on type 1 group trees. During theexeution of lines 15 22, we sy tht the urrent intervl is the intervl I i I i+1 I i. The sequene of urrent intervls during the exeution of the lgorithm (for ll t) is deresing in lengths. If for some C t, lines re exeuted s times, then the length of the urrent intervl dereses y ftor of t lest α mx(1,s 1). Thus, lines re exeuted t most 2+2log α n times, nd the numer queries performed on type 1 group trees is t most 4+4log α n. Using similr nlysis, the numer of queries on type 2 group trees is t most 8+8log α n (in eh itertion of the serh in the type 2 group trees, up to 4 queries n e mde). Comining the ounds ove, we hve tht the totl numer of(k 1)-mismthes queries performed when nswering rooted queries is t most 14+14log α n. When nswering n unrooted query, t most 18+18log α n (k 1)-mismthes queries re mde (the dditionl 4+4log α n queries re due to the speil hndling of the pth C 1 ). Using indution, the totl numer of 0-mismthes queries performed for rooted or unrooted query is t most (18+18log α n) k = O((log α n) k ). Using the LCP dt-strutures of Cole et l. [4] we hve tht fter preproessing stge tht tkes O(m) time, the i-th 0-mismthes query tkes O(loglogn+ #mthes i ) time, where #mthes i is the numer of mthes returned y the query. Sine eh pproximte mth of p in t is reported extly one, i #mthes i = #mthes. Therefore, the totl time omplexity of k-mismthes query is O(m + (log α n) k loglogn+#mthes). Theorem 2. The spe omplexity of the index is O(n(αlogαlogn) k ). Proof. First, we ound the totl numer of leves in ll type 1 group trees (the nlysis is similr to the nlysis of Cole et l.). Define S k (n) = (5αlogαlogn) k. We will show tht the totl numer of leves in ll group trees tht re uilt for k-mismthes index over ompressed trie T with n leves is t most S k (n) n. The lim is proved using indution on k. The se k = 0 is trivil. Suppose we proved the lim for k 1, nd onsider some k-mismthes index over ompressed trie T with n leves. Let T 1,...,T d e ll the type 1 group trees tht re uilt for T y proedure Build, nd denote y x i the numer of leves in T i. By indution, we hve tht the (k 1)-mismthes indies onstruted on the trees T 1,...,T d hve t most d i=1 S k 1(x i ) x i leves. For lef v of T, let i(v,1),...,i(v,d v ) denote the indies of group trees in whih v ppers. Clerly, d i=1 S k 1(x i ) x i = dv v j=1 S k 1(x i(v,j) ). The funtion S k 1 (x) is n inresing funtion of x. Therefore, d i=1 S k 1(x i ) x i dv v j=1 S k 1(n) = S k 1 (n) v d v. We now give ound on d v. Fix some lef v of T. We prtition the group trees tht ontin v into sets, where eh set onsists of ll the trees tht re generted during one exeution of lines of proedure Build. In eh set the numer of trees tht ontin v is t most α 1. Similrly to the proof of Theorem 1, the 9

10 numer of sets is t most logn + log α n 2logn. It follows tht the numer of leves in the (k 1)-mismthes indies uilt on the type 1 group trees is t most (α 1) 2logn S k 1 (n). Similrly, the numer of leves in the indies uilt on the type 2 group trees is t most (α 1) 2logn S k 1 (n). It remins to ound the numer of leves in the indies uilt on the type 3 group trees. Weeginyounding thesize ofb(c) forsome pthc. Consider the sutree T of T C tht is indued y the verties of B(C). For every two leves C 1 nd C 2 in T, the set of verties of T tht re desendents of the topmost vertex in C 1 is disjoint with the set of verties of T tht re desendents of the topmost vertex in C 2. It follows tht the sum of weights of the leves of T is less thn or equl to weight(c). Sine eh lef in T hs weight greter thn 1 weight(c), we onlude α tht T hs t most α leves. By the definition of hevy pth deomposition, we hve tht if C 1 is hild of C 2 in T then the weight of C 1 is less thn hlf the weight of C 2. Therefore, for every lef C in T, the numer of nestors of C in T is t most logα. Thus, B(C) αlogα. Using the sme rguments s ove, the numer of leves in the(k 1)-mismthes indies uilt on the type 3 group trees is t most S k 1 (n) v d v, where d v is the numer of type 3 group trees tht ontin the lef v. A type 3 group tree tht ontins v must e of the form Group 3 (T,C,C ) where C is pth through whih the pth from the root of T to v psses. The numer of suh pths is t most logn. Moreover, for fixed C, there re t most αlogα wys to hoose C. Therefore, d v αlogαlogn. We onlude tht the totl numer of leves in the indies uilt on ll group trees is t most (2 2(α 1)logn+αlogαlogn) S k 1 (n) 5αlogαlogn S k 1 (n) = S k (n). Referenes [1] A. Amir, D. Keselmn, G. M. Lndu, N. Lewenstein, M. Lewenstein, nd M. Rodeh. Ditionry mthing with one error. J. of Algorithms, 37(2): , [2] A. L. Buhsum, M. T. Goodrih, nd J. R. Westrook. Rnge serhing over tree ross produts. In Pro. 8th Europen Symposium on Algorithms (ESA), pges , [3] H. Chn, T. W. Lm, W. Sung, S. Tm, nd S. Wong. A liner size index for pproximte pttern mthing. In Pro. 17th Symposium on Comintoril Pttern Mthing (CPM), LNCS 4009, pges 49 59, [4] R. Cole, L. Gottlie, nd M. Lewenstein. Ditionry mthing nd indexing with errors nd don t res. In Pro. 36th ACM Symposium on Theory Of Computing (STOC), pges , [5] C. Epifnio, A. Griele, F. Mignosi, A. Restivo, nd M. Siortino. Lnguges with mismthes. Theoretil Computer Siene, 385(1-3): ,

11 [6] A. Griele, F. Mignosi, A. Restivo, nd M. Siortino. Indexing strutures for pproximte string mthing. In Pro. 5th Itlin Conferene on Algorithms nd Complexity (CIAC), pges , [7] T. N. D. Huynh, W. K. Hon, T. W. Lm, nd W. K. Sung. Approximte string mthing using ompressed suffix rrys. In Pro. 15th Symposium on Comintoril Pttern Mthing (CPM), pges , [8] T. W. Lm, W. K. Sung, nd S. S. Wong. Improved pproximte string mthing using ompressed suffix dt strutures. In Pro. 16th Interntionl Symposium on Algorithms nd Computtion (ISAAC), pges , [9] M. G. Mß nd J.Nowk. Text indexing with errors. In Pro. 16th Symposium on Comintoril Pttern Mthing (CPM), pges 21 32, [10] G. Nvrro nd R. Bez-Ytes. A hyrid indexing method for pproximte string mthing. J. of Disrete Algorithms, 1(1): , [11] G. Nvrro nd E. Chávez. A metri index for pproximte string mthing. Theoretil Computer Siene, 352(1 3): , [12] P. Weiner. Liner pttern mthing lgorithm. In Pro. 14th IEEE Symposium on Swithing nd Automt Theory, pges 1 11,

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

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

Computational Biology Lecture 18: Genome rearrangements, finding maximal matches Saad Mneimneh

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

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

22: 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 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

Prefix-Free Regular-Expression Matching

Prefix-Free Regular-Expression Matching Prefix-Free Regulr-Expression Mthing Yo-Su Hn, Yjun Wng nd Derik Wood Deprtment of Computer Siene HKUST Prefix-Free Regulr-Expression Mthing p.1/15 Pttern Mthing Given pttern P nd text T, find ll sustrings

More information

Suffix Trays and Suffix Trists: Structures for Faster Text Indexing

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

Common intervals of genomes. Mathieu Raffinot CNRS LIAFA

Common intervals of genomes. Mathieu Raffinot CNRS LIAFA Common intervls of genomes Mthieu Rffinot CNRS LIF Context: omprtive genomis. set of genomes prtilly/totlly nnotte Informtive group of genes or omins? Ex: COG tse Mny iffiulties! iology Wht re two similr

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

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

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

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

A Lower Bound for the Length of a Partial Transversal in a Latin Square, Revised Version

A 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 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

Technische Universität München Winter term 2009/10 I7 Prof. J. Esparza / J. Křetínský / M. Luttenberger 11. Februar Solution

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

Discrete Structures, Test 2 Monday, March 28, 2016 SOLUTIONS, VERSION α

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

Finite State Automata and Determinisation

Finite 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 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

Section 1.3 Triangles

Section 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 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

Intermediate Math Circles Wednesday 17 October 2012 Geometry II: Side Lengths

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

Data Structures and Algorithm. Xiaoqing Zheng

Data Structures and Algorithm. Xiaoqing Zheng Dt Strutures nd Algorithm Xioqing Zheng zhengxq@fudn.edu.n String mthing prolem Pttern P ours with shift s in text T (or, equivlently, tht pttern P ours eginning t position s + in text T) if T[s +... s

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

Nondeterministic Automata vs Deterministic Automata

Nondeterministic Automata vs Deterministic Automata Nondeterministi Automt vs Deterministi Automt We lerned tht NFA is onvenient model for showing the reltionships mong regulr grmmrs, FA, nd regulr expressions, nd designing them. However, we know tht n

More information

QUADRATIC EQUATION. Contents

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

1 Nondeterministic Finite Automata

1 Nondeterministic Finite Automata 1 Nondeterministic Finite Automt Suppose in life, whenever you hd choice, you could try oth possiilities nd live your life. At the end, you would go ck nd choose the one tht worked out the est. Then you

More information

On Suffix Tree Breadth

On Suffix Tree Breadth On Suffix Tree Bredth Golnz Bdkoeh 1,, Juh Kärkkäinen 2, Simon J. Puglisi 2,, nd Bell Zhukov 2, 1 Deprtment of Computer Science University of Wrwick Conventry, United Kingdom g.dkoeh@wrwick.c.uk 2 Helsinki

More information

Homework 3 Solutions

Homework 3 Solutions CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 3 Solutions 1. Give NFAs with the specified numer of sttes recognizing ech of the following lnguges. In ll cses, the lphet is Σ = {,1}.

More information

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

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

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

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

= state, a = reading and q j

= state, a = reading and q j 4 Finite Automt CHAPTER 2 Finite Automt (FA) (i) Derterministi Finite Automt (DFA) A DFA, M Q, q,, F, Where, Q = set of sttes (finite) q Q = the strt/initil stte = input lphet (finite) (use only those

More information

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER MACHINES AND THEIR LANGUAGES ANSWERS

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

Lesson 2: The Pythagorean Theorem and Similar Triangles. A Brief Review of the Pythagorean Theorem.

Lesson 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 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

CS241 Week 6 Tutorial Solutions

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

Exercise sheet 6: Solutions

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

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University CS415 Compilers Lexicl Anlysis nd These slides re sed on slides copyrighted y Keith Cooper, Ken Kennedy & Lind Torczon t Rice University First Progrmming Project Instruction Scheduling Project hs een posted

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

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

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

More Properties of the Riemann Integral

More Properties of the Riemann Integral More Properties of the Riemnn Integrl Jmes K. Peterson Deprtment of Biologil Sienes nd Deprtment of Mthemtil Sienes Clemson University Februry 15, 2018 Outline More Riemnn Integrl Properties The Fundmentl

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

Hyers-Ulam stability of Pielou logistic difference equation

Hyers-Ulam stability of Pielou logistic difference equation vilble online t wwwisr-publitionsom/jns J Nonliner Si ppl, 0 (207, 35 322 Reserh rtile Journl Homepge: wwwtjnsom - wwwisr-publitionsom/jns Hyers-Ulm stbility of Pielou logisti differene eqution Soon-Mo

More information

Periodic string comparison

Periodic string comparison Periodi string omprison Alexnder Tiskin Deprtment of Computer Siene University of Wrwik http://www.ds.wrwik..uk/~tiskin Alexnder Tiskin (Wrwik) Periodi string omprison 1 / 51 1 Introdution 2 Semi-lol string

More information

ILLUSTRATING 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 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 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

AVL Trees. D Oisín Kidney. August 2, 2018

AVL 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 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

General Suffix Automaton Construction Algorithm and Space Bounds

General Suffix Automaton Construction Algorithm and Space Bounds Generl Suffix Automton Constrution Algorithm nd Spe Bounds Mehryr Mohri,, Pedro Moreno, Eugene Weinstein, Cournt Institute of Mthemtil Sienes 251 Merer Street, New York, NY 10012. Google Reserh 76 Ninth

More information

Nondeterminism and Nodeterministic Automata

Nondeterminism and Nodeterministic Automata Nondeterminism nd Nodeterministic Automt 61 Nondeterminism nd Nondeterministic Automt The computtionl mchine models tht we lerned in the clss re deterministic in the sense tht the next move is uniquely

More information

, g. Exercise 1. Generator polynomials of a convolutional code, given in binary form, are g. Solution 1.

, 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 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

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

15-451/651: Design & Analysis of Algorithms December 3, 2013 Lecture #28 last changed: November 28, 2013

15-451/651: Design & Analysis of Algorithms December 3, 2013 Lecture #28 last changed: November 28, 2013 15-451/651: Design & nlysis of lgorithms Deemer 3, 2013 Leture #28 lst hnged: Novemer 28, 2013 Lst time we strted tlking out mehnism design: how to llote n item to the person who hs the mximum vlue for

More information

Section 4.4. Green s Theorem

Section 4.4. Green s Theorem The Clulus of Funtions of Severl Vriles Setion 4.4 Green s Theorem Green s theorem is n exmple from fmily of theorems whih onnet line integrls (nd their higher-dimensionl nlogues) with the definite integrls

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

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014 CMPSCI 250: Introduction to Computtion Lecture #31: Wht DFA s Cn nd Cn t Do Dvid Mix Brrington 9 April 2014 Wht DFA s Cn nd Cn t Do Deterministic Finite Automt Forml Definition of DFA s Exmples of DFA

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

Formal Languages and Automata

Formal Languages and Automata Moile Computing nd Softwre Engineering p. 1/5 Forml Lnguges nd Automt Chpter 2 Finite Automt Chun-Ming Liu cmliu@csie.ntut.edu.tw Deprtment of Computer Science nd Informtion Engineering Ntionl Tipei University

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

Linear Algebra Introduction

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

Regular languages refresher

Regular languages refresher Regulr lnguges refresher 1 Regulr lnguges refresher Forml lnguges Alphet = finite set of letters Word = sequene of letter Lnguge = set of words Regulr lnguges defined equivlently y Regulr expressions Finite-stte

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

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

arxiv: v1 [math.gr] 11 Jan 2019

arxiv: v1 [math.gr] 11 Jan 2019 The Generlized Dehn Property does not imply liner isoperimetri inequlity Owen Bker nd Timothy Riley rxiv:1901.03767v1 [mth.gr] 11 Jn 2019 Jnury 15, 2019 Astrt The Dehn property for omplex is tht every

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

(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

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

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

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

Metodologie di progetto HW Technology Mapping. Last update: 19/03/09

Metodologie di progetto HW Technology Mapping. Last update: 19/03/09 Metodologie di progetto HW Tehnology Mpping Lst updte: 19/03/09 Tehnology Mpping 2 Tehnology Mpping Exmple: t 1 = + b; t 2 = d + e; t 3 = b + d; t 4 = t 1 t 2 + fg; t 5 = t 4 h + t 2 t 3 ; F = t 5 ; t

More information

A CLASS OF GENERAL SUPERTREE METHODS FOR NESTED TAXA

A CLASS OF GENERAL SUPERTREE METHODS FOR NESTED TAXA A CLASS OF GENERAL SUPERTREE METHODS FOR NESTED TAXA PHILIP DANIEL AND CHARLES SEMPLE Astrt. Amlgmting smller evolutionry trees into single prent tree is n importnt tsk in evolutionry iology. Trditionlly,

More information

LIP. Laboratoire de l Informatique du Parallélisme. Ecole Normale Supérieure de Lyon

LIP. Laboratoire de l Informatique du Parallélisme. Ecole Normale Supérieure de Lyon LIP Lortoire de l Informtique du Prllélisme Eole Normle Supérieure de Lyon Institut IMAG Unité de reherhe ssoiée u CNRS n 1398 One-wy Cellulr Automt on Cyley Grphs Zsuzsnn Rok Mrs 1993 Reserh Report N

More information

@#? Text Search ] { "!" Nondeterministic Finite Automata. Transformation NFA to DFA and Simulation of NFA. Text Search Using Automata

@#? Text Search ] { ! Nondeterministic Finite Automata. Transformation NFA to DFA and Simulation of NFA. Text Search Using Automata g Text Serh @#? ~ Mrko Berezovský Rdek Mřík PAL 0 Nondeterministi Finite Automt n Trnsformtion NFA to DFA nd Simultion of NFA f Text Serh Using Automt A B R Power of Nondeterministi Approh u j Regulr Expression

More information

AP Calculus BC Chapter 8: Integration Techniques, L Hopital s Rule and Improper Integrals

AP Calculus BC Chapter 8: Integration Techniques, L Hopital s Rule and Improper Integrals AP Clulus BC Chpter 8: Integrtion Tehniques, L Hopitl s Rule nd Improper Integrls 8. Bsi Integrtion Rules In this setion we will review vrious integrtion strtegies. Strtegies: I. Seprte the integrnd into

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

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

First Midterm Examination

First Midterm Examination Çnky University Deprtment of Computer Engineering 203-204 Fll Semester First Midterm Exmintion ) Design DFA for ll strings over the lphet Σ = {,, c} in which there is no, no nd no cc. 2) Wht lnguge does

More information

The Word Problem in Quandles

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

CHAPTER 1 Regular Languages. Contents

CHAPTER 1 Regular Languages. Contents Finite Automt (FA or DFA) CHAPTE 1 egulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, euivlence of NFAs nd DFAs, closure under regulr

More information

Graph width-parameters and algorithms

Graph width-parameters and algorithms Grph width-prmeters nd lgorithms Jisu Jeong (KAIST) joint work with Sigve Hortemo Sæther nd Jn Arne Telle (University of Bergen) 2015 KMS Annul Meeting 2015.10.24. YONSEI UNIVERSITY Grph width-prmeters

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

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

( ) { } [ ] { } [ ) { } ( ] { }

( ) { } [ ] { } [ ) { } ( ] { } Mth 65 Prelulus Review Properties of Inequlities 1. > nd > >. > + > +. > nd > 0 > 4. > nd < 0 < Asolute Vlue, if 0, if < 0 Properties of Asolute Vlue > 0 1. < < > or

More information

Proving the Pythagorean Theorem

Proving the Pythagorean Theorem Proving the Pythgoren Theorem W. Bline Dowler June 30, 2010 Astrt Most people re fmilir with the formul 2 + 2 = 2. However, in most ses, this ws presented in lssroom s n solute with no ttempt t proof or

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

A Study on the Properties of Rational Triangles

A Study on the Properties of Rational Triangles Interntionl Journl of Mthemtis Reserh. ISSN 0976-5840 Volume 6, Numer (04), pp. 8-9 Interntionl Reserh Pulition House http://www.irphouse.om Study on the Properties of Rtionl Tringles M. Q. lm, M.R. Hssn

More information

CS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions

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

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University

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

PAIR OF LINEAR EQUATIONS IN TWO VARIABLES

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

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

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

Pythagoras Theorem. Pythagoras Theorem. Curriculum Ready ACMMG: 222, 245.

Pythagoras Theorem. Pythagoras Theorem. Curriculum Ready ACMMG: 222, 245. Pythgors Theorem Pythgors Theorem Curriulum Redy ACMMG:, 45 www.mthletis.om Fill in these spes with ny other interesting fts you n find out Pythgors. In the world of Mthemtis, Pythgors is legend. He lived

More information

For a, b, c, d positive if a b and. ac bd. Reciprocal relations for a and b positive. If a > b then a ab > b. then

For a, b, c, d positive if a b and. ac bd. Reciprocal relations for a and b positive. If a > b then a ab > b. then Slrs-7.2-ADV-.7 Improper Definite Integrls 27.. D.dox Pge of Improper Definite Integrls Before we strt the min topi we present relevnt lger nd it review. See Appendix J for more lger review. Inequlities:

More information

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages 5//6 Grmmr Automt nd Lnguges Regulr Grmmr Context-free Grmmr Context-sensitive Grmmr Prof. Mohmed Hmd Softwre Engineering L. The University of Aizu Jpn Regulr Lnguges Context Free Lnguges Context Sensitive

More information

Efficient Parameterized Algorithms for Data Packing

Efficient Parameterized Algorithms for Data Packing Effiient Prmeterized Algorithms for Dt Pking Krishnendu Chtterjee, Amir Kfshdr Gohrshdy, Nstrn Okti, Andres Pvloginnis To ite this version: Krishnendu Chtterjee, Amir Kfshdr Gohrshdy, Nstrn Okti, Andres

More information

Can one hear the shape of a drum?

Can one hear the shape of a drum? Cn one her the shpe of drum? After M. K, C. Gordon, D. We, nd S. Wolpert Corentin Lén Università Degli Studi di Torino Diprtimento di Mtemti Giuseppe Peno UNITO Mthemtis Ph.D Seminrs Mondy 23 My 2016 Motivtion:

More information