Edit-Distance between Visibly Pushdown Languages

Size: px
Start display at page:

Download "Edit-Distance between Visibly Pushdown Languages"

Transcription

1 Edt-Dstance between Vsbly Pushdown Languages Yo-Sub Han 1 and Sang-K Ko 2 1 Department of Computer Scence, Yonse Unversty 50, Yonse-Ro, Seodaemun-Gu, Seoul , Republc of Korea emmous@yonse.ac.kr 2 Department of Computer Scence, Unversty of Lverpool Ashton Street, Lverpool, L69 3BX, Unted Kngdom sangkko@lverpool.ac.uk Abstract. We study the edt-dstance between two vsbly pushdown languages. It s well-known that the edt-dstance between two contextfree languages s undecdable. The class of vsbly pushdown languages s a robust subclass of context-free languages snce t s closed under ntersecton and complementaton whereas context-free languages are not. We show that the edt-dstance problem s decdable for vsbly pushdown languages and present an algorthm for computng the edt-dstance based on the constructon of an algnment PDA. Moreover, we show that the edt-dstance can be computed n polynomal tme f we assume that the edt-dstance s bounded by a fxed nteger k. Keywords: vsbly pushdown languages, edt-dstance, algorthm, decdablty 1 Introducton The edt-dstance between two words s the smallest number of operatons requred to transform one word nto the other [9]. We can use the edt-dstance as a smlarty measure between two words; the shorter dstance mples that the two words are more smlar. We can compute ths by usng the bottom-up dynamc programmng algorthm [15]. The edt-dstance problem arses n many areas such as computatonal bology, text processng and speech recognton [11, 13, 14]. Ths problem can be extended to a problem of computng the smlarty or dssmlarty between languages [4, 5, 11]. The edt-dstance between two languages s defned as the mnmum edtdstance of two words, where one word s from the frst language and the other word s from the second language. Mohr [11] consdered the problem of computng the edt-dstance between two regular languages gven by fnte-state automata (FAs of szes m and n and showed that t s computable n O(mn log mn tme. He also proved that t s undecdable to compute the edt-dstance between two context-free languages [11] usng the undecdablty of the ntersecton emptness of two context-free languages. As an ntermedate result, Han et al. [5]

2 2 Yo-Sub Han and Sang-K Ko consdered the edt-dstance between a regular language and a context-free language. Gven an FA and a pushdown automaton (PDA of szes m and n, they proposed a polynomal-tme algorthm that computes the edt-dstance between ther languages [5]. Here we study the edt-dstance problem between two vsbly pushdown languages. Vsbly pushdown languages are recognzable by vsbly pushdown automata (VPAs, whch are a specal type of pushdown automata for whch stack behavor s drven by the nput symbols accordng to a partton of the alphabet. Some lterature call these automata nput-drven pushdown automata [10]. The class of vsbly pushdown languages les n between the class of regular languages and the class of context-free languages. Recently, there have been many results about vsbly pushdown languages because of nce closure propertes. Note that context-free languages are not closed under ntersecton and complement and determnstc context-free languages are not closed under unon, ntersecton, concatenaton, and Kleene-star. On the other hand, vsbly pushdown languages are closed under all these operatons. Moreover, language ncluson, equvalence and unversalty are all decdable for vsbly pushdown languages whereas undecdable for context-free languages. Vsbly pushdown automata are useful n processng XML documents [1, 12]. For example, a vsbly pushdown automaton can process a SAX representaton of an XML document, whch s a lnear sequence of characters along wth a herarchcally nested matchng of open-tags wth closng tags. Note that the edt-dstance between two vsbly pushdown languages s undecdable f two languages are defned over dfferent vsbly pushdown alphabets snce the ntersecton emptness s undecdable [8]. Therefore, we always assume that two vsbly pushdown languages are defned over the same vsbly pushdown alphabet. We show that the edt-dstance between vsbly pushdown languages s decdable and present an algorthm for computng the edt-dstance. Moreover, the edt-dstance can be computed n polynomal tme f we assume that the edtdstance s bounded by a fxed nteger k. 2 Prelmnares Here we recall some basc defntons and fx notaton. For background knowledge n automata theory, the reader may refer to textbooks [6, 16]. The sze of a fnte set S s S. Let Σ denote a fnte alphabet and Σ denote the set of all fnte words over Σ. For m N, Σ m s the set of words over Σ havng length at most m. The th character of a word w s denoted by w for 1 w, and the subword of a word w that begns at poston and ends at poston j s denoted by w,j for 1 j w. A language over Σ s a subset of Σ. Gven a set X, 2 X denotes the power set of X. The symbol λ denotes the null word. A (nondetermnstc fnte automaton (FA s specfed by a tuple A = (Q, Σ, δ, s, F, where Q s a fnte set of states, Σ s an nput alphabet, δ : Q Σ 2 Q s a mult-valued transton functon, s Q s the start state and

3 Edt-Dstance between Vsbly Pushdown Languages 3 F Q s a set of fnal states. If F conssts of a sngle state f, we use f nstead of {f} for smplcty. When q δ(p, a, we say that state p has an out-transton to state q (p s a source state of q and q has an n-transton from p (q s a target state of p. The transton functon δ s extended n the natural way to a functon Q Σ 2 Q. A word x Σ s accepted by A f there s a labeled path from s to a state n F such that ths path spells out the word x, namely, δ(s, x F. The language L(A s the set of words accepted by A. A (nondetermnstc pushdown automaton (PDA s specfed by a tuple P = (Q, Σ, Γ, δ, s, Z 0, F, where Q s a fnte set of states, Σ s a fnte nput 2 Q Γ alphabet, Γ s a fnte stack alphabet, δ : Q (Σ {λ} Γ 2 s a transton functon, s Q s the start state, Z 0 s the ntal stack symbol and F Q s the set of fnal states. Our defnton restrcts that each transton of P has at most two stack symbols, that s, each transton can push or pop at most one symbol. We use δ to denote the number of transtons n δ. We defne the sze P of P as Q + δ. The language L(P s the set of words accepted by P. A (nondetermnstc vsbly pushdown automaton (VPA [2, 10] s a restrcted verson of a PDA, where the nput alphabet Σ conssts of three dsjont classes, Σ c, Σ r, and Σ l. Namely, Σ = Σ c Σ r Σ l. The class of the nput alphabet determnes the type of stack operaton. For example, the automaton always pushes a symbol onto the stack when t reads a call symbol n Σ c. If the nput symbol s a return symbol n Σ r, the automaton pops a symbol from the stack. Fnally, the automaton nether uses the stack nor even examne the content of the stack for the local symbols n Σ l. Formally, the nput alphabet s defned as a trple Σ = (Σ c, Σ r, Σ l, where three components are fnte dsjont sets. A VPA s formally defned by a tuple A = ( Σ, Γ, Q, s, F, δ c, δ r, δ l, where Σ = Σ c Σ r Σ l s the nput alphabet, Γ s the fnte set of stack symbols, Q s the fnte set of states, s Q s the start state, F Q s the set of fnal states, δ c : Q Σ c 2 Q Γ s the transton functon for the push operatons, δ r : Q (Γ { } Σ r 2 Q s the transton functon for the pop operatons, and δ l : Q Σ l 2 Q s the local transton functon. We use / Γ to denote the top of an empty stack. A confguraton of A s a trple (q, w, v, where q Q s the current state, w Σ s the remanng nput, and v Γ s the content on the stack. Denote the set of confguratons of A by C(A and we defne the sngle step computaton wth the relaton A C(A C(A. Push operaton: (q, aw, v A (q, w, γv for all a Σ c, (q, γ δ c (q, a, γ Γ, w Σ and v Γ. Pop operaton: (q, aw, γv A (q, w, v for all a Σ r, q δ r (q, γ, a, γ Γ, w Σ and v Γ ; furthermore, (q, aw, ϵ A (q, w, ϵ, for all a Σ r, q δ r (q,, a and w Σ. Local operaton: (q, aw, v A (q, w, v, for all a Σ l, q δ l (q, a, w Σ and v Γ. An ntal confguraton of a VPA A = ( Σ, Γ, Q, s, F, δ c, δ r, δ l s (s, w, ϵ, where s s the start state, w s an nput word and ϵ mples an empty stack. A

4 4 Yo-Sub Han and Sang-K Ko VPA accepts a word f A arrves at the fnal state by readng the word from the ntal confguraton. Formally, we wrte the language recognzed by A 1 as L(A = {w Σ (s, w, ϵ A (q, ϵ, v for some q F, v Γ }. We call the languages recognzed by VPAs the vsbly pushdown languages. The class of vsbly pushdown languages s a strct subclass of determnstc context-free languages and a strct superclass of regular languages. Whle many closure propertes such as complement and ntersecton do not hold for contextfree languages, vsbly pushdown languages are closed under most operatons ncludng other basc operatons such as concatenaton, unon, and Kleene-star. 3 Edt-Dstance The edt-dstance between two words s the smallest number of operatons that transform a word to the other. People use dfferent edt-operatons accordng to own applcatons. We consder three basc operatons, nserton, deleton and substtuton for smplcty. Gven an alphabet Σ, let Ω = {(a b a, b Σ {λ}} be a set of edt-operatons. Namely, Ω s an alphabet of all edtoperatons for deletons (a λ, nsertons (λ a and substtutons (a b. We say that an edt-operaton (a b s a trval substtuton f a = b. We call a word ω Ω an edt strng [7] or an algnment [11]. Let the morphsm h between Ω and Σ Σ be h((a 1 b 1 (a n b n = (a 1 a n, b 1 b n, where a, b Σ {λ} for 1 n. For example, a word ω = (a λ(b b(λ c(c c over Ω s an algnment of abc and bcc, and h(ω = (abc, bcc. Thus, from an algnment ω of two words x and y, we can retreve x and y usng h: h(ω = (x, y. We assocate a non-negatve edt cost to each edt-operaton ω Ω as a functon C : ω R +. We can extend the functon to the cost C(ω of an algnment ω = ω 1 ω n as follows: C(ω = n =1 C(ω. Defnton 1. The edt-dstance d(x, y of two words x and y over Σ s the mnmal cost of an algnment ω between x and y: d(x, y = mn{c(ω h(ω = (x, y}. We say that ω s optmal f d(x, y = C(ω. Note that we use the Levenshten dstance [9] for edt-dstance. Thus, we assgn cost 1 to all edt-operatons (a λ, (λ a, and (a b for all a b Σ. We can extend the edt-dstance defnton to languages. Defnton 2. The edt-dstance d(l 1, L 2 between two languages L 1, L 2 Σ s the mnmum edt-dstance of two words, one s from L 1 and the other s from L 2 : d(l 1, L 2 = mn{d(x, y x L 1 and y L 2 }. Mohr [11] revealed that the edt-dstance between two context-free languages s undecdable from the undecdablty of the ntersecton emptness of two context-free languages. Moreover, he presented an algorthm to compute the edt-dstance between two regular languages gven by FAs of sze m and n n

5 Edt-Dstance between Vsbly Pushdown Languages 5 O(mn log mn tme. Han et al. [5] consdered the ntermedate case where one language s regular and the other language s context-free. Gven a PDA and an FA for the languages, t s shown that the problem s computable n polynomal tme whle computng an optmal algnment correspondng to the edt-dstance requres an exponental runtme. 4 Edt-Dstance between Two VPLs Frst we study the decdablty of the edt-dstance between two vsbly pushdown languages. We notce that the edt-dstance between two context-free languages s undecdable, whereas the edt-dstance between two regular languages can be computed n polynomal tme. Interestngly, t turns out that the edt-dstance between two vsbly pushdown languages s decdable. Here we show that we can compute the edt-dstance between two vsbly pushdown languages L 1 and L 2 gven by two VPAs by constructng the algnment PDA [5], whch accepts all the possble algnments between two languages of length up to k. By settng k to be the upper bound of the edt-dstance between gven two vsbly pushdown languages L 1 and L 2, we can compute the edt-dstance between L 1 and L 2 by choosng the mnmum-cost algnment accepted by the algnment PDA. The algnment PDA s frst proposed by Han et al. [5] to compute the edtdstance between a regular language and a context-free language. Gven an FA A and a PDA P, we can construct an algnment PDA A(A, P that accepts all possble algnments that transform a word accepted by the FA A to a word accepted by the PDA P. After we construct an algnment PDA for two languages, we can compute the edt-dstance between the two languages by computng the length of the shortest word accepted by the algnment PDA. Furthermore, we can obtan an optmal algnment between two languages by takng the shortest word. An nterestng pont to note s that the constructon of the algnment PDA does not mply that we can compute the edt-dstance. For example, the edtdstance between two context-free languages s undecdable even though t s possble to construct an algnment PDA wth two stacks that accepts all possble algnments between two PDAs [11]. Ths s because we cannot compute the length of the shortest word accepted by a two-stack PDA, whch can smulate a Turng machne [6]. Here we start from an dea that we do not need to consder all possble algnments between two vsbly pushdown languages to compute the edt-dstance and an optmal algnment. If we know the upper bound k of the edt-dstance between two vsbly pushdown languages, we can compute the edt-dstance and an optmal algnment by constructng an algnment PDA that accepts all possble algnments of cost up to k between two vsbly pushdown languages. Ths can be done because the stack operaton of VPAs s determned by the nput character. Assume that we have two VPAs A 1 and A 2 over the same alphabet Σ. Then, the algnment PDA A(A 1, A 2 of A 1 and A 2 smulates all possble algnments

6 6 Yo-Sub Han and Sang-K Ko between the two languages L(A 1 and L(A 2. Note that A(A 1, A 2 smulates two stacks from two VPAs smultaneously by readng each edt-operaton. Whenever A(A 1, A 2 smulates a trval edt-operaton (a a, a Σ whch substtutes a character nto the same one, the dfference n heght of two stacks does not change snce two VPAs read characters n the same class. The heght of two stacks becomes dfferent when A(A 1, A 2 reads nsertons of call (or return symbols, deletons of call (or return symbols, or substtutons between two characters n dfferent classes. For example, the heght of two stacks becomes dfferent by 1 when A(A 1, A 2 read an nserton (λ a of a call symbol a Σ c snce A 1 does not change ts stack whle A 2 s pushng a stack symbol onto ts stack. The heght of two stacks becomes dfferent the most when A(A 1, A 2 reads an edtoperaton that substtutes a call (resp. return symbol nto a return (resp. call symbol snce A 1 pushes (resp. pops a stack symbol whle A 2 pops (resp. pushes a stack symbol. Therefore, f the upper bound of the edt-dstance between two vsbly pushdown languages s k, the maxmum heght dfference between two stacks can be at most 2k whenever we smulate an algnment that costs up to k. Note that we can easly compute the upper bound of the edt-dstance between two vsbly pushdown languages by computng the shortest words from each vsbly pushdown language. Let lsw(l be the length of the shortest word n L. Proposton 3. Let L Σ and L Σ be the languages over Σ. Then, d(l, L max{lsw(l, lsw(l } holds. Now we gve the algnment PDA constructon for computng the edt-dstance between two vsbly pushdown languages. The basc dea of the constructon s to remember the top stack symbols from two stacks by usng the states of the algnment PDA. Intutvely, we store the nformaton of the top 2k stack symbols from both stacks n the states nstead of pushng nto the stack of the algnment PDA. Let A = ( Σ, Γ, Q, s, F, δ,c, δ,r, δ,l for = 1, 2 be two VPAs. We construct the algnment PDA A(A 1, A 2 = (Q E, Ω, Γ E, s E, F E, δ E, where Q E = Q 1 Q 2 Γ 2k 1 Γ 2k 2 s the set of states, Ω = {(a b a, b Σ {λ}} s the alphabet of edt-operatons, Γ E = (Γ 1 {λ} (Γ 2 {λ} \ {(λ, λ} s a fnte stack alphabet, s E = (s 1, s 2, λ, λ s the start state, and F E = F 1 F 2 Γ 2k 1 Γ 2k 2 s the set of fnal states. Now we defne the transton functon δ E. There are seven cases to consder as follows. The algnment PDA A(A 1, A 2 reads an edt-operaton that ( pushes on two stacks smultaneously, ( pushes on the frst stack, ( pushes on the second stack, (v pops from two stacks smultaneously, (v pops from the frst stack, (v pops from the second stack, and

7 Edt-Dstance between Vsbly Pushdown Languages 7 (v not perform stack operaton. Assume that x Γ 2k 1 and y Γ 2k 2. Smply, x and y are words over the stack alphabet of A 1 and A 2 whose lengths are at most 2k. For a non-empty word x over Γ 1, recall that we denote the frst character and the last character of x by x 1 and x x, respectvely. We also denote the subword that conssts of characters from x to x j by x,j, where < j. Suppose that there are transtons defned n VPAs A 1 and A 2 as follows: (q, γ δ 1,c (q, a c, [push operaton n A 1 ] q δ 1,l (q, a l, [local operaton n A 1 ] q δ 1,r (q, γ, a r, [pop operaton n A 1 ] (p, µ δ 2,c (p, b c, [push operaton n A 2 ] p δ 2,l (p, b l, and [local operaton n A 2 ] p δ 2,r (p, µ, b r. [pop operaton n A 2 ] By readng an edt-operaton (a c b c, we defne δ E to operate as follows: (q, p, xγ, yµ δ E ((q, p, x, y, (a c b c f x < 2k and y < 2k, ((q, p, x 2, x γ, y 2, y µ, (x 1, y 1 δ E ((q, p, x, y, (a c b c otherwse. By the above transtons, we smulate the push operatons on the stacks of A 1 and A 2 at the same tme. We store the nformaton of the top 2k stack symbols n the states nstead of usng real stack. If a state already contans the nformaton of 2k symbols, we start usng the stack by pushng the bottommost par of stack symbols onto the stack. We also defne δ E to operate as follows by readng an edt-operaton (a c b l : (q, p, xγ, y δ E ((q, p, x, y, (a c b l f x < 2k, ((q, p, x 2, x γ, y 2, y, (x 1, y 1 δ E ((q, p, x, y, (a c b l otherwse. Smlarly, we defne δ E for an edt-operaton (a c λ as follows: (q, p, xγ, µ δ E ((q, p, x, y, (a c λ f x < 2k, ((q, p, x 2, x γ, y 2, y, (x 1, y 1 δ E ((q, p, x, y, (a c λ otherwse. Note that the cases of readng (a l b c or (λ b c are completely symmetrc to the prevous two cases. We also consder the cases when we have to pop at least one of two stacks by readng an edt-operaton. Frst, we defne δ E for the case when we read an edt-operaton (a r b r that pops from both stacks at the same tme. (q, p, γ top x 1, x 1, µ top y 1, y 1 δ E ((q, p, x, y, (γ top, µ top, (a r b r f x x = γ, y y = µ and the top of the stack s (γ top, µ top, (q, p, x 1, x 1, y 1, y 1 δ E ((q, p, x, y, (a r b r f x x = γ, y y = µ and the stack s empty. When we smulate pop operatons on A(A 1, A 2, we remove the last stack symbols stored n the state. Then, we pop off the top of the stack, say (γ top, µ top, and move the par to the front of the stored stack symbols n the state. For the case when we have to pop only from the frst stack, we defne δ E to be as follows:

8 8 Yo-Sub Han and Sang-K Ko (q, p, γ top x 1, x 1, µ top y δ E ((q, p, x, y, (γ top, µ top, (a r b l f x = 2k, y < 2k, and the top of the stack s (γ top, µ top, (q, p, x 1, x 1, y δ E ((q, p, x, y, (a r b l otherwse. Note that x x = γ should hold for smulatng pop operatons on the frst stack. We also defne the transtons for the edt-operatons of the form (a r λ smlarly. Agan, the pop operatons on the second stack are completely symmetrc. Lastly, we defne δ E for the case when we do not touch the stack at all. There are three possble cases as follows: (q, p, x, y δ E ((q, p, x, y, (a l b l, (q, p, x, y δ E ((q, p, x, y, (a l λ, and (q, p, x, y δ E ((q, p, x, y, (λ b l. Now we prove that the constructed algnment PDA A(A 1, A 2 smulates all possble algnments of cost up to k between L(A 1 and L(A 2. Lemma 4. Gven two VPAs A 1 and A 2, t s possble to construct the algnment PDA A(A 1, A 2 that accepts all possble algnments between L(A 1 and L(A 2 of cost up to the constant k. Proof. Let us consder the smulatons of two VPAs A 1 and A 2 for an algnment ω. Gven h(ω = (x, y, the VPA A 1 has to smulate a word x whle the VPA A 2 s smulatng a word y. Suppose that x has 2k call symbols and y has k call symbols, where k < 2k, and no return symbols. Then, the stack contents of A 1 and A 2 should be γ 1 γ 2 γ 2k and µ 1 µ 2 µ k, respectvely, where γ Γ 1 for 1 2k and µ j Γ 2 for 1 j k. See Fg. 1 for llustraton of ths example. On state q n VPA A 1 γ 2k γ 2k 1. γ 2 γ 1 On state p n VPA A 2 On state (q, p, γ 1γ 2 γ 2k, µ 1µ 2 µ k n algnment PDA A(A 1, A 2 µ k. µ 2 µ 1 Fg. 1. Illustraton of how we store the nformaton of two stacks n the states of the algnment PDA A(A 1, A 2. After ths, we push the par (γ 1, µ 1 of two stack symbols n the bottom of two stacks onto the stack of A(A 1, A 2 f we read an edt-operaton (a b where a s a call symbol of A 1. Let us assume that A 1 pushes γ 2k+1 by readng a and A 2 pushes µ k +1 by readng b. Then, we push two stack symbols γ 2k+1

9 Edt-Dstance between Vsbly Pushdown Languages 9 and µ k +1 onto the smulated stacks stored n the state. See Fg. 2 to see what happens after readng (a b. q q a In VPA A 1 In VPA A 2 p γ 2k+1 γ 2k. γ 2 γ 1 p b µ k +1 µ k. µ 2 µ 1 (q, p, γ 1 γ 2k, µ 1 µ k (a b (q, p, γ 1 γ 2k+1, µ 1 µ k +1 In algnment PDA A(A 1, A 2 γ 1, µ 1 Fg. 2. Illustraton of how we store the nformaton of two stacks n the states of the algnment PDA A(A 1, A 2. Underlned stack symbols γ 2k+1 and µ k +1 are pushded by the current transtons of VPAs. In ths way, we can make the stack of A(A 1, A 2 to be always synchronzed. Note that we only push stack symbols onto the stack of A(A 1, A 2 when we need to push a stack symbol onto the stack where the smulated stack stored n the state s full. Therefore, the stack of A(A 1, A 2 should be empty f the maxmum heght of two stacks stored n the state s less than 2k. When we read an edtoperaton that pops a stack symbol from A 1 or A 2, we pop the stack symbols from the stack contents stored n the states. If the heght of the stack n the state s 2k before we pop a stack symbol, we pop a stack symbol from the top of the real stack of A(A 1, A 2 and move to the bottom of the smulated stack stored n the state of A(A 1, A 2. By storng stack nformaton n the states nstead of real stacks, A(A 1, A 2 accepts algnments where the heght dfference of two stacks durng the smulaton can be at most 2k. We menton that A(A 1, A 2 also accepts algnments of cost hgher than k f the smulaton of the algnments does not requre the stack heght dfference to be larger than 2k. Now we prove that the algnment PDA A(A 1, A 2 accepts an algnment ω, where C(ω k f and only f ω s an algnment satsfyng C(ω k and h(ω = (x, y, where x L(A 1 and y L(A 2. (= Snce A(A 1, A 2 accepts an algnment ω, where C(ω k, there exsts an acceptng computaton X ω of A(A 1, A 2 on ω endng n a state (f 1, f 2 where f 1 F 1, f 2 F 2. We assume that ω = w 1 w l, where w Ω for l. Denote the sequence of states of A(A 1, A 2 appearng n the computaton X ω just before readng the lth symbol of ω as C 0,..., C l 1, and denote the state (f 1, f 2 where the computaton ends as C l. Consder the frst component q Q 1 of the state C Q E, for 0 l, and the frst component a j Σ {λ} of the edt-operaton w j, for 1 j l. From the constructon of A(A 1, A 2, t follows that

10 10 Yo-Sub Han and Sang-K Ko (q +1, γ δ A,c (q, a +1, f a +1 Σ c q +1 δ A,l (q, a +1, f a +1 Σ l q +1 δ A,r (q, γ, a +1, and f a +1 Σ r q +1 = q. f a +1 = λ for 0 l 1. Note that the transtons of δ E readng an nserton operaton (λ b do not change the frst components of the states. Thus, the frst components of the state C 0,..., C l spell out an acceptng computaton of A 1 on the word x = a 1 a l obtaned by concatenatng the frst components of the edt-operatons of ω. Usng a smlar argument for the word y obtaned by concatenatng the second components of ω, we can show that the computaton yelds an acceptng computaton of A 2 on y. ( = Let ω = (ω L(1 ω R(1 (ω L(2 ω R(2 (ω L(l ω R(l be an algnment of length l for x = ω L(1 ω L(2 ω L(l L(A 1 and y = ω R(1 ω R(2 ω R(l L(A 2. Let C = C 0 C 1 C m, m N, be a sequence of confguratons of the VPA A 1 that traces an acceptng computaton X A,x on the word x. Assumng that C s (q, γ, the confguraton C +1 s obtaned from C by applyng a transton (q +1, γ +1 δ A (q, a, γ, where a Σ {λ}. Note that ω L(j or ω R(j may be the empty word f (ω L(j ω R(j s an edt-operaton representng an nserton or a deleton operaton. Suppose that the computaton step C C +1 consumes h empty words. Then n the sequence C after the confguraton C, we add h 1 dentcal copes of C. Then, we denote the modfed sequence of confguratons C = C 0C 1 C l, l N. Analogously, let D = D 0D 1 D l be a sequence of confguratons of the VPA A 2 that traces an acceptng computaton X B,y on the word y. From the sequences C and D, we obtan a sequence of confguratons of A(A 1, A 2 descrbng an acceptng computaton on the algnment ω. For the deleton operatons (ω L(j λ, the state s changed just n the frst component and the confguraton of A 2 remans unchanged. Recall that we have added the dentcal copes of confguratons for smulatng ths case. The deleton operatons can be smulated symmetrcally. For the substtuton operatons (ω L(j ω R(j, the computaton step smulates both a state transton of A 1 on ω L(j and a state transton of A 2 on ω R(j. Ths mples that two modfed sequences of confguratons of A 1 and A 2 can be combned to yeld an acceptng computaton of A(A 1, A 2 on ω. Let us consder the sze of the constructed algnment PDA A(A 1, A 2. Let m = Q, n = δ,c + δ,r + δ,l, and l = Γ for = 1, 2. Note that each state contans an nformaton of a par of states from A 1 and A 2, and a stack nformaton of at most 2k stack symbols of A 1 and A 2. If we represent a stack where the heght of the stack s restrcted to 2k wth a word over the stack alphabet Γ 1, we have l 1 = 2k l 1 = 1 + l 1 l2k 1 1 l 1 1

11 Edt-Dstance between Vsbly Pushdown Languages 11 possble words. Smlarly, we defne l 2 to be the number of possble words over Γ 2. Therefore, the number of states n A(A 1, A 2 s n m 1 m 2 l 1l 2 = m 1 m 2 l1 l2 The sze of the stack alphabet Γ E s l 1 l 2 snce we use all pars of the stack symbols where the frst stack symbol s from Γ 1 and the second stack symbol s from Γ 2. The sze of the transton functon δ E s m 1 m 2 n 1 n 2 l1 l2 By Lemma 4, we can obtan an algnment PDA from two VPAs A 1 and A 2 to compute the edt-dstance d(l(a 1, L(A 2. Recently, Han et al. [5] studed the edt-dstance between a PDA and an FA. The basc dea s to construct an algnment PDA from a PDA and an FA and compute the length of the shortest algnment from the algnment PDA. As a step, they present an algorthm for obtanng a shortest word and computng the length of the shortest word from a PDA. For the sake of completeness, we nclude the followng proposton. Proposton 5 (Han et al. [5]. Gven a PDA P = (Q, Σ, Γ, δ, s, Z 0, F P, we can obtan a shortest word n L(P whose length s bounded by 2 m2 l+1 n O(n 2 m2l worst-case tme and compute ts length n O(m 4 nl worst-case tme, where m = Q, n = δ and l = Γ. Now we establsh the followng runtme for computng the edt-dstance between two VPAs. Theorem 6. Gven two VPAs A = (Σ, Γ, Q, s, F, δ,c, δ,r, δ,l for = 1, 2, we can compute the edt-dstance between L(A 1 and L(A 2 n O((m 1 m 2 5 n 1 n 2 (l 1 l 2 10k worst-case tme, where m = Q, n = δ,c + δ,r + δ,l, l = Γ for = 1, 2 and k = max{lsw(l(a 1, lsw(l(a 2 }. If we replace k wth the length 2 Q 2 Γ +1 of a shortest word from a VPA from the tme complexty obtaned n Theorem 6, we have double exponental tme complexty for computng the edt-dstance between two VPAs. It s stll an open problem to fnd a polynomal algorthm for the problem or to establsh any hardness result. Instead, we can observe that the edt-dstance problem for VPAs can be computed n polynomal tme f we lmt the edt-dstance to a fxed nteger k. Corollary 7. Let A 1 and A 2 be two VPAs and k be a fxed nteger such that d(l(a 1, L(A 2 k.then, we can compute the edt-dstance between L(A 1 and L(A 2 n polynomal tme...

12 12 Yo-Sub Han and Sang-K Ko As a corollary of Theorem 6, we can also establsh the followng result. A vsbly counter automaton (VCA [3] can be regarded as a VPA wth a sngle stack symbol. It s nterestng to see that we can compute the edt-dstance between two VCAs n polynomal tme when we are gven t Corollary 8. Gven two VCAs A 1, A 2 and a postve nteger k N n unary such that d(l(a 1, L(A 2 k, we can compute the edt-dstance between L(A 1 and L(A 2 n polynomal tme. References 1. R. Alur. Marryng words and trees. In Proceedngs of the 26th ACM SIGMOD- SIGACT-SIGART Symposum on Prncples of Database Systems, PODS 07, pages , R. Alur and P. Madhusudan. Vsbly pushdown languages. In Proceedngs of the 36th Annual ACM Symposum on Theory of Computng, pages , V. Bárány, C. Lödng, and O. Serre. Regularty problems for vsbly pushdown languages. In Proceedngs of the 23rd Annual Symposum on Theoretcal Aspects of Computer Scence, pages , C. Choffrut and G. Pghzzn. Dstances between languages and reflexvty of relatons. Theoretcal Compututer Scence, 286(1: , Y.-S. Han, S.-K. Ko, and K. Salomaa. The edt-dstance between a regular language and a context-free language. Internatonal Journal of Foundatons of Computer Scence, 24(7: , J. Hopcroft and J. Ullman. Introducton to Automata Theory, Languages, and Computaton. Addson-Wesley, Readng, MA, 2nd edton, L. Kar and S. Konstantnds. Descrptonal complexty of error/edt systems. Journal of Automata, Languages and Combnatorcs, 9: , J. Leke. VPL ntersecton emptness. Bachelor s Thess, Unversty of Freburg, V. I. Levenshten. Bnary codes capable of correctng deletons, nsertons, and reversals. Sovet Physcs Doklady, 10(8: , K. Mehlhorn. Pebblng mountan ranges and ts applcaton to DCFL-recognton. In Automata, Languages and Programmng, volume 85, pages M. Mohr. Edt-dstance of weghted automata: General defntons and algorthms. Internatonal Journal of Foundatons of Computer Scence, 14(6: , B. Mozafar, K. Zeng, and C. Zanolo. From regular expressons to nested words: Unfyng languages and query executon for relatonal and xml sequences. Proceedngs of the VLDB Endowment, 3(1-2: , P. A. Pevzner. Computatonal molecular bology - an algorthmc approach. MIT Press, K. Thompson. Regular expresson search algorthm. Communcatons of the ACM, 11(6: , R. A. Wagner and M. J. Fscher. The strng-to-strng correcton problem. Journal of the ACM, 21: , D. Wood. Theory of Computaton. Harper & Row, 1987.

13 Edt-Dstance between Vsbly Pushdown Languages 13 Appendx Context-free grammar (CFG. A context-free grammar (CFG G s a fourtuple G = (V, Σ, R, S, where V s a set of varables, Σ s a set of termnals, R V (V Σ s a fnte set of productons and S V s the start varable. Let αaβ be a word over V Σ, where A V and A γ R. Then, we say that A can be rewrtten as γ and the correspondng dervaton step s denoted αaβ αγβ. A producton A t R s a termnatng producton f t Σ. The reflexve, transtve closure of s denoted by and the context-free language generated by G s L(G = {w Σ S w}. We say that a varable A V s nullable f A λ. Proposton 3. Let L Σ and L Σ be the languages over Σ. Then, holds. d(l, L max{lsw(l, lsw(l } Proof. Assume that lsw(l = m and lsw(l = n where n m. It s easy to see that the edt-dstance between two shortest words can be at most m snce we can substtute all characters of the shortest word of length n wth any subsequence of the longer word and nsert the remanng characters. Proposton 5. (Han et al. [5] Gven a PDA P = (Q, Σ, Γ, δ, s, Z 0, F P, we can obtan a shortest word n L(P whose length s bounded by 2 m2 l+1 n O(n 2 m2l worst-case tme and compute ts length n O(m 4 nl worst-case tme, where m = Q, n = δ and l = Γ. Proof. Recall that we can convert a PDA nto a CFG by the trple constructon [6]. Let us denote the CFG obtaned from P by G P. Then, G P has Q 2 Γ +1 varables and Q 2 δ productons. Moreover, each producton of G P s of the form A σbc, A σb, A σ or A λ, where σ Σ and A, B, C V. Snce we want to compute the shortest word from G P, we can remove the occurrences of all nullable varables from G P. Then, we pck a varable A that generates the shortest word t Σ among all varables and replace ts occurrence n G P wth t. We can compute the shortest word of L(P by teratvely removng occurrences of such varables. We descrbe the algorthm n Algorthm 1. Snce a producton of G P has at most one termnal followed by two varables, the length of the word to be substtuted s at most 2 m 1 when we replace mth varable. Snce we replace at most Q 2 Γ varables to have the shortest word, the length of the shortest word n L(P can be at most 2 Q 2 Γ +1. Snce there are at most 2 R occurrences of varables n R and V varables, we replace 2 R V occurrences of a gven varable on average. Therefore, the worst-case tme complexty for fndng a shortest word s O(n 2 m2l. We also note that we can compute only the length of the shortest word n O(m 4 nl worst-case tme by encodng a shortest word to be substtuted wth a bnary number.

14 14 Yo-Sub Han and Sang-K Ko Algorthm 1: ShortestLength(P Input: A PDA P = (Q, Σ, Γ, δ, s, Z 0, F P Output: lsw(l(p 1: convert P nto a CFG G P = (V, Σ, R, S by the trple constructon 2: elmnate all nullable varables 3: for B t R, where t Σ and t s mnmum among all such t n R do 4: f B = S then 5: return t 6: else 7: replace all occurrences of A n R wth t 8: remove A from V and ts productons from R 9: end f 10: end for Theorem 6. Gven two VPAs A = (Σ, Γ, Q, s, F, δ,c, δ,r, δ,l for = 1, 2, we can compute the edt-dstance between L(A 1 and L(A 2 n O((m 1 m 2 5 n 1 n 2 (l 1 l 2 10k worst-case tme, where m = Q, n = δ,c + δ,r + δ,l, l = Γ for = 1, 2 and k = max{lsw(l(a 1, lsw(l(a 2 }. Proof. In the proof of Lemma 4, we have shown that we can construct an algnment PDA A(A 1, A 2 = (Q E, Ω, Γ E, s E, F E, δ E that accepts all possble algnments between two VPAs A 1 and A 2 of length up to k. From Proposton 5, we can compute the edt-dstance n O(m 4 nl tme, where m = Q E, n = δ E and l = Γ E. Recall that m = m 1 m 2 l1 and l = l 1 l 2. Note that l 1 l2 O(l 2k 1 and, n = m 1 m 2 n 1 n 2 l2 l1 O(l 2k 2 l2 f l 1, l 2 > 0. Therefore, the tme complexty of computng the edt-dstance between two VPAs A 1 and A 2 s (m 1 m 2 5 n 1 n 2 l 1 5 l 2 5 l 1 l 2 O((m 1 m 2 5 n 1 n 2 (l 1 l 2 10k, where k s the maxmum of the length of the two shortest words from L(A 1 and L(A 2. Corollary 8. Gven two VCAs A 1, A 2 and a postve nteger k N n unary such that d(l(a 1, L(A 2 k, we can compute the edt-dstance between L(A 1 and L(A 2 n polynomal tme.,

15 Edt-Dstance between Vsbly Pushdown Languages 15 Proof. If l 1 = l 2 = 1, l 1 O(k and l2 O(k. If we replace l 2k 1 and l 2k 2 by k from the tme complexty, we obtan the tme complexty O((m 1 m 2 5 n 1 n 2 k 10 whch s polynomal n the sze of nput.

Basic Regular Expressions. Introduction. Introduction to Computability. Theory. Motivation. Lecture4: Regular Expressions

Basic Regular Expressions. Introduction. Introduction to Computability. Theory. Motivation. Lecture4: Regular Expressions Introducton to Computablty Theory Lecture: egular Expressons Prof Amos Israel Motvaton If one wants to descrbe a regular language, La, she can use the a DFA, Dor an NFA N, such L ( D = La that that Ths

More information

Turing Machines (intro)

Turing Machines (intro) CHAPTER 3 The Church-Turng Thess Contents Turng Machnes defntons, examples, Turng-recognzable and Turng-decdable languages Varants of Turng Machne Multtape Turng machnes, non-determnstc Turng Machnes,

More information

Problem Set 9 Solutions

Problem Set 9 Solutions Desgn and Analyss of Algorthms May 4, 2015 Massachusetts Insttute of Technology 6.046J/18.410J Profs. Erk Demane, Srn Devadas, and Nancy Lynch Problem Set 9 Solutons Problem Set 9 Solutons Ths problem

More information

Efficient Solutions for the Complement of ww R and the Complement of ww

Efficient Solutions for the Complement of ww R and the Complement of ww Effcent Solutons for the Complement of ww R and the Complement of ww Allaoua Refouf Computer Scence Department Unversty of Sétf Algéra allaouarefouf@unv-setfdz Journal of Dgtal Informaton Management ABSTRACT:

More information

2.3 Nilpotent endomorphisms

2.3 Nilpotent endomorphisms s a block dagonal matrx, wth A Mat dm U (C) In fact, we can assume that B = B 1 B k, wth B an ordered bass of U, and that A = [f U ] B, where f U : U U s the restrcton of f to U 40 23 Nlpotent endomorphsms

More information

The Order Relation and Trace Inequalities for. Hermitian Operators

The Order Relation and Trace Inequalities for. Hermitian Operators Internatonal Mathematcal Forum, Vol 3, 08, no, 507-57 HIKARI Ltd, wwwm-hkarcom https://doorg/0988/mf088055 The Order Relaton and Trace Inequaltes for Hermtan Operators Y Huang School of Informaton Scence

More information

Difference Equations

Difference Equations Dfference Equatons c Jan Vrbk 1 Bascs Suppose a sequence of numbers, say a 0,a 1,a,a 3,... s defned by a certan general relatonshp between, say, three consecutve values of the sequence, e.g. a + +3a +1

More information

CHAPTER 17 Amortized Analysis

CHAPTER 17 Amortized Analysis CHAPTER 7 Amortzed Analyss In an amortzed analyss, the tme requred to perform a sequence of data structure operatons s averaged over all the operatons performed. It can be used to show that the average

More information

Lecture Space-Bounded Derandomization

Lecture Space-Bounded Derandomization Notes on Complexty Theory Last updated: October, 2008 Jonathan Katz Lecture Space-Bounded Derandomzaton 1 Space-Bounded Derandomzaton We now dscuss derandomzaton of space-bounded algorthms. Here non-trval

More information

Descriptional Complexity of Determinization and Complementation for Finite Automata

Descriptional Complexity of Determinization and Complementation for Finite Automata Descrptonal Complexty of Determnzaton and Complementaton for Fnte Automata Anruddh Gandh Nan Rosemary Ke Bakhadyr Khoussanov Department of Computer Scence, Unversty of Auckland Prvate Bag 99, Auckland,

More information

20. Mon, Oct. 13 What we have done so far corresponds roughly to Chapters 2 & 3 of Lee. Now we turn to Chapter 4. The first idea is connectedness.

20. Mon, Oct. 13 What we have done so far corresponds roughly to Chapters 2 & 3 of Lee. Now we turn to Chapter 4. The first idea is connectedness. 20. Mon, Oct. 13 What we have done so far corresponds roughly to Chapters 2 & 3 of Lee. Now we turn to Chapter 4. The frst dea s connectedness. Essentally, we want to say that a space cannot be decomposed

More information

Computing Correlated Equilibria in Multi-Player Games

Computing Correlated Equilibria in Multi-Player Games Computng Correlated Equlbra n Mult-Player Games Chrstos H. Papadmtrou Presented by Zhanxang Huang December 7th, 2005 1 The Author Dr. Chrstos H. Papadmtrou CS professor at UC Berkley (taught at Harvard,

More information

College of Computer & Information Science Fall 2009 Northeastern University 20 October 2009

College of Computer & Information Science Fall 2009 Northeastern University 20 October 2009 College of Computer & Informaton Scence Fall 2009 Northeastern Unversty 20 October 2009 CS7880: Algorthmc Power Tools Scrbe: Jan Wen and Laura Poplawsk Lecture Outlne: Prmal-dual schema Network Desgn:

More information

Outline and Reading. Dynamic Programming. Dynamic Programming revealed. Computing Fibonacci. The General Dynamic Programming Technique

Outline and Reading. Dynamic Programming. Dynamic Programming revealed. Computing Fibonacci. The General Dynamic Programming Technique Outlne and Readng Dynamc Programmng The General Technque ( 5.3.2) -1 Knapsac Problem ( 5.3.3) Matrx Chan-Product ( 5.3.1) Dynamc Programmng verson 1.4 1 Dynamc Programmng verson 1.4 2 Dynamc Programmng

More information

Week 2. This week, we covered operations on sets and cardinality.

Week 2. This week, we covered operations on sets and cardinality. Week 2 Ths week, we covered operatons on sets and cardnalty. Defnton 0.1 (Correspondence). A correspondence between two sets A and B s a set S contaned n A B = {(a, b) a A, b B}. A correspondence from

More information

Calculation of time complexity (3%)

Calculation of time complexity (3%) Problem 1. (30%) Calculaton of tme complexty (3%) Gven n ctes, usng exhaust search to see every result takes O(n!). Calculaton of tme needed to solve the problem (2%) 40 ctes:40! dfferent tours 40 add

More information

Complete subgraphs in multipartite graphs

Complete subgraphs in multipartite graphs Complete subgraphs n multpartte graphs FLORIAN PFENDER Unverstät Rostock, Insttut für Mathematk D-18057 Rostock, Germany Floran.Pfender@un-rostock.de Abstract Turán s Theorem states that every graph G

More information

NP-Completeness : Proofs

NP-Completeness : Proofs NP-Completeness : Proofs Proof Methods A method to show a decson problem Π NP-complete s as follows. (1) Show Π NP. (2) Choose an NP-complete problem Π. (3) Show Π Π. A method to show an optmzaton problem

More information

Structure and Drive Paul A. Jensen Copyright July 20, 2003

Structure and Drive Paul A. Jensen Copyright July 20, 2003 Structure and Drve Paul A. Jensen Copyrght July 20, 2003 A system s made up of several operatons wth flow passng between them. The structure of the system descrbes the flow paths from nputs to outputs.

More information

Edge Isoperimetric Inequalities

Edge Isoperimetric Inequalities November 7, 2005 Ross M. Rchardson Edge Isopermetrc Inequaltes 1 Four Questons Recall that n the last lecture we looked at the problem of sopermetrc nequaltes n the hypercube, Q n. Our noton of boundary

More information

The Minimum Universal Cost Flow in an Infeasible Flow Network

The Minimum Universal Cost Flow in an Infeasible Flow Network Journal of Scences, Islamc Republc of Iran 17(2): 175-180 (2006) Unversty of Tehran, ISSN 1016-1104 http://jscencesutacr The Mnmum Unversal Cost Flow n an Infeasble Flow Network H Saleh Fathabad * M Bagheran

More information

Compilers. Spring term. Alfonso Ortega: Enrique Alfonseca: Chapter 4: Syntactic analysis

Compilers. Spring term. Alfonso Ortega: Enrique Alfonseca: Chapter 4: Syntactic analysis Complers Sprng term Alfonso Ortega: alfonso.ortega@uam.es nrque Alfonseca: enrque.alfonseca@uam.es Chapter : Syntactc analyss. Introducton. Bottom-up Analyss Syntax Analyser Concepts It analyses the context-ndependent

More information

Module 3 LOSSY IMAGE COMPRESSION SYSTEMS. Version 2 ECE IIT, Kharagpur

Module 3 LOSSY IMAGE COMPRESSION SYSTEMS. Version 2 ECE IIT, Kharagpur Module 3 LOSSY IMAGE COMPRESSION SYSTEMS Verson ECE IIT, Kharagpur Lesson 6 Theory of Quantzaton Verson ECE IIT, Kharagpur Instructonal Objectves At the end of ths lesson, the students should be able to:

More information

Errors for Linear Systems

Errors for Linear Systems Errors for Lnear Systems When we solve a lnear system Ax b we often do not know A and b exactly, but have only approxmatons  and ˆb avalable. Then the best thng we can do s to solve ˆx ˆb exactly whch

More information

Notes on Frequency Estimation in Data Streams

Notes on Frequency Estimation in Data Streams Notes on Frequency Estmaton n Data Streams In (one of) the data streamng model(s), the data s a sequence of arrvals a 1, a 2,..., a m of the form a j = (, v) where s the dentty of the tem and belongs to

More information

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan 2/21/2008. Notes for Lecture 8

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan 2/21/2008. Notes for Lecture 8 U.C. Berkeley CS278: Computatonal Complexty Handout N8 Professor Luca Trevsan 2/21/2008 Notes for Lecture 8 1 Undrected Connectvty In the undrected s t connectvty problem (abbrevated ST-UCONN) we are gven

More information

Example: (13320, 22140) =? Solution #1: The divisors of are 1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 18, 20, 27, 30, 36, 41,

Example: (13320, 22140) =? Solution #1: The divisors of are 1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 18, 20, 27, 30, 36, 41, The greatest common dvsor of two ntegers a and b (not both zero) s the largest nteger whch s a common factor of both a and b. We denote ths number by gcd(a, b), or smply (a, b) when there s no confuson

More information

8.6 The Complex Number System

8.6 The Complex Number System 8.6 The Complex Number System Earler n the chapter, we mentoned that we cannot have a negatve under a square root, snce the square of any postve or negatve number s always postve. In ths secton we want

More information

For now, let us focus on a specific model of neurons. These are simplified from reality but can achieve remarkable results.

For now, let us focus on a specific model of neurons. These are simplified from reality but can achieve remarkable results. Neural Networks : Dervaton compled by Alvn Wan from Professor Jtendra Malk s lecture Ths type of computaton s called deep learnng and s the most popular method for many problems, such as computer vson

More information

= z 20 z n. (k 20) + 4 z k = 4

= z 20 z n. (k 20) + 4 z k = 4 Problem Set #7 solutons 7.2.. (a Fnd the coeffcent of z k n (z + z 5 + z 6 + z 7 + 5, k 20. We use the known seres expanson ( n+l ( z l l z n below: (z + z 5 + z 6 + z 7 + 5 (z 5 ( + z + z 2 + z + 5 5

More information

Module 9. Lecture 6. Duality in Assignment Problems

Module 9. Lecture 6. Duality in Assignment Problems Module 9 1 Lecture 6 Dualty n Assgnment Problems In ths lecture we attempt to answer few other mportant questons posed n earler lecture for (AP) and see how some of them can be explaned through the concept

More information

A CLASS OF RECURSIVE SETS. Florentin Smarandache University of New Mexico 200 College Road Gallup, NM 87301, USA

A CLASS OF RECURSIVE SETS. Florentin Smarandache University of New Mexico 200 College Road Gallup, NM 87301, USA A CLASS OF RECURSIVE SETS Florentn Smarandache Unversty of New Mexco 200 College Road Gallup, NM 87301, USA E-mal: smarand@unmedu In ths artcle one bulds a class of recursve sets, one establshes propertes

More information

Maximizing the number of nonnegative subsets

Maximizing the number of nonnegative subsets Maxmzng the number of nonnegatve subsets Noga Alon Hao Huang December 1, 213 Abstract Gven a set of n real numbers, f the sum of elements of every subset of sze larger than k s negatve, what s the maxmum

More information

arxiv: v1 [math.co] 1 Mar 2014

arxiv: v1 [math.co] 1 Mar 2014 Unon-ntersectng set systems Gyula O.H. Katona and Dánel T. Nagy March 4, 014 arxv:1403.0088v1 [math.co] 1 Mar 014 Abstract Three ntersecton theorems are proved. Frst, we determne the sze of the largest

More information

Min Cut, Fast Cut, Polynomial Identities

Min Cut, Fast Cut, Polynomial Identities Randomzed Algorthms, Summer 016 Mn Cut, Fast Cut, Polynomal Identtes Instructor: Thomas Kesselhem and Kurt Mehlhorn 1 Mn Cuts n Graphs Lecture (5 pages) Throughout ths secton, G = (V, E) s a mult-graph.

More information

An efficient algorithm for multivariate Maclaurin Newton transformation

An efficient algorithm for multivariate Maclaurin Newton transformation Annales UMCS Informatca AI VIII, 2 2008) 5 14 DOI: 10.2478/v10065-008-0020-6 An effcent algorthm for multvarate Maclaurn Newton transformaton Joanna Kapusta Insttute of Mathematcs and Computer Scence,

More information

Kernel Methods and SVMs Extension

Kernel Methods and SVMs Extension Kernel Methods and SVMs Extenson The purpose of ths document s to revew materal covered n Machne Learnng 1 Supervsed Learnng regardng support vector machnes (SVMs). Ths document also provdes a general

More information

Module 2. Random Processes. Version 2 ECE IIT, Kharagpur

Module 2. Random Processes. Version 2 ECE IIT, Kharagpur Module Random Processes Lesson 6 Functons of Random Varables After readng ths lesson, ou wll learn about cdf of functon of a random varable. Formula for determnng the pdf of a random varable. Let, X be

More information

Lecture 3. Ax x i a i. i i

Lecture 3. Ax x i a i. i i 18.409 The Behavor of Algorthms n Practce 2/14/2 Lecturer: Dan Spelman Lecture 3 Scrbe: Arvnd Sankar 1 Largest sngular value In order to bound the condton number, we need an upper bound on the largest

More information

On the Repeating Group Finding Problem

On the Repeating Group Finding Problem The 9th Workshop on Combnatoral Mathematcs and Computaton Theory On the Repeatng Group Fndng Problem Bo-Ren Kung, Wen-Hsen Chen, R.C.T Lee Graduate Insttute of Informaton Technology and Management Takmng

More information

HMMT February 2016 February 20, 2016

HMMT February 2016 February 20, 2016 HMMT February 016 February 0, 016 Combnatorcs 1. For postve ntegers n, let S n be the set of ntegers x such that n dstnct lnes, no three concurrent, can dvde a plane nto x regons (for example, S = {3,

More information

Appendix B: Resampling Algorithms

Appendix B: Resampling Algorithms 407 Appendx B: Resamplng Algorthms A common problem of all partcle flters s the degeneracy of weghts, whch conssts of the unbounded ncrease of the varance of the mportance weghts ω [ ] of the partcles

More information

APPENDIX A Some Linear Algebra

APPENDIX A Some Linear Algebra APPENDIX A Some Lnear Algebra The collecton of m, n matrces A.1 Matrces a 1,1,..., a 1,n A = a m,1,..., a m,n wth real elements a,j s denoted by R m,n. If n = 1 then A s called a column vector. Smlarly,

More information

Perron Vectors of an Irreducible Nonnegative Interval Matrix

Perron Vectors of an Irreducible Nonnegative Interval Matrix Perron Vectors of an Irreducble Nonnegatve Interval Matrx Jr Rohn August 4 2005 Abstract As s well known an rreducble nonnegatve matrx possesses a unquely determned Perron vector. As the man result of

More information

Communication Complexity 16:198: February Lecture 4. x ij y ij

Communication Complexity 16:198: February Lecture 4. x ij y ij Communcaton Complexty 16:198:671 09 February 2010 Lecture 4 Lecturer: Troy Lee Scrbe: Rajat Mttal 1 Homework problem : Trbes We wll solve the thrd queston n the homework. The goal s to show that the nondetermnstc

More information

REAL ANALYSIS I HOMEWORK 1

REAL ANALYSIS I HOMEWORK 1 REAL ANALYSIS I HOMEWORK CİHAN BAHRAN The questons are from Tao s text. Exercse 0.0.. If (x α ) α A s a collecton of numbers x α [0, + ] such that x α

More information

Lecture 3: Shannon s Theorem

Lecture 3: Shannon s Theorem CSE 533: Error-Correctng Codes (Autumn 006 Lecture 3: Shannon s Theorem October 9, 006 Lecturer: Venkatesan Guruswam Scrbe: Wdad Machmouch 1 Communcaton Model The communcaton model we are usng conssts

More information

8.4 COMPLEX VECTOR SPACES AND INNER PRODUCTS

8.4 COMPLEX VECTOR SPACES AND INNER PRODUCTS SECTION 8.4 COMPLEX VECTOR SPACES AND INNER PRODUCTS 493 8.4 COMPLEX VECTOR SPACES AND INNER PRODUCTS All the vector spaces you have studed thus far n the text are real vector spaces because the scalars

More information

Split alignment. Martin C. Frith April 13, 2012

Split alignment. Martin C. Frith April 13, 2012 Splt algnment Martn C. Frth Aprl 13, 2012 1 Introducton Ths document s about algnng a query sequence to a genome, allowng dfferent parts of the query to match dfferent parts of the genome. Here are some

More information

CS 331 DESIGN AND ANALYSIS OF ALGORITHMS DYNAMIC PROGRAMMING. Dr. Daisy Tang

CS 331 DESIGN AND ANALYSIS OF ALGORITHMS DYNAMIC PROGRAMMING. Dr. Daisy Tang CS DESIGN ND NLYSIS OF LGORITHMS DYNMIC PROGRMMING Dr. Dasy Tang Dynamc Programmng Idea: Problems can be dvded nto stages Soluton s a sequence o decsons and the decson at the current stage s based on the

More information

find (x): given element x, return the canonical element of the set containing x;

find (x): given element x, return the canonical element of the set containing x; COS 43 Sprng, 009 Dsjont Set Unon Problem: Mantan a collecton of dsjont sets. Two operatons: fnd the set contanng a gven element; unte two sets nto one (destructvely). Approach: Canoncal element method:

More information

Transfer Functions. Convenient representation of a linear, dynamic model. A transfer function (TF) relates one input and one output: ( ) system

Transfer Functions. Convenient representation of a linear, dynamic model. A transfer function (TF) relates one input and one output: ( ) system Transfer Functons Convenent representaton of a lnear, dynamc model. A transfer functon (TF) relates one nput and one output: x t X s y t system Y s The followng termnology s used: x y nput output forcng

More information

Erratum: A Generalized Path Integral Control Approach to Reinforcement Learning

Erratum: A Generalized Path Integral Control Approach to Reinforcement Learning Journal of Machne Learnng Research 00-9 Submtted /0; Publshed 7/ Erratum: A Generalzed Path Integral Control Approach to Renforcement Learnng Evangelos ATheodorou Jonas Buchl Stefan Schaal Department of

More information

Section 8.3 Polar Form of Complex Numbers

Section 8.3 Polar Form of Complex Numbers 80 Chapter 8 Secton 8 Polar Form of Complex Numbers From prevous classes, you may have encountered magnary numbers the square roots of negatve numbers and, more generally, complex numbers whch are the

More information

arxiv: v2 [cs.ds] 1 Feb 2017

arxiv: v2 [cs.ds] 1 Feb 2017 Polynomal-tme Algorthms for the Subset Feedback Vertex Set Problem on Interval Graphs and Permutaton Graphs Chars Papadopoulos Spyrdon Tzmas arxv:170104634v2 [csds] 1 Feb 2017 Abstract Gven a vertex-weghted

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms Desgn and Analyss of Algorthms CSE 53 Lecture 4 Dynamc Programmng Junzhou Huang, Ph.D. Department of Computer Scence and Engneerng CSE53 Desgn and Analyss of Algorthms The General Dynamc Programmng Technque

More information

On the Interval Zoro Symmetric Single-step Procedure for Simultaneous Finding of Polynomial Zeros

On the Interval Zoro Symmetric Single-step Procedure for Simultaneous Finding of Polynomial Zeros Appled Mathematcal Scences, Vol. 5, 2011, no. 75, 3693-3706 On the Interval Zoro Symmetrc Sngle-step Procedure for Smultaneous Fndng of Polynomal Zeros S. F. M. Rusl, M. Mons, M. A. Hassan and W. J. Leong

More information

ANSWERS. Problem 1. and the moment generating function (mgf) by. defined for any real t. Use this to show that E( U) var( U)

ANSWERS. Problem 1. and the moment generating function (mgf) by. defined for any real t. Use this to show that E( U) var( U) Econ 413 Exam 13 H ANSWERS Settet er nndelt 9 deloppgaver, A,B,C, som alle anbefales å telle lkt for å gøre det ltt lettere å stå. Svar er gtt . Unfortunately, there s a prntng error n the hnt of

More information

Affine transformations and convexity

Affine transformations and convexity Affne transformatons and convexty The purpose of ths document s to prove some basc propertes of affne transformatons nvolvng convex sets. Here are a few onlne references for background nformaton: http://math.ucr.edu/

More information

Yong Joon Ryang. 1. Introduction Consider the multicommodity transportation problem with convex quadratic cost function. 1 2 (x x0 ) T Q(x x 0 )

Yong Joon Ryang. 1. Introduction Consider the multicommodity transportation problem with convex quadratic cost function. 1 2 (x x0 ) T Q(x x 0 ) Kangweon-Kyungk Math. Jour. 4 1996), No. 1, pp. 7 16 AN ITERATIVE ROW-ACTION METHOD FOR MULTICOMMODITY TRANSPORTATION PROBLEMS Yong Joon Ryang Abstract. The optmzaton problems wth quadratc constrants often

More information

Lecture 4: November 17, Part 1 Single Buffer Management

Lecture 4: November 17, Part 1 Single Buffer Management Lecturer: Ad Rosén Algorthms for the anagement of Networs Fall 2003-2004 Lecture 4: November 7, 2003 Scrbe: Guy Grebla Part Sngle Buffer anagement In the prevous lecture we taled about the Combned Input

More information

A combinatorial problem associated with nonograms

A combinatorial problem associated with nonograms A combnatoral problem assocated wth nonograms Jessca Benton Ron Snow Nolan Wallach March 21, 2005 1 Introducton. Ths work was motvated by a queston posed by the second named author to the frst named author

More information

Lectures - Week 4 Matrix norms, Conditioning, Vector Spaces, Linear Independence, Spanning sets and Basis, Null space and Range of a Matrix

Lectures - Week 4 Matrix norms, Conditioning, Vector Spaces, Linear Independence, Spanning sets and Basis, Null space and Range of a Matrix Lectures - Week 4 Matrx norms, Condtonng, Vector Spaces, Lnear Independence, Spannng sets and Bass, Null space and Range of a Matrx Matrx Norms Now we turn to assocatng a number to each matrx. We could

More information

U.C. Berkeley CS294: Spectral Methods and Expanders Handout 8 Luca Trevisan February 17, 2016

U.C. Berkeley CS294: Spectral Methods and Expanders Handout 8 Luca Trevisan February 17, 2016 U.C. Berkeley CS94: Spectral Methods and Expanders Handout 8 Luca Trevsan February 7, 06 Lecture 8: Spectral Algorthms Wrap-up In whch we talk about even more generalzatons of Cheeger s nequaltes, and

More information

A 2D Bounded Linear Program (H,c) 2D Linear Programming

A 2D Bounded Linear Program (H,c) 2D Linear Programming A 2D Bounded Lnear Program (H,c) h 3 v h 8 h 5 c h 4 h h 6 h 7 h 2 2D Lnear Programmng C s a polygonal regon, the ntersecton of n halfplanes. (H, c) s nfeasble, as C s empty. Feasble regon C s unbounded

More information

2E Pattern Recognition Solutions to Introduction to Pattern Recognition, Chapter 2: Bayesian pattern classification

2E Pattern Recognition Solutions to Introduction to Pattern Recognition, Chapter 2: Bayesian pattern classification E395 - Pattern Recognton Solutons to Introducton to Pattern Recognton, Chapter : Bayesan pattern classfcaton Preface Ths document s a soluton manual for selected exercses from Introducton to Pattern Recognton

More information

Subset Topological Spaces and Kakutani s Theorem

Subset Topological Spaces and Kakutani s Theorem MOD Natural Neutrosophc Subset Topologcal Spaces and Kakutan s Theorem W. B. Vasantha Kandasamy lanthenral K Florentn Smarandache 1 Copyrght 1 by EuropaNova ASBL and the Authors Ths book can be ordered

More information

COS 521: Advanced Algorithms Game Theory and Linear Programming

COS 521: Advanced Algorithms Game Theory and Linear Programming COS 521: Advanced Algorthms Game Theory and Lnear Programmng Moses Charkar February 27, 2013 In these notes, we ntroduce some basc concepts n game theory and lnear programmng (LP). We show a connecton

More information

Lecture 4: Universal Hash Functions/Streaming Cont d

Lecture 4: Universal Hash Functions/Streaming Cont d CSE 5: Desgn and Analyss of Algorthms I Sprng 06 Lecture 4: Unversal Hash Functons/Streamng Cont d Lecturer: Shayan Oves Gharan Aprl 6th Scrbe: Jacob Schreber Dsclamer: These notes have not been subjected

More information

5 The Rational Canonical Form

5 The Rational Canonical Form 5 The Ratonal Canoncal Form Here p s a monc rreducble factor of the mnmum polynomal m T and s not necessarly of degree one Let F p denote the feld constructed earler n the course, consstng of all matrces

More information

More metrics on cartesian products

More metrics on cartesian products More metrcs on cartesan products If (X, d ) are metrc spaces for 1 n, then n Secton II4 of the lecture notes we defned three metrcs on X whose underlyng topologes are the product topology The purpose of

More information

Linear, affine, and convex sets and hulls In the sequel, unless otherwise specified, X will denote a real vector space.

Linear, affine, and convex sets and hulls In the sequel, unless otherwise specified, X will denote a real vector space. Lnear, affne, and convex sets and hulls In the sequel, unless otherwse specfed, X wll denote a real vector space. Lnes and segments. Gven two ponts x, y X, we defne xy = {x + t(y x) : t R} = {(1 t)x +

More information

Foundations of Arithmetic

Foundations of Arithmetic Foundatons of Arthmetc Notaton We shall denote the sum and product of numbers n the usual notaton as a 2 + a 2 + a 3 + + a = a, a 1 a 2 a 3 a = a The notaton a b means a dvdes b,.e. ac = b where c s an

More information

CHAPTER III Neural Networks as Associative Memory

CHAPTER III Neural Networks as Associative Memory CHAPTER III Neural Networs as Assocatve Memory Introducton One of the prmary functons of the bran s assocatve memory. We assocate the faces wth names, letters wth sounds, or we can recognze the people

More information

Dynamic Programming. Preview. Dynamic Programming. Dynamic Programming. Dynamic Programming (Example: Fibonacci Sequence)

Dynamic Programming. Preview. Dynamic Programming. Dynamic Programming. Dynamic Programming (Example: Fibonacci Sequence) /24/27 Prevew Fbonacc Sequence Longest Common Subsequence Dynamc programmng s a method for solvng complex problems by breakng them down nto smpler sub-problems. It s applcable to problems exhbtng the propertes

More information

Remarks on the Properties of a Quasi-Fibonacci-like Polynomial Sequence

Remarks on the Properties of a Quasi-Fibonacci-like Polynomial Sequence Remarks on the Propertes of a Quas-Fbonacc-lke Polynomal Sequence Brce Merwne LIU Brooklyn Ilan Wenschelbaum Wesleyan Unversty Abstract Consder the Quas-Fbonacc-lke Polynomal Sequence gven by F 0 = 1,

More information

3.1 Expectation of Functions of Several Random Variables. )' be a k-dimensional discrete or continuous random vector, with joint PMF p (, E X E X1 E X

3.1 Expectation of Functions of Several Random Variables. )' be a k-dimensional discrete or continuous random vector, with joint PMF p (, E X E X1 E X Statstcs 1: Probablty Theory II 37 3 EPECTATION OF SEVERAL RANDOM VARIABLES As n Probablty Theory I, the nterest n most stuatons les not on the actual dstrbuton of a random vector, but rather on a number

More information

princeton univ. F 17 cos 521: Advanced Algorithm Design Lecture 7: LP Duality Lecturer: Matt Weinberg

princeton univ. F 17 cos 521: Advanced Algorithm Design Lecture 7: LP Duality Lecturer: Matt Weinberg prnceton unv. F 17 cos 521: Advanced Algorthm Desgn Lecture 7: LP Dualty Lecturer: Matt Wenberg Scrbe: LP Dualty s an extremely useful tool for analyzng structural propertes of lnear programs. Whle there

More information

Learning Theory: Lecture Notes

Learning Theory: Lecture Notes Learnng Theory: Lecture Notes Lecturer: Kamalka Chaudhur Scrbe: Qush Wang October 27, 2012 1 The Agnostc PAC Model Recall that one of the constrants of the PAC model s that the data dstrbuton has to be

More information

Finding Dense Subgraphs in G(n, 1/2)

Finding Dense Subgraphs in G(n, 1/2) Fndng Dense Subgraphs n Gn, 1/ Atsh Das Sarma 1, Amt Deshpande, and Rav Kannan 1 Georga Insttute of Technology,atsh@cc.gatech.edu Mcrosoft Research-Bangalore,amtdesh,annan@mcrosoft.com Abstract. Fndng

More information

Volume 18 Figure 1. Notation 1. Notation 2. Observation 1. Remark 1. Remark 2. Remark 3. Remark 4. Remark 5. Remark 6. Theorem A [2]. Theorem B [2].

Volume 18 Figure 1. Notation 1. Notation 2. Observation 1. Remark 1. Remark 2. Remark 3. Remark 4. Remark 5. Remark 6. Theorem A [2]. Theorem B [2]. Bulletn of Mathematcal Scences and Applcatons Submtted: 016-04-07 ISSN: 78-9634, Vol. 18, pp 1-10 Revsed: 016-09-08 do:10.1805/www.scpress.com/bmsa.18.1 Accepted: 016-10-13 017 ScPress Ltd., Swtzerland

More information

LECTURE 9 CANONICAL CORRELATION ANALYSIS

LECTURE 9 CANONICAL CORRELATION ANALYSIS LECURE 9 CANONICAL CORRELAION ANALYSIS Introducton he concept of canoncal correlaton arses when we want to quantfy the assocatons between two sets of varables. For example, suppose that the frst set of

More information

Appendix B. The Finite Difference Scheme

Appendix B. The Finite Difference Scheme 140 APPENDIXES Appendx B. The Fnte Dfference Scheme In ths appendx we present numercal technques whch are used to approxmate solutons of system 3.1 3.3. A comprehensve treatment of theoretcal and mplementaton

More information

Vapnik-Chervonenkis theory

Vapnik-Chervonenkis theory Vapnk-Chervonenks theory Rs Kondor June 13, 2008 For the purposes of ths lecture, we restrct ourselves to the bnary supervsed batch learnng settng. We assume that we have an nput space X, and an unknown

More information

Case A. P k = Ni ( 2L i k 1 ) + (# big cells) 10d 2 P k.

Case A. P k = Ni ( 2L i k 1 ) + (# big cells) 10d 2 P k. THE CELLULAR METHOD In ths lecture, we ntroduce the cellular method as an approach to ncdence geometry theorems lke the Szemeréd-Trotter theorem. The method was ntroduced n the paper Combnatoral complexty

More information

Multilayer Perceptron (MLP)

Multilayer Perceptron (MLP) Multlayer Perceptron (MLP) Seungjn Cho Department of Computer Scence and Engneerng Pohang Unversty of Scence and Technology 77 Cheongam-ro, Nam-gu, Pohang 37673, Korea seungjn@postech.ac.kr 1 / 20 Outlne

More information

Lecture 5 Decoding Binary BCH Codes

Lecture 5 Decoding Binary BCH Codes Lecture 5 Decodng Bnary BCH Codes In ths class, we wll ntroduce dfferent methods for decodng BCH codes 51 Decodng the [15, 7, 5] 2 -BCH Code Consder the [15, 7, 5] 2 -code C we ntroduced n the last lecture

More information

Register automata with linear arithmetic

Register automata with linear arithmetic Regster automata wth lnear arthmetc Yu-Fang Chen, Ondřej Lengál, Tony Tan and Zhln Wu Insttute of Informaton Scence, Academa Snca, Tawan FIT, Brno Unversty of Technology, IT4Innovatons Centre of Excellence,

More information

Notes on proof-nets II

Notes on proof-nets II Notes on proof-nets II Danel Murfet Most of these notes are coped from the followng paper: [BM] = Ballot, Mazza Lnear logc by levels and bounded tme complexty, 29 5/4/26 thersngseaorg/post/semnar-proofnets/

More information

Lecture Notes on Linear Regression

Lecture Notes on Linear Regression Lecture Notes on Lnear Regresson Feng L fl@sdueducn Shandong Unversty, Chna Lnear Regresson Problem In regresson problem, we am at predct a contnuous target value gven an nput feature vector We assume

More information

An Algorithm to Solve the Inverse Kinematics Problem of a Robotic Manipulator Based on Rotation Vectors

An Algorithm to Solve the Inverse Kinematics Problem of a Robotic Manipulator Based on Rotation Vectors An Algorthm to Solve the Inverse Knematcs Problem of a Robotc Manpulator Based on Rotaton Vectors Mohamad Z. Al-az*, Mazn Z. Othman**, and Baker B. Al-Bahr* *AL-Nahran Unversty, Computer Eng. Dep., Baghdad,

More information

A new construction of 3-separable matrices via an improved decoding of Macula s construction

A new construction of 3-separable matrices via an improved decoding of Macula s construction Dscrete Optmzaton 5 008 700 704 Contents lsts avalable at ScenceDrect Dscrete Optmzaton journal homepage: wwwelsevercom/locate/dsopt A new constructon of 3-separable matrces va an mproved decodng of Macula

More information

Determinants Containing Powers of Generalized Fibonacci Numbers

Determinants Containing Powers of Generalized Fibonacci Numbers 1 2 3 47 6 23 11 Journal of Integer Sequences, Vol 19 (2016), Artcle 1671 Determnants Contanng Powers of Generalzed Fbonacc Numbers Aram Tangboonduangjt and Thotsaporn Thanatpanonda Mahdol Unversty Internatonal

More information

Chapter Newton s Method

Chapter Newton s Method Chapter 9. Newton s Method After readng ths chapter, you should be able to:. Understand how Newton s method s dfferent from the Golden Secton Search method. Understand how Newton s method works 3. Solve

More information

BOUNDEDNESS OF THE RIESZ TRANSFORM WITH MATRIX A 2 WEIGHTS

BOUNDEDNESS OF THE RIESZ TRANSFORM WITH MATRIX A 2 WEIGHTS BOUNDEDNESS OF THE IESZ TANSFOM WITH MATIX A WEIGHTS Introducton Let L = L ( n, be the functon space wth norm (ˆ f L = f(x C dx d < For a d d matrx valued functon W : wth W (x postve sem-defnte for all

More information

Edit Distance with Duplications and Contractions Revisited - Supplementary Materials

Edit Distance with Duplications and Contractions Revisited - Supplementary Materials Edt Dstance wth Duplcatons and Contractons Revsted - Supplementary Materals Tamar Pnhas, Dekel Tsur, Shay Zakov, and Mchal Zv-Ukelson Department of Computer Scence Ben-Guron Unversty of the Negev, Israel

More information

Introductory Cardinality Theory Alan Kaylor Cline

Introductory Cardinality Theory Alan Kaylor Cline Introductory Cardnalty Theory lan Kaylor Clne lthough by name the theory of set cardnalty may seem to be an offshoot of combnatorcs, the central nterest s actually nfnte sets. Combnatorcs deals wth fnte

More information

Exercise Solutions to Real Analysis

Exercise Solutions to Real Analysis xercse Solutons to Real Analyss Note: References refer to H. L. Royden, Real Analyss xersze 1. Gven any set A any ɛ > 0, there s an open set O such that A O m O m A + ɛ. Soluton 1. If m A =, then there

More information

Graph Reconstruction by Permutations

Graph Reconstruction by Permutations Graph Reconstructon by Permutatons Perre Ille and Wllam Kocay* Insttut de Mathémathques de Lumny CNRS UMR 6206 163 avenue de Lumny, Case 907 13288 Marselle Cedex 9, France e-mal: lle@ml.unv-mrs.fr Computer

More information

EPR Paradox and the Physical Meaning of an Experiment in Quantum Mechanics. Vesselin C. Noninski

EPR Paradox and the Physical Meaning of an Experiment in Quantum Mechanics. Vesselin C. Noninski EPR Paradox and the Physcal Meanng of an Experment n Quantum Mechancs Vesseln C Nonnsk vesselnnonnsk@verzonnet Abstract It s shown that there s one purely determnstc outcome when measurement s made on

More information