PATTERN AVOIDANCE IN BINARY TREES

Size: px
Start display at page:

Download "PATTERN AVOIDANCE IN BINARY TREES"

Transcription

1 PATTERN AVOIDANCE IN BINARY TREES ERIC S. ROWLAND Abstrct. This pper considers the enumertion of trees voiding contiguous pttern. We provide n lgorithm for computing the generting function tht counts n-lef binry trees voiding given binry tree pttern t. Equipped with this counting mechnism, we study the nlogue of Wilf equivlence in which two tree ptterns re equivlent if the respective n-lef trees tht void them re equinumerous. We investigte the equivlence clsses combintorilly, finding some reltionships to Dyck words voiding given subword. Towrd estblishing bijective proofs of tree pttern equivlence, we develop generl method of restructuring trees tht conjecturlly succeeds to produce n explicit bijection for ech pir of equivlent tree ptterns. 1. Introduction Determining the number of words of length n on given lphbet tht void certin (contiguous) subword is clssicl combintoril problem tht cn be solved, for exmple, by the principle of inclusion exclusion. An pproch to this question using generting functions is provided by the Goulden Jckson cluster method [6, 10], which utilizes only the self-overlps (or utocorreltions ) of the word being considered. A nturl question is When do two words hve the sme voiding generting function? Tht is, when re the n-letter words voiding (respectively) w 1 nd w 2 equinumerous for ll n? The nswer is simple: precisely when their self-overlps coincide. For exmple, the equivlence clsses of length-4 words on the lphbet {0, 1} re s follows. equivlence clss self-overlp lengths {0001, 0011, 0111, 1000, 1100, 1110} {4} {0010, 0100, 0110, 1001, 1011, 1101} {1, 4} {0101, 1010} {2, 4} {0000, 1111} {1, 2, 3, 4} In this pper we consider the nlogous questions for plne trees. All trees in the pper re rooted nd ordered. The depth of vertex is the length of the miniml pth to tht vertex from the root, nd depth(t ) is the mximum vertex depth in the tree T. Our focus will be on binry trees trees in which ech vertex hs 0 or 2 (ordered) children. A vertex with 0 children is lef, nd vertex with 2 children is n internl vertex. A binry tree with n leves hs n 1 internl vertices, nd the number of such trees is the Ctln number C n 1. The first few binry trees re depicted in Figure 1. We use n indexing for n-lef binry trees tht rises from the nturl recursive construction of ll n-lef binry trees by piring ech k-lef binry tree Dte: Februry 8,

2 2 Eric Rowlnd Figure 1. The binry trees with t most 5 leves. with ech (n k)-lef binry tree, for ll 1 k n 1. In prctice it will be cler from context which tree we men by, for exmple, t 1. Conceptully, binry tree T voids tree pttern t if there is no instnce of t nywhere inside T. Steyert nd Fljolet [15] were interested in such ptterns in vertex-lbeled trees. They were minly concerned with the symptotic probbility of voiding pttern, wheres our focus is on enumertion. However, they estblish in Section 2.2 tht the totl number of occurrences of n m-lef binry tree pttern t in ll n-lef binry trees is ( ) 2n m. n m In this sense, ll m-lef binry trees re indistinguishble; the results of this pper refine this sttement by further distinguishing m-lef tree ptterns by the number of n-lef trees contining precisely k copies of ech. We remrk tht different notion of tree pttern ws lter considered by Fljolet, Sipl, nd Steyert [5], in which every lef of the pttern must be mtched by lef of the tree. Such ptterns re only mtched t the bottom of tree, so they rise nturlly in the problem of compctly representing in memory n expression contining repeted subexpressions. The enumertion of trees voiding such pttern is simple, since no two instnces of the pttern cn overlp: The number of n-lef binry trees voiding t depends only on the number of leves in t. See lso Fljolet nd Sedgewick [4, Note III.40]. The reson for studying ptterns in binry trees s opposed to rooted, ordered trees in generl is tht it is strightforwrd to determine wht it should men for binry tree to void, for exmple, t 7 =, wheres priori it is mbiguous to sy tht generl tree voids.

3 Pttern voidnce in binry trees 3 Nmely, for generl trees, mtches vertex with i children for i 1 could men either hs exctly i children or hs t lest i children. For binry trees, these re the sme for i = 2, so there is no choice to be mde. However, it turns out tht the notion of pttern voidnce for binry trees induces well-defined notion of pttern voidnce for generl trees. This rises vi the nturl bijection β between the set of n-lef binry trees nd the set of n- vertex trees; using this bijection, one simply trnsltes the problem into the setting of binry trees. One min theoreticl purpose of this pper is to provide n lgorithm for computing the generting function tht counts binry trees voiding certin tree pttern. This lgorithm esily generlizes to count trees contining prescribed number of occurrences of certin pttern, nd dditionlly we consider the number of trees contining severl ptterns ech prescribed number of times. All of these generting functions re lgebric. Section 4 is devoted to these lgorithms, which re implemented in TreePtterns [11], Mthemtic pckge vilble from the uthor s website. By contrst, nother min purpose of this pper is quite concrete, nd tht is to determine equivlence clsses of binry trees. We sy tht two tree ptterns s nd t re equivlent if for ll n 1 the number of n-lef binry trees voiding s is equl to the number of n-lef binry trees voiding t. In other words, equivlent trees hve the sme generting function with respect to voidnce. This is the nlogue of Wilf equivlence in permuttion ptterns. Ech tree is trivilly equivlent to its left right reflection, but there re other equivlences s well. The first few clsses re presented in Section 3. The ppendix contins complete list of equivlence clsses of binry trees with t most 6 leves, from which we drw exmples throughout the pper. Clsses re nmed with the convention tht clss m.i is the ith clss of m-lef binry trees. We seek to understnd equivlence clsses of binry trees combintorilly, nd this is the third purpose of the pper. By nlogy with words, one might hope for simple criterion such s s nd t re equivlent precisely when the lengths of their self-overlps coincide ; however, lthough the set of self-overlp lengths seems to be preserved under equivlence, this sttement is not true, for {1, 1, 2, 2, 5} corresponds to both clsses 6.3 nd 6.7. In lieu of simple criterion, we look for bijections. As discussed in Section 3.5, in few cses there is bijection between n-lef binry trees voiding certin pttern nd Dyck (n 1)-words voiding certin (contiguous) subword. In generl, when s nd t re equivlent tree ptterns, we would like to provide bijection between trees voiding s nd trees voiding t. Conjecturlly, ll clsses of binry trees cn be estblished bijectively by top-down nd bottom-up replcements; this is the topic of Section 5. Nerly ll bijections in the pper re implemented in the pckge TreePtterns. Aside from mthemticl interest, generl study of pttern voidnce in trees hs pplictions to ny collection of objects relted by tree structure, such s people in fmily tree or species in phylogenetic tree. In prticulr, this pper nswers the following question. Given n relted objects (e.g., species) for which the exct reltionships ren t known, how likely is it tht some prescribed (e.g., evolutionry) reltionship exists between some subset of them? (Unfortuntely, it probbly will not led to insight regrding the prcticl question Wht is the probbility of voiding mother-in-lw? ) Alterntively, we cn think of trees

4 4 Eric Rowlnd Figure 2. The Hrry Prins Tutte correspondence β between binry trees with 5 leves nd trees with 5 vertices. s describing the syntx of sentences in nturl lnguge or of frgments of computer code; in this context the pper nswers questions bout the occurrence nd frequency of given phrse substructures. 2. Definitions 2.1. The Hrry Prins Tutte bijection. We first recll fundmentl bijection between n-lef binry trees nd generl (rooted, ordered) n-vertex trees. The bijection ws given by Hrry, Prins, nd Tutte [7] nd simplified by de Bruijn nd Morselt [1]. Following Knuth [9, Section 2.3.2], we use modified version in which the trees re de-plnted. (An extr vertex is used by those uthors becuse they think of these objects s trivlent trees.) The correspondence for n = 5 is shown in Figure 2. Throughout the pper we shll cll this bijection β. Tht is, β : (set of binry trees) (set of ll trees). To obtin the n-vertex tree β(t ) ssocited with given n-lef binry tree T, contrct every rightwrd edge to single vertex. The inverse mp is little more tedious to describe; however, one simply reverses the lgorithm. To obtin the n-lef binry tree β 1 (T ) ssocited with given n- vertex tree T : (1) Delete the root vertex. (2) For ech remining vertex, let its new left child be its originl leftmost child (if it exists), nd let its new right child be its originl immedite right sibling (if it exists). (3) Add children to the existing vertices so tht ech hs two children. (If vertex hs only one child, the new child is dded in plce of the child missing in step 2.) Note tht the leves of the finl binry tree re precisely the vertices dded in this step. For exmple, T = (1) (2) (3) = β 1 (T ).

5 Pttern voidnce in binry trees 5 If T is n n-vertex tree, then clerly β 1 (T ) is binry tree, nd β 1 (T ) hs n leves becuse the n 1 vertices present in step 2 re precisely the internl vertices of β 1 (T ). Of course, β is chirl in the sense tht there is nother, eqully good bijection ρβρ β, where ρ is left right reflection (which cts by reversing the order of the children of ech vertex); but it suffices to employ just one of these bijections Avoidnce. The more forml wy to think of n n-vertex tree is s prticulr rrngement of n pirs of prentheses, where ech vertex is represented by the pir of prentheses contining its children. For exmple, the tree T = is represented by (()(()())). This is the word representtion of this tree in the lphbet {(, )}. We do not formlly distinguish between the grphicl representtion of tree nd the word representtion, nd it is the ltter tht is useful in mnipulting trees lgorithmiclly. (Mthemtic s pttern mtching cpbilities provide convenient tool for working with trees represented s nested lists, so this is the convention used by TreePtterns.) Informlly, our concept of continment is s follows. A binry tree T contins t if there is (contiguous, rooted, ordered) subtree of T tht is copy of t. For exmple, consider t =. None of the trees contins copy of t, while ech of the trees contins precisely one copy of t, ech of the trees contins precisely two (possibly overlpping) copies of t, nd the tree contins precisely three copies of t. This is clssifiction of binry trees with t most 5 leves ccording to the number of copies of t. We might formlize this concept with grph theoretic definition s follows. Let t be binry tree. A copy of t in T is subgrph of T (obtined by removing vertices) tht is isomorphic to t (preserving edge directions nd the order of children). Nturlly, T voids t if the number of copies of t in T is 0. An equivlent but much more useful definition is lnguge theoretic one, nd to provide this we first distinguish tree pttern from tree.

6 6 Eric Rowlnd By tree pttern, informlly we men tree whose leves re blnks tht cn be filled (mtched) by ny tree, not just single vertex. More precisely, let Σ = {(, )}, nd let L be the lnguge on Σ contining (the word representtion of) every binry tree. Consider binry tree τ, nd let t be the word on the three symbols (, ), L obtined by replcing ech lef () in τ by L. We cll t the tree pttern of τ. This tree pttern nturlly genertes lnguge L t on Σ, which we obtin by interpreting the word t s product of the three lnguges ( = {(}, ) = {)}, L. Informlly, L t is the set of words tht mtch t. We think of t nd L t interchngebly. (Note tht tree is tree pttern mtched only by itself.) For exmple, let τ = = (()(()())); then the corresponding tree pttern is t = (L(LL)), nd the lnguge L t consists of ll trees of the form (T (UV )), where T, U, V re binry trees. Let Σ denote the set of ll finite words on Σ. The lnguge Σ L t Σ L is the set of ll binry trees whose word hs subword in L t. Therefore we sy tht binry tree T contins the tree pttern t if T is in the lnguge Σ L t Σ L. We cn think of this lnguge s multiset, where given tree T occurs with multiplicity equl to the number of wys tht it mtches Σ L t Σ. Then the number of copies of t in T is the multiplicity of T in Σ L t Σ L. Continuing the exmple from bove, the tree T = = (()((()())(()()))) contins 2 copies of t since it mtches Σ L t Σ in 2 wys: (T (UV )) with T = () nd U = V = (()()), nd (()(T (UV ))) with T = (()()) nd U = V = (). Our nottion distinguishes tree ptterns from trees: Tree ptterns re represented by lowercse vribles, nd trees re represented by uppercse vribles. To be bsolutely precise, we would grphiclly distinguish between terminl leves () of tree nd blnk leves L of tree pttern, but this gets in the wy of speking bout them s the sme objects, which is rther convenient. In Sections 4 nd 5 we will be interested in tking the intersection p q of tree ptterns p nd q (by which we men the intersection of the corresponding lnguges L p nd L q ). The intersection of two or more explicit tree ptterns cn be computed recursively: p L = p, nd (p l p r ) (q l q r ) = ((p l q l )(p r q r )) Generting functions. Our primry gol is to determine the number n of binry trees with n vertices tht void given binry tree pttern t, nd more generlly to determine the number n,k of binry trees with n vertices nd precisely k copies of t. Thus we consider two generting functions ssocited with t: the voiding generting function Av t (x) = T voids t x number of vertices in T = n x n n=0

7 Pttern voidnce in binry trees 7 nd the enumerting generting function En L,t (x, y) = x number of vertices in T number of copies of t in T y T L = n,k x n y k. n=0 k=0 The voiding generting function is the specil cse Av t (x) = En L,t (x, 0). Theorem 1. En L,t (x, y) is lgebric. The proof is constructive, so it enbles us to compute En L,t (x), nd in prticulr Av t (x), for explicit tree ptterns. We postpone the proof until Section 4.2 to ddress nturl question tht rises: Which trees hve the sme generting function? Tht is, for which pirs of binry tree ptterns s nd t re the n-lef trees voiding (or contining k copies of) these ptterns equinumerous? We sy tht s nd t re voiding-equivlent if Av s (x) = Av t (x). We sy they re enumerting-equivlent if the seemingly stronger condition En L,s (x, y) = En L,t (x, y) holds. We cn compute these equivlence clsses explicitly by computing Av t (x) nd En L,t (x, y) for, sy, ll m-lef binry tree ptterns t. In doing this for binry trees with up to 7 leves, one comes to suspect tht these conditions re in fct the sme. Conjecture 2. If s nd t re voiding-equivlent, then they re lso enumertingequivlent. In light of this experimentl result, we focus ttention in the reminder of the pper on clsses of voiding-equivlence, since conjecturlly they re the sme s clsses of enumerting-equivlence. 3. Initil inventory nd some specil bijections In this section we undertke n nlysis of smll ptterns. We determine Av t (x) for binry tree ptterns with t most 4 leves using methods specific to ech. This llows us to estblish the equivlence clsses in this rnge lef trees. There is only one binry tree pttern with single lef, nmely t = = L. Every binry tree contins t lest one vertex, so Av t (x) = 0. The number of binry trees with 2n 1 vertices is C n 1, so En L (x) = x + x 3 + 2x 5 + 5x x x 11 + = C n 1 x 2n lef trees. There is lso only one binry tree pttern with precisely 2 leves: t = = (LL). However, t is firly fundmentl structure in binry trees; the only tree voiding it is the 1-vertex tree (). Thus Av t (x) = x, nd En L,t (x, y) = C n 1 x 2n 1 y n 1 = 1 1 4x 2 y. 2xy n=1 n=1

8 8 Eric Rowlnd lef trees. There re C 2 = 2 binry trees with 3 leves, nd they re equivlent by left right reflection: nd. There is only one binry tree with n leves voiding = ((LL)L), nmely the right comb (()(()(()(() )))). Therefore for these trees Av t (x) = x + x 3 + x 5 + x 7 + x 9 + x 11 + = x 1 x lef trees. Among 4-lef binry trees we find more interesting behvior. There re C 3 = 5 such trees, pictured s follows. They comprise 2 equivlence clsses. Clss 4.1. The first equivlence clss consists of the trees t 1 = nd t 5 =. The voiding generting function Av t (x) for ech of these trees stisfies x 3 f 2 + (x 2 1)f + x = 0 becuse the number of n-lef binry trees voiding t 1 is the Motzkin number M n 1 : Av t (x) = x + x 3 + 2x 5 + 4x 7 + 9x x 11 + = M n 1 x 2n 1. This fct is presented by Donghey nd Shpiro [3] s their finl exmple of objects counted by the Motzkin numbers. They provide bijective proof which we reformulte here. Specificlly, there is nturl bijection between the set of n-lef binry trees voiding t 1 nd the set of Motzkin pths of length n 1 pths from (0, 0) to (n 1, 0) composed of steps 1, 1, 1, 0, 1, 1 tht do not go below the x-xis. We represent Motzkin pth s word on { 1, 0, 1} encoding the sequence of steps under 1, y y. The bijection is s follows. Recll the mp β from Section 2.1. To obtin the Motzkin pth ssocited with binry tree T voiding t 1 : n=1 (1) Let T = β(t ). No vertex in T hs more thn 2 children, since β(t 1 ) = nd T voids t 1. (2) Crete word w on { 1, 0, 1} by trversing T in depth-first order (i.e., for ech subtree visit first the root vertex nd then its children trees in order); for ech vertex, record 1 less thn the number of children of tht vertex. (3) Delete the lst letter of w (which is 1).

9 Pttern voidnce in binry trees 9 The resulting word contins the sme number of 1s nd 1s, nd every prefix contins t lest s mny 1s s 1s, so it is Motzkin pth. The steps re esily reversed to provide the inverse mp from Motzkin pths to binry trees voiding t 1. (For the lrger context of this bijection, see Stnley s presenttion leding up to Theorem [14].) Clss 4.2. The second equivlence clss consists of the three trees t 2 =, t 3 =, nd t 4 = nd provides the smllest exmple of nontrivil equivlence. Symmetry gives Av t2 (x) = Av t4 (x). To estblish Av t2 (x) = Av t3 (x), for ech of these trees t we give bijection between n-lef binry trees voiding t nd binry words of length n 2. By composing these two mps we obtin bijection between trees voiding t 2 nd trees voiding t 3. First consider t 3 =. If T voids t 3, then no vertex of T hs four grndchildren; tht is, t most one of vertex s children hs children of its own. This implies tht t ech genertion t most one vertex hs children. Since there re two vertices t ech genertion fter the first, the number of such n-lef trees is 2 n 2 for n 2: Av t3 (x) = x + x 3 + 2x 5 + 4x 7 + 8x x 11 + = x + n=2 2 n 2 x 2n 1 = x(1 x2 ) 1 2x 2. Form word w {0, 1} n 2 corresponding to T by letting the ith letter be 0 or 1 depending on which vertex (left or right) on level i + 1 hs children. Now consider t 2 =. A typicl binry tree voiding t 2 looks like nd is determined by the length of its spine nd the length of ech rm. Strting from the root, trverse the internl vertices of tree T voiding t 2 ccording to the following rule. Alwys move to the right child of vertex when the right child is n internl vertex, nd if the right child is lef then move to the highest unvisited internl spine vertex. By recording 0 nd 1 for left nd right movements in this trversl, word w on {0, 1} is produced tht encodes T uniquely. We hve w = n 2 since we obtin one symbol from ech internl vertex except the root. Since every word w corresponds to n n-lef binry tree voiding t 2, there re 2 n 2 such trees.

10 10 Eric Rowlnd More formlly, let ω be mp from binry trees to binry words defined by ω((t l T r )) = κ 1 (T r )κ 0 (T l ), where { ɛ if T = () κ i (T ) = i ω(t ) otherwise. Then the word corresponding to T is w = ω(t ). For the inverse mp ω 1, begin with the word (lr). Then red w left to right. When the symbol 1 is red, replce the existing r by (()r); when 0 is red, replce the existing r by () nd the existing l by (lr). After the entire word is red, replce the remining l nd r with (). One verifies tht T hs n leves. The tree T voids t 2 becuse the left child of n r vertex never hs children of its own Bijections to Dyck words. In Section 2.2 we ssigned word on the lphbet {(, )} to ech tree. In this section we use slight vrint of this word tht is more widely used in the literture. This is the Dyck word on the lphbet {0, 1}, which differs from the forementioned word on {(, )} in tht the root vertex is omitted. For exmple, the Dyck word of is Omitting the root llows consistency with the definition of Dyck word s word consisting of n 0s nd n 1s such tht no prefix contins more 1s thn 0s. It is mnemoniclly useful to think of the letters in the Dyck word s the directions (down or up) tken long the edges in the depth-first trversl of the tree. Becuse trees nd Dyck words re essentilly the sme objects, one expects questions bout pttern voidnce in trees to hve n interprettion s questions bout pttern voidnce in Dyck words. Specificlly, the set of trees voiding certin tree pttern corresponds to the set of Dyck words voiding (not necessrily contiguous) word pttern. This is simply consequence of the bijection between trees nd Dyck words. However, in some cses there is stronger reltionship: The set of trees voiding certin pttern is in nturl bijection to the set of Dyck words voiding certin contiguous subword. This reltionship is the subject of the current section, in which we give severl such bijections. For ech equivlence clss of trees we will be content with one bijection to Dyck words, lthough in mny cses there re severl. Notes on sequences counting Dyck words voiding subword hve been contributed by Dvid Clln nd Emeric Deutsch to the Encyclopedi of Integer Sequences [13]. The subject ppers to hve begun with Deutsch [2, Section 6.17], who enumerted Dyck words ccording to the number of occurrences of the subword 100. Spounkis, Tsouls, nd Tsikours [12] hve considered dditionl subwords. Vi the bijections described below, their results provide dditionl derivtions of the generting functions Av t (x). In Section 3.4 we observed tht trees voiding tree pttern in clss 4.1 re in bijection to Motzkin pths. From here it is esy to estblish bijection to Dyck words voiding the subword 000. Simply pply the morphism 1 001, 0 01, 1 1

11 Pttern voidnce in binry trees 11 to the Motzkin pth. Clerly the resulting word hs no instnce of 000, nd it is Dyck word becuse 1 nd 1 occur in pirs in Motzkin pth, with every prefix contining t lest s mny 1s s 1s. A different nd more direct bijection to Dyck words voiding 000 (nd the one tht we will generlize to other tree ptterns) cn be obtined s follows. Consider the 4-lef binry tree t 5 = ; then β(t 5 ) =, whose Dyck word is The mp β of Section 2.1 preserves certin feture of ny binry tree T contining t 5 : β(t ) contins sequence of four vertices in which ech of the lower three is the first child of the previous. In other words, let T be tree obtined by replcing the leves of t 5 with ny binry trees. Then β(t ) is obtined from β(t 5 ) by dding vertices s either children or right siblings never s left siblings to those in β(t 5 ). Therefore 000 is chrcteristic of t 5 in the sense tht T contins t 5 if nd only if the Dyck word of β(t ) contins 000. And of course this bijection works for ny left comb (i.e., clss m.1 for ll m): The binry trees voiding the m-lef left comb re in bijection to Dyck words voiding 0 m 1. In generl there is nturl bijection between n-lef binry trees voiding t nd (n 1)-Dyck words voiding w whenever w is chrcteristic feture of β(t) (tht is, some feture of the tree tht is preserved loclly by β). For exmple, for the binry trees in clss 4.2 we hve ( ) ( ) ( ) β =, β =, β =. Which of these ptterns hve bijection to Dyck words? Consider the third tree, = While it is true tht ny tree contining this tree must contin 001, the converse is not true, so this tree does not dmit bijection to Dyck words. However, the two trees = nd = contin the word 100 nd its reverse complement 110 respectively, nd contining one of these subwords is necessry nd sufficient condition for the corresponding tree to contin the respective tree pttern. Thus binry trees voiding tree pttern in clss 4.2 re in bijection to Dyck words voiding 100. Bijections for other ptterns cn be found similrly. Binry trees voiding tree pttern in clss 5.2 re in bijection to Dyck words voiding 1100, vi ( ) β =. Clss 5.3 corresponds to 1000 vi ( ) β =.

12 12 Eric Rowlnd Clss 6.3 corresponds to nd clss 6.6 to vi ( ) β = nd β = respectively. It is pprent tht results of this kind involve two-pronged trees becuse voidnce for these trees corresponds to locl condition on Dyck words. It should not be surprising then tht not ll equivlence clsses of binry trees hve corresponding Dyck word clss. For exmple, clsses 6.2, 6.4, 6.5, nd 6.7 do not. The lck of Dyck word clss cn be proven in ech cse by exhibiting n n such tht the number of n-lef binry trees voiding t is not equl to the number of (n 1)-Dyck words voiding w for ll w; only finite mount of computtion is required becuse ll C n 1 (n 1)-Dyck words void w for w > 2(n 1). For exmple, n = 8 suffices for clsses 6.2 nd Algorithms In this section we provide lgorithms for computing lgebric equtions stisfied by Av t (x), En L,t (x, y), nd the more generl En L,p1,...,p k (x L, x p1,..., x pk ) defined in Section 4.3. Computing Av t (x) or En L,t (x, y) for ll m-lef binry tree ptters t llows one to utomticlly determine the equivlence clsses given in the ppendix. We drw upon the nottion introduced in Section 2.2. In prticulr, the intersection p p of two tree ptterns plys centrl role. Recll tht L p is the set of trees mtching p t the top level Avoiding single tree. Fix binry tree pttern t we wish to void. For given tree pttern p, we will mke use of the generting function weight(p) = weight(l p ) := T L p weight(t ), where weight(t ) = { number of vertices in T x if T voids t 0 if T contins t. The cse t = L ws covered in Section 3.1, so we ssume t L. Then t = (t l t r ) for some tree ptterns t l nd t r. Since (T l T r ) mtches t precisely when T l mtches t l nd T r mtches t r, we hve (1) weight((p l p r )) = x (weight(p l ) weight(p r ) weight(p l t l ) weight(p r t r ) ). The coefficient x is the weight of the root vertex of (p l p r ) tht we destroy in seprting this pttern into its two subptterns. We now construct polynomil (with coefficients tht re polynomils in x) tht is stisfied by Av t (x) = weight(l), the weight of the lnguge of binry trees. The lgorithm is s follows. Begin with the eqution weight(l) = weight(()) + weight((ll)).

13 Pttern voidnce in binry trees 13 The vrible weight((ll)) is new ; we hven t yet written it in terms of other vribles. So use Eqution (1) to rewrite weight((ll)). For ech expression weight(p p ) tht is introduced, we compute the intersection p p. This llows us to write weight(p p ) s weight(q) for some pttern q tht is simply word on {(, ), L} (i.e., does not contin the opertor). For ech new vrible weight(q), we obtin new eqution by mking it the left side of Eqution (1), nd then s before we eliminte by explicitly computing intersections. We continue in this mnner until there re no new vribles produced. This must hppen becuse depth(p p ) = mx(depth(p), depth(p )), so since there re only finitely mny trees tht re shllower thn t, there re only finitely mny vribles in this system of polynomil equtions. Finlly, we compute Gröbner bsis for the system in which ll vribles except weight(()) = x nd weight(l) = Av t (x) re eliminted. This gives single polynomil eqution in these vribles, estblishing tht Av t (x) is lgebric. Let us work out n exmple. We use the grphicl representtion of tree ptterns with the understnding tht the leves re blnks. Consider the tree pttern t = = (L(L((LL)L))) from clss 5.2. The first eqution is weight( ) = x + weight( ). We hve t l = nd t r =, so Eqution (1) gives weight( ) = x (weight( ) weight( ) weight( ) weight( ) ) = x (weight( ) 2 weight( ) weight( ) ) since L p = p for ny tree pttern p. The vrible weight( ) = weight(t r ) is new, so we put it into Eqution (1): weight( ) = x (weight( ) weight( ) weight( ) weight( ) ) = x (weight( ) weight( ) weight( ) weight( ) ). There re two new vribles: weight( ) = x (weight( ) weight( ) weight( ) weight( ) ) = x (weight( ) weight( ) weight( ) weight( ) ) ; weight( ) = x (weight( ) weight( ) weight( ) weight( ) ) = x (weight( ) weight( ) weight( ) weight( ) ). We hve no new vribles, so we eliminte the four uxiliry vribles weight( ), weight( ), weight( ), weight( ) from this system of five equtions to obtin x 3 weight( ) 2 (x 2 1) 2 weight( ) x (x 2 1) = 0.

14 14 Eric Rowlnd 4.2. Enumerting with respect to single tree. To prove Theorem 1, we mke few modifictions in order to compute En L,t (x, y) insted of Av t (x). Agin weight(p) := T L p weight(t ), but now weight(t ) = x number of vertices in T y number of copies of t in T for ll T. We modify Eqution (1) to become (2) weight((p l p r )) = x (weight(p l ) weight(p r ) + (y 1) weight(p l t l ) weight(p r t r ) ) since in ddition to ccounting for the trees tht void t we lso ccount for those tht mtch t, in which cse y is contributed. The rest of the lgorithm crries over unchnged, nd we obtin polynomil eqution in x, y, nd En L,t (x, y) = weight(l) Enumerting with respect to multiple trees. A more generl question is the following. Given severl binry tree ptterns p 1,..., p k, wht is the number n0,n 1,...,n k of binry trees contining precisely n 0 vertices, n 1 copies of p 1,..., n k copies of p k? We consider the enumerting generting function En L,p1,...,p k (x L, x p1,..., x pk ) = T L x α0 L xα1 p 1 x α k p k = n 0=0 n 1=0 n k =0 n0,n 1,...,n k x n0 L xn1 p 1 x n k p k, where p 0 = L nd α i is the number of copies of p i in T. (We need not ssume tht the p i re distinct.) This generting function cn be used to obtin informtion bout how correlted fmily of tree ptterns is. We hve the following generliztion of Theorem 1. Theorem 3. En L,p1,...,p k (x L, x p1,..., x pk ) is lgebric. Keeping trck of multiple tree ptterns p 1,..., p k is not much more complicted thn hndling single pttern, nd the lgorithm for doing so hs the sme outline. Let weight(p) := T L p weight(t ) with weight(t ) = x α0 L xα1 p 1 x α k p k, where gin α i is the number of copies of p i in T. Let d = mx 1 i k depth(p i ). First we describe wht to do with ech new vrible weight(q) tht rises. The pproch used is different thn tht for one tree pttern; in prticulr, we do not mke use of intersections. Consequently, it is less efficient. Let l be the number of leves in q. If T is tree mtching q, then for ech lef L of q there re two possibilities: Either L is mtched by terminl vertex () in T, or L is mtched by tree mtching (LL). For ech lef we mke this choice independently, thus prtitioning the lnguge L q into 2 l disjoint sets represented by 2 l tree ptterns tht re disjoint in the sense tht ech tree mtching q mtches

15 Pttern voidnce in binry trees 15 precisely one of these ptterns. For exmple, prtitioning the pttern (LL) into 2 2 ptterns gives weight((ll)) = weight((()())) + weight((()(ll))) + weight(((ll)())) + weight(((ll)(ll))). We need n nlogue of Eqution (2) for splitting pttern (p l p r ) into the two subptterns p l nd p r. For this, exmine ech of the 2 l ptterns tht rose in prtitioning q. For ech pttern p = (p l p r ) whose lnguge is infinite (tht is, the word p contins the symbol L) nd hs depth(p) d, rewrite weight(p) = weight(p l ) weight(p r ) x pi, 0 i k p mtches p i where p mtches p i mens tht every tree in L p mtches p i (so L p L pi ). If L p is infinite but depth(p) < d, keep weight(p) intct s vrible. Finlly, for ll tree ptterns p whose lnguge is finite (i.e., p is tree), rewrite weight(p) = 0 i k number of copies of pi in p xp i. The lgorithm is s follows. As before, begin with the eqution weight(l) = weight(()) + weight((ll)). At ech step, tke ech new vrible weight(q) nd obtin nother eqution by performing the procedure described: Write it s the sum of 2 l other vribles, split the designted ptterns into subptterns, nd explicitly compute the weights of ny trees ppering. Continue in this mnner until there re no new vribles produced; this must hppen becuse we brek up weight(p) whenever depth(p) d, so there re only finitely mny possible vribles. Eliminte from this system of polynomil equtions ll but the k +2 vribles weight(()) = x L, x p1,..., x pk, nd weight(l) = En L,p1,...,p k (x L, x p1,..., x pk ) to obtin polynomil eqution stisfied by En L,p1,...,p k (x L, x p1,..., x pk ). 5. Replcement bijections In this section we ddress the question of providing systemtic bijective proofs of voiding-equivlence. Given two equivlent binry tree ptterns s nd t, we would like to produce n explicit bijection between binry trees voiding s nd binry trees voiding t. It turns out tht this cn often be chieved by structurl replcements on trees. We strt by describing n exmple in full, nd lter generlize An exmple replcement bijection. Consider the trees t 2 = nd t 3 = in clss 4.2. The ide is tht since n-lef trees voiding t 2 re in bijection to n-lef trees voiding t 3, then somehow swpping ll occurrences of these two tree ptterns should produce bijection. However, since the ptterns my overlp, it is necessry to specify n order in which to perform the replcements. A nturl order is to strt with the root nd work down the tree. More precisely, top-down replcement is restructuring of tree T in which we itertively pply set of trnsformtion rules to subtrees of T, working downwrd from the root.

16 16 Eric Rowlnd Tke the replcement rule to be c, where the vribles represent trees ttched t the leves, rerrnged ccording to the permuttion Begin t the root: If T itself mtches the left side of the rule, then we restructure T ccording to the rule; if not, we leve T unchnged. Then we repet the procedure on the root s (new) children, then on their children, nd so on, so tht ech vertex in the tree is tken to be the root of subtree which is possibly trnsformed by the rule. For exmple, shows the three replcements required to compute the imge (on the right) of tree voiding t 2. The resulting tree voids t 3. This top-down replcement is invertible. The inverse mp is bottom-up replcement with the inverse replcement rule, b b Rther thn strting t the root nd working down the tree, we pply this mp by strting t the leves nd working up the tree. We now show tht the top-down replcement is in fct bijection from trees voiding t 2 to trees voiding t 3. It turns out to be the sme bijection given in Section 3.4 vi words in {0, 1} n 2. Assume T voids t 2 ; we show tht the imge of T under the top-down replcement voids t 3. It is helpful to think of T s broken up into (possibly overlpping) spheres of influence subtrees which re mximl with respect to the replcement rule in the sense tht performing the top-down replcement on the subtree does not introduce instnces of the relevnt tree ptterns contining vertices outside of the subtree. It suffices to consider ech sphere of influence seprtely. A nturl focl point for ech sphere of influence is the highest occurrence of t 3. We verify tht restructuring this t 3 to t 2 under the top-down replcement produces no t 3 bove, t, or below the root of the new t 2 in the imge of T. bove: Since t 3 hs depth 2, t 3 cn occur t most one level bove the root of the new t 2 while overlpping it. Thus it suffices to consider ll subtrees with t 3 occurring t level 1. There re two cses,. e nd The first cse does not void t 2, so it does not occur in T. The second cse my occur in T. However, we do not wnt the subtree itself to mtch t 3 (becuse we ssume tht the t 3 t level 1 is the highest t 3 in this sphere of e.

17 Pttern voidnce in binry trees 17 influence), so we must hve e = (). Thus this subtree is trnsformed by the top-down replcement s c The imge does not mtch t 3 t the root, so t 3 does not pper bove the root of the new t 2. t: Since T voids t 2, every subtree in T mtching t 3 in fct mtches the pttern ((LL)(()L)). Such subtree is restructured s. d under the replcement rule, nd the imge does not mtch t 3 (becuse c = () is terminl). Therefore the new t 2 cnnot itself mtch t 3. below: A generl subtree mtching t 3 nd voiding t 2 is trnsformed s b b b. Clerly t 3 cn only occur in the imge t or below the subtree (b). However, since (b) is preserved by the replcement rule, ny trnsformtions on (b) cn be considered independently. Tht is, (b) is the top of different sphere of influence, so we need not consider it here. We conclude tht t 3 does not occur below the root of the new t 2. If we lredy knew tht t 2 nd t 3 re equivlent (for exmple, by hving computed Av t (x) s in Section 4.1), then we hve now obtined bijective proof of their equivlence. Otherwise, it remins to show tht if T voids t 3, then performing the bottom-up replcement produces tree tht voids t 2 ; this cn be ccomplished similrly Generl replcement bijections. A nturl question is whether for ny two equivlent binry tree ptterns s nd t there exists sequence of replcement bijections nd left right reflections tht estblishes their equivlence. For tree ptterns of t most 7 leves the nswer is Yes, which perhps suggests tht these mps suffice in generl. Conjecture 4. If s nd t re equivlent, then there is sequence of top-down replcements, bottom-up replcements, nd left right reflections tht produces bijection from binry trees voiding s to binry trees voiding t. In this section we discuss qulittive results regrding this conjecture. Given two m-lef tree ptterns s nd t, one cn sk which permuttions of the leves give rise to top-down replcement tht induces bijection from trees b

18 18 Eric Rowlnd voiding s to trees voiding t. Most permuttions re not vible. Cndidte permuttions cn be found experimentlly by simply testing ll m! permuttions of leves on set of rndomly chosen binry trees voiding s; one checks tht the imge voids t nd tht composing the top-down replcement with the inverse bottom-up replcement produces the originl tree. This pproch is fesible for smll m, but it is slow nd does not provide ny insight into why certin trees re equivlent. A question unresolved t present is to efficiently find ll such bijections. The nive method ws used to find the exmples in this section. Once cndidte bijection is found, it cn be proved in mnner similr to Section 5.1. Although we do not ttempt here to fully generlize tht rgument, the following two exmples provide n indiction of the issues encountered in the bove nd below cses of the generl setting. As n exmple of wht cn go wrong in the bove cse, consider the rule b b given by the permuttion 2314 on 4-lef binry trees s = t 3 nd t = t 2. This rule does not induce top-down replcement bijection from trees voiding t 3 to trees voiding t 2. One obstruction is the mpping. The initil tree voids t 3. However, it contins t 2, nd replcing this t 2 with t 3 completes nother t 2. The finl tree does not void t 2. In generl, for the bove cse it suffices to check ll trees voiding s of certin depth where the highest t begins t level depth(t) 1. A bound on the depth is possible since for given set of replcement rules there is mximum depth t which the structure of subtree cn ffect the top depth(t) + 1 levels of the imge. If, fter performing the top-down replcement on these trees, no t ppers bove level depth(t) 1, then t cn never pper bove the root of the highest t in the subtree. An exmple of wht cn go wrong in the below cse is provided by the rule b d given by the permuttion 1423 on 4-lef binry trees s = t 1 nd t = t 2. This rule does not induce top-down replcement bijection from trees voiding t 1 to trees voiding t 2. (Indeed, these ptterns re not equivlent.) One obstruction is the mpping. The initil tree voids t 1. However, it mtches t 2, nd replcing this t 2 with t 1 produces copy of the intersection t 1 t 2 in the intermedite step. The t 2 is then replced by t 1, but this does not chnge the tree becuse t 1 t 2 is fixed by the rule. Therefore the finl tree does not void t 2.

19 Pttern voidnce in binry trees 19 A generl proof for the below cse must tke into ccount ll wys of producing, below the root of the highest t in subtree, copy t of tht is not broken by further replcements. We now return briefly to the replcement rule of Section 5.1 to mention tht minor modifiction produces bijection on the full set of binry trees. Nmely, tke the two replcement rules c nd b b. Agin we perform top-down replcement, now using both rules together. Tht is, if subtree mtches the left side of either rule, we restructure it ccording to tht rule. Of course, it cn hppen tht prticulr subtree mtches both replcement rules, resulting in potentil mbiguity; in this cse which do we pply? Well, if both rules result in the sme trnsformtion, then it does not mtter, nd indeed with our present exmple this is the cse. To show this, it suffices to tke the intersection t 2 t 3 of the two left sides nd lbel the leves to represent dditionl brnches tht my be present: p 1 p 2. Now we check tht pplying ech of the two replcement rules to this tree produces the sme lbeled tree, nmely p 3 p 4. Therefore we need not concern ourselves with which rule is pplied to given subtree tht mtches both. Since the replcement rules gree on their intersection, the top-down replcement is gin invertible nd is therefore bijection from the set of binry trees to itself. By the exmintion of cses in Section 5.1, this bijection is n extension of the bijection between binry trees voiding t 2 nd binry trees voiding t 3. Thus we my choose from two types of bijection when serching for top-down replcement bijections tht prove voiding-equivlence. The first type is from binry trees voiding s to binry trees voiding t, using one rule for the top-down direction nd the inverse for the bottom-up direction; these bijections in generl do not extend to bijections on the full set of binry trees. The second type is bijection on the full set of binry trees, using both rules in ech direction, tht induces bijection from binry trees voiding s to binry trees voiding t. Empiriclly, ech two-rule bijection tht proves voiding-equivlence for s nd t induces one-rule bijection proving this equivlence, s in the previous exmple. However, not ll two-rule bijections, when restricted to one rule, become bijections tht prove voiding-equivlence; the rules used to discuss the bove nd below cses in this section re two counterexmples. One benefit to serching for two-rule bijections is tht requiring the two replcement rules to gree on the lef-lbeled intersection s t quickly prunes the set of cndidte permuttions. There is trdeoff, however, becuse verifying two-rule bijection is more complicted thn verifying one-rule bijection.

20 20 Eric Rowlnd t 2 t 3 t 4 t 6 t 7 t 8 t 9 t 11 t 12 t 13 t t t t t t t t t t Tble 1. Lef permuttions whose two-rule replcements prove voiding-equivlence for pirs of trees in clss 5.2. Serching for two-rule bijections on 4-lef binry tree ptterns, one finds only the rules given by the permuttion 3124 for s = t 2 nd t = t 3, mentioned bove, nd their left right reflections, given by 1342 for s = t 4 nd t = t 3. (Note the symmetry here: There is top-down replcement bijection from trees voiding t 2 to trees voiding t 3 but not vice vers.) However, this does not ccount for ll top-down replcement bijections for these ptterns. The permuttion 3142 for s = t 2 nd t = t 3 nd its left right reflection 3142 for s = t 4 nd t = t 3 provide one-rule bijections tht do not extend to ll binry trees. Among equivlence clsses of 5-lef binry tree ptterns, clss 5.2 is the only clss contining nontrivil equivlences. It consists of the ten trees t 2, t 3, t 4, t 6, t 7, t 8, t 9, t 11, t 12, nd t 13, pictured s follows. For ech pir of trees in this clss, Tble 1 lists the lef permuttions tht prove equivlence by two-rule top-down replcement. It hppens tht there is t most one permuttion for ech pir in this clss, lthough in generl there my be more. With this dt, one might suspect tht two-rule replcement bijections re sufficient to estblish every equivlence clss of binry tree ptterns. In fct they re not. The smllest counterexmple is clss 7.15, which consists of the three trees t 61 =, t 65 =, nd t 81 = nd their left right reflections. Trees t 81 nd t 61 re equivlent by the permuttion , but no permuttion of leves produces two-rule replcement bijection tht estblishes the equivlence of t 65 to one of the others. However, the permuttions nd provide cndidte one-rule bijections for t 65 nd t 61, nd provides cndidte bijection for t 65 nd t 81. We conclude with curious exmple in which two tree ptterns cn only be proven equivlent by two-rule bijection tht does not involve them directly. The

21 Pttern voidnce in binry trees 21 trees t 7 = nd t 11 = in clss 6.5 re voiding-equivlent by the permuttion , but neither t 17 = nor its left right reflection hs n equivlence-proving permuttion to t 7, t 11, or their left right reflections. Thus, this equivlence cnnot be estblished by bijection tht swps 6-lef tree ptterns. However, it cn be estblished by bijection tht swps 4-lef tree ptterns: The previously mentioned bijection consisting of the two replcement rules c nd b b induces top-down replcement bijection from trees voiding t 7 to trees voiding t 17. The reson is tht t 7 nd t 17 re formed by two overlpping copies of the clss 4.2 trees nd respectively, nd tht t 7 nd t 17 re mpped to ech other under this bijection. Acknowledgements I thnk Phillipe Fljolet for helping me understnd some existing literture, nd I thnk Lou Shpiro for suggestions which clrified some points in the pper. Thnks to the referee for the reference to Stnley s book. I m indebted to Elizbeth Kupin for much vluble feedbck. Her comments gretly improved the exposition nd redbility of the pper. In ddition, the ide of looking for one-rule bijections tht do not extend to bijections on the full set of binry trees is hers, nd this turned out to be n importnt generliztion of the two-rule bijections I hd been considering. Appendix. Tble of equivlence clsses This ppendix lists equivlence clsses of binry trees with t most 6 leves. Left right reflections re omitted for compctness. For ech clss we provide polynomil eqution stisfied by f = En L,t (x, y); n eqution stisfied by Av t (x) is obtined in ech cse by letting y = 0. The dt ws computed by the Mthemtic pckge TreePtterns [11] using Singulr vi the interfce pckge by Mnuel Kuers nd Viktor Levndovskyy [8]. Pre-computed dt extended to 8-lef binry trees is now lso vilble in TreePtterns. The number of equivlence clsses of m-lef binry trees for m = 1, 2, 3,... is 1, 1, 1, 2, 3, 7, 15, 44,...., Clss 1.1 (1 tree). xyf 2 f + xy = 0

22 22 Eric Rowlnd Clss 2.1 (1 tree). Clss 3.1 (2 trees). xyf 2 f + x = 0 Clss 4.1 (2 trees). xyf 2 + ( x 2 (y 1) 1 ) f + x = 0 Clss 4.2 (3 trees). ( xy x 3 (y 1) ) f 2 + ( x 2 (y 1) 1 ) f + x = 0 Clss 5.1 (2 trees). xyf 2 + ( 2x 2 (y 1) 1 ) f + ( x 3 (y 1) + x ) = 0 Clss 5.2 (10 trees). x 4 (y 1)f 3 + ( xy x 3 (y 1) ) f 2 + ( x 2 (y 1) 1 ) f + x = 0 Clss 5.3 (2 trees). ( xy x 3 (y 1) ) f 2 + ( x 2 ( x 2 2 ) (y 1) 1 ) f + ( x 3 (y 1) + x ) = 0 Clss 6.1 (2 trees). xyf 3 + ( 3x 2 (y 1) 1 ) f 2 + ( 3x 3 (y 1) + x ) f x 4 (y 1) = 0 x 5 (y 1)f 4 x 4 (y 1)f 3 + ( xy x 3 (y 1) ) f 2 + ( x 2 (y 1) 1 ) f + x = 0 Clss 6.2 (8 trees). x 4 (y 1)f 3 + x ( x 2 ( x 2 1 ) (y 1) + y ) f 2 + ( x 2 ( x 2 2 ) (y 1) 1 ) f + ( x 3 (y 1) + x ) = 0

23 Pttern voidnce in binry trees 23 Clss 6.3 (14 trees). x ( x 2 ( x 2 2 ) (y 1) + y ) f 2 + ( 2x 2 ( x 2 1 ) (y 1) 1 ) f + ( x 3 (y 1) + x ) = 0 Clss 6.4 (8 trees). ( xy x 3 (y 1) ) f 3 + ( x 2 ( 2x 2 3 ) (y 1) 1 ) f 2 + ( x 5 (y 1) + 3x 3 (y 1) + x ) f x 4 (y 1) = 0 Clss 6.5 (6 trees). ( xy 2x 3 (y 1) ) f 2 + ( x 2 ( 3x 2 2 ) (y 1) 1 ) f + ( x 5 (y 1) + x 3 (y 1) + x ) = 0 Clss 6.6 (2 trees). xyf 4 + ( 4x 2 (y 1) + 1 ) f 3 + ( 6x 3 (y 1) x ) f 2 + 4x 4 (y 1)f x 5 (y 1) = 0 Clss 6.7 (2 trees). x 4 ( x 2 (y 1) y ) (y 1)f 3 + ( 2x 7 (y 1) 2 + x 5 (y 1)(3y 2) x 3 (y 1) + xy ) f 2 + ( x 2 ( x 6 (y 1) 3x 4 (y 1) + x 2 2 ) (y 1) 1 ) f + ( x 7 (y 1) 2 + x 3 (y 1) + x ) = 0 References [1] Nicols de Bruijn nd B. J. M. Morselt, A note on plne trees, Journl of Combintoril Theory 2 (1967) [2] Emeric Deutsch, Dyck pth enumertion, Discrete Mthemtics 204 (1999) [3] Robert Donghey nd Louis Shpiro, Motzkin numbers, Journl of Combintoril Theory, Series A 23 (1977) [4] Philippe Fljolet nd Robert Sedgewick, Anlytic Combintorics, Cmbridge University Press, [5] Philippe Fljolet, Polo Sipl, nd Jen-Mrc Steyert, Anlytic vritions on the common subexpression problem, Lecture Notes in Computer Science: Automt, Lnguges, nd Progrmming 443 (1990) [6] In Goulden nd Dvid Jckson, An inversion theorem for cluster decompositions of sequences with distinguished subsequences, Journl of the London Mthemticl Society (second series) 20 (1979) [7] Frnk Hrry, Geert Prins, nd Willim Tutte, The number of plne trees, Indgtiones Mthemtice 26 (1964)

24 24 Eric Rowlnd [8] Mnuel Kuers nd Viktor Levndovskyy, Singulr [ Mthemtic pckge], vilble from [9] Donld Knuth, The Art of Computer Progrmming, second edition, Volume 1: Fundmentl Algorithms, Addison Wesley, [10] John Noonn nd Doron Zeilberger, The Goulden Jckson cluster method: extensions, pplictions, nd implementtions, Journl of Difference Equtions nd Applictions 5 (1999) [11] Eric Rowlnd, TreePtterns [ Mthemtic pckge], vilble from the uthor s web site. [12] Aris Spounkis, Ionnis Tsouls, nd Pnos Tsikours, Counting strings in Dyck pths, Discrete Mthemtics 307 (2007) [13] Neil Slone, The Encyclopedi of Integer Sequences, sequences. [14] Richrd Stnley, Enumertive Combintorics volume 2, Cmbridge University Press, New York, [15] Jen-Mrc Steyert nd Philippe Fljolet, Ptterns nd pttern-mtching in trees: n nlysis, Informtion nd Control 58 (1983) Mthemtics Deprtment, Tulne University, New Orlens, LA 70118, USA

MATH 25 CLASS 5 NOTES, SEP

MATH 25 CLASS 5 NOTES, SEP MATH 25 CLASS 5 NOTES, SEP 30 2011 Contents 1. A brief diversion: reltively prime numbers 1 2. Lest common multiples 3 3. Finding ll solutions to x + by = c 4 Quick links to definitions/theorems Euclid

More information

Unit #9 : Definite Integral Properties, Fundamental Theorem of Calculus

Unit #9 : Definite Integral Properties, Fundamental Theorem of Calculus Unit #9 : Definite Integrl Properties, Fundmentl Theorem of Clculus Gols: Identify properties of definite integrls Define odd nd even functions, nd reltionship to integrl vlues Introduce the Fundmentl

More information

Homework. Context Free Languages III. Languages. Plan for today. Context Free Languages. CFLs and Regular Languages. Homework #5 (due 10/22)

Homework. Context Free Languages III. Languages. Plan for today. Context Free Languages. CFLs and Regular Languages. Homework #5 (due 10/22) Homework Context Free Lnguges III Prse Trees nd Homework #5 (due 10/22) From textbook 6.4,b 6.5b 6.9b,c 6.13 6.22 Pln for tody Context Free Lnguges Next clss of lnguges in our quest! Lnguges Recll. Wht

More information

INTRODUCTION TO SIMPLICIAL COMPLEXES

INTRODUCTION TO SIMPLICIAL COMPLEXES INTRODUCTION TO SIMPLICIAL COMPLEXES CASEY KELLEHER AND ALESSANDRA PANTANO 0.1. Introduction. In this ctivity set we re going to introduce notion from Algebric Topology clled simplicil homology. The min

More information

COMP 423 lecture 11 Jan. 28, 2008

COMP 423 lecture 11 Jan. 28, 2008 COMP 423 lecture 11 Jn. 28, 2008 Up to now, we hve looked t how some symols in n lphet occur more frequently thn others nd how we cn sve its y using code such tht the codewords for more frequently occuring

More information

SOME EXAMPLES OF SUBDIVISION OF SMALL CATEGORIES

SOME EXAMPLES OF SUBDIVISION OF SMALL CATEGORIES SOME EXAMPLES OF SUBDIVISION OF SMALL CATEGORIES MARCELLO DELGADO Abstrct. The purpose of this pper is to build up the bsic conceptul frmework nd underlying motivtions tht will llow us to understnd ctegoricl

More information

What are suffix trees?

What are suffix trees? Suffix Trees 1 Wht re suffix trees? Allow lgorithm designers to store very lrge mount of informtion out strings while still keeping within liner spce Allow users to serch for new strings in the originl

More information

If you are at the university, either physically or via the VPN, you can download the chapters of this book as PDFs.

If you are at the university, either physically or via the VPN, you can download the chapters of this book as PDFs. Lecture 5 Wlks, Trils, Pths nd Connectedness Reding: Some of the mteril in this lecture comes from Section 1.2 of Dieter Jungnickel (2008), Grphs, Networks nd Algorithms, 3rd edition, which is ville online

More information

9 Graph Cutting Procedures

9 Graph Cutting Procedures 9 Grph Cutting Procedures Lst clss we begn looking t how to embed rbitrry metrics into distributions of trees, nd proved the following theorem due to Brtl (1996): Theorem 9.1 (Brtl (1996)) Given metric

More information

2014 Haskell January Test Regular Expressions and Finite Automata

2014 Haskell January Test Regular Expressions and Finite Automata 0 Hskell Jnury Test Regulr Expressions nd Finite Automt This test comprises four prts nd the mximum mrk is 5. Prts I, II nd III re worth 3 of the 5 mrks vilble. The 0 Hskell Progrmming Prize will be wrded

More information

A Tautology Checker loosely related to Stålmarck s Algorithm by Martin Richards

A Tautology Checker loosely related to Stålmarck s Algorithm by Martin Richards A Tutology Checker loosely relted to Stålmrck s Algorithm y Mrtin Richrds mr@cl.cm.c.uk http://www.cl.cm.c.uk/users/mr/ University Computer Lortory New Museum Site Pemroke Street Cmridge, CB2 3QG Mrtin

More information

In the last lecture, we discussed how valid tokens may be specified by regular expressions.

In the last lecture, we discussed how valid tokens may be specified by regular expressions. LECTURE 5 Scnning SYNTAX ANALYSIS We know from our previous lectures tht the process of verifying the syntx of the progrm is performed in two stges: Scnning: Identifying nd verifying tokens in progrm.

More information

Lecture 10 Evolutionary Computation: Evolution strategies and genetic programming

Lecture 10 Evolutionary Computation: Evolution strategies and genetic programming Lecture 10 Evolutionry Computtion: Evolution strtegies nd genetic progrmming Evolution strtegies Genetic progrmming Summry Negnevitsky, Person Eduction, 2011 1 Evolution Strtegies Another pproch to simulting

More information

a(e, x) = x. Diagrammatically, this is encoded as the following commutative diagrams / X

a(e, x) = x. Diagrammatically, this is encoded as the following commutative diagrams / X 4. Mon, Sept. 30 Lst time, we defined the quotient topology coming from continuous surjection q : X! Y. Recll tht q is quotient mp (nd Y hs the quotient topology) if V Y is open precisely when q (V ) X

More information

Theory of Computation CSE 105

Theory of Computation CSE 105 $ $ $ Theory of Computtion CSE 105 Regulr Lnguges Study Guide nd Homework I Homework I: Solutions to the following problems should be turned in clss on July 1, 1999. Instructions: Write your nswers clerly

More information

2 Computing all Intersections of a Set of Segments Line Segment Intersection

2 Computing all Intersections of a Set of Segments Line Segment Intersection 15-451/651: Design & Anlysis of Algorithms Novemer 14, 2016 Lecture #21 Sweep-Line nd Segment Intersection lst chnged: Novemer 8, 2017 1 Preliminries The sweep-line prdigm is very powerful lgorithmic design

More information

Section 3.1: Sequences and Series

Section 3.1: Sequences and Series Section.: Sequences d Series Sequences Let s strt out with the definition of sequence: sequence: ordered list of numbers, often with definite pttern Recll tht in set, order doesn t mtter so this is one

More information

CS201 Discussion 10 DRAWTREE + TRIES

CS201 Discussion 10 DRAWTREE + TRIES CS201 Discussion 10 DRAWTREE + TRIES DrwTree First instinct: recursion As very generic structure, we could tckle this problem s follows: drw(): Find the root drw(root) drw(root): Write the line for the

More information

MA1008. Calculus and Linear Algebra for Engineers. Course Notes for Section B. Stephen Wills. Department of Mathematics. University College Cork

MA1008. Calculus and Linear Algebra for Engineers. Course Notes for Section B. Stephen Wills. Department of Mathematics. University College Cork MA1008 Clculus nd Liner Algebr for Engineers Course Notes for Section B Stephen Wills Deprtment of Mthemtics University College Cork s.wills@ucc.ie http://euclid.ucc.ie/pges/stff/wills/teching/m1008/ma1008.html

More information

Fig.25: the Role of LEX

Fig.25: the Role of LEX The Lnguge for Specifying Lexicl Anlyzer We shll now study how to uild lexicl nlyzer from specifiction of tokens in the form of list of regulr expressions The discussion centers round the design of n existing

More information

Definition of Regular Expression

Definition of Regular Expression Definition of Regulr Expression After the definition of the string nd lnguges, we re redy to descrie regulr expressions, the nottion we shll use to define the clss of lnguges known s regulr sets. Recll

More information

Midterm 2 Sample solution

Midterm 2 Sample solution Nme: Instructions Midterm 2 Smple solution CMSC 430 Introduction to Compilers Fll 2012 November 28, 2012 This exm contins 9 pges, including this one. Mke sure you hve ll the pges. Write your nme on the

More information

Tries. Yufei Tao KAIST. April 9, Y. Tao, April 9, 2013 Tries

Tries. Yufei Tao KAIST. April 9, Y. Tao, April 9, 2013 Tries Tries Yufei To KAIST April 9, 2013 Y. To, April 9, 2013 Tries In this lecture, we will discuss the following exct mtching prolem on strings. Prolem Let S e set of strings, ech of which hs unique integer

More information

Graphs with at most two trees in a forest building process

Graphs with at most two trees in a forest building process Grphs with t most two trees in forest uilding process rxiv:802.0533v [mth.co] 4 Fe 208 Steve Butler Mis Hmnk Mrie Hrdt Astrct Given grph, we cn form spnning forest y first sorting the edges in some order,

More information

1. SEQUENCES INVOLVING EXPONENTIAL GROWTH (GEOMETRIC SEQUENCES)

1. SEQUENCES INVOLVING EXPONENTIAL GROWTH (GEOMETRIC SEQUENCES) Numbers nd Opertions, Algebr, nd Functions 45. SEQUENCES INVOLVING EXPONENTIAL GROWTH (GEOMETRIC SEQUENCES) In sequence of terms involving eponentil growth, which the testing service lso clls geometric

More information

Dr. D.M. Akbar Hussain

Dr. D.M. Akbar Hussain Dr. D.M. Akr Hussin Lexicl Anlysis. Bsic Ide: Red the source code nd generte tokens, it is similr wht humns will do to red in; just tking on the input nd reking it down in pieces. Ech token is sequence

More information

COMBINATORIAL PATTERN MATCHING

COMBINATORIAL PATTERN MATCHING COMBINATORIAL PATTERN MATCHING Genomic Repets Exmple of repets: ATGGTCTAGGTCCTAGTGGTC Motivtion to find them: Genomic rerrngements re often ssocited with repets Trce evolutionry secrets Mny tumors re chrcterized

More information

CS321 Languages and Compiler Design I. Winter 2012 Lecture 5

CS321 Languages and Compiler Design I. Winter 2012 Lecture 5 CS321 Lnguges nd Compiler Design I Winter 2012 Lecture 5 1 FINITE AUTOMATA A non-deterministic finite utomton (NFA) consists of: An input lphet Σ, e.g. Σ =,. A set of sttes S, e.g. S = {1, 3, 5, 7, 11,

More information

An Efficient Divide and Conquer Algorithm for Exact Hazard Free Logic Minimization

An Efficient Divide and Conquer Algorithm for Exact Hazard Free Logic Minimization An Efficient Divide nd Conquer Algorithm for Exct Hzrd Free Logic Minimiztion J.W.J.M. Rutten, M.R.C.M. Berkelr, C.A.J. vn Eijk, M.A.J. Kolsteren Eindhoven University of Technology Informtion nd Communiction

More information

9 4. CISC - Curriculum & Instruction Steering Committee. California County Superintendents Educational Services Association

9 4. CISC - Curriculum & Instruction Steering Committee. California County Superintendents Educational Services Association 9. CISC - Curriculum & Instruction Steering Committee The Winning EQUATION A HIGH QUALITY MATHEMATICS PROFESSIONAL DEVELOPMENT PROGRAM FOR TEACHERS IN GRADES THROUGH ALGEBRA II STRAND: NUMBER SENSE: Rtionl

More information

Section 10.4 Hyperbolas

Section 10.4 Hyperbolas 66 Section 10.4 Hyperbols Objective : Definition of hyperbol & hyperbols centered t (0, 0). The third type of conic we will study is the hyperbol. It is defined in the sme mnner tht we defined the prbol

More information

CSCI 3130: Formal Languages and Automata Theory Lecture 12 The Chinese University of Hong Kong, Fall 2011

CSCI 3130: Formal Languages and Automata Theory Lecture 12 The Chinese University of Hong Kong, Fall 2011 CSCI 3130: Forml Lnguges nd utomt Theory Lecture 12 The Chinese University of Hong Kong, Fll 2011 ndrej Bogdnov In progrmming lnguges, uilding prse trees is significnt tsk ecuse prse trees tell us the

More information

ECE 468/573 Midterm 1 September 28, 2012

ECE 468/573 Midterm 1 September 28, 2012 ECE 468/573 Midterm 1 September 28, 2012 Nme:! Purdue emil:! Plese sign the following: I ffirm tht the nswers given on this test re mine nd mine lone. I did not receive help from ny person or mteril (other

More information

Misrepresentation of Preferences

Misrepresentation of Preferences Misrepresenttion of Preferences Gicomo Bonnno Deprtment of Economics, University of Cliforni, Dvis, USA gfbonnno@ucdvis.edu Socil choice functions Arrow s theorem sys tht it is not possible to extrct from

More information

Functor (1A) Young Won Lim 8/2/17

Functor (1A) Young Won Lim 8/2/17 Copyright (c) 2016-2017 Young W. Lim. Permission is grnted to copy, distribute nd/or modify this document under the terms of the GNU Free Documenttion License, Version 1.2 or ny lter version published

More information

Functor (1A) Young Won Lim 10/5/17

Functor (1A) Young Won Lim 10/5/17 Copyright (c) 2016-2017 Young W. Lim. Permission is grnted to copy, distribute nd/or modify this document under the terms of the GNU Free Documenttion License, Version 1.2 or ny lter version published

More information

Determining Single Connectivity in Directed Graphs

Determining Single Connectivity in Directed Graphs Determining Single Connectivity in Directed Grphs Adm L. Buchsbum 1 Mrtin C. Crlisle 2 Reserch Report CS-TR-390-92 September 1992 Abstrct In this pper, we consider the problem of determining whether or

More information

Alignment of Long Sequences. BMI/CS Spring 2012 Colin Dewey

Alignment of Long Sequences. BMI/CS Spring 2012 Colin Dewey Alignment of Long Sequences BMI/CS 776 www.biostt.wisc.edu/bmi776/ Spring 2012 Colin Dewey cdewey@biostt.wisc.edu Gols for Lecture the key concepts to understnd re the following how lrge-scle lignment

More information

Digital Design. Chapter 6: Optimizations and Tradeoffs

Digital Design. Chapter 6: Optimizations and Tradeoffs Digitl Design Chpter 6: Optimiztions nd Trdeoffs Slides to ccompny the tetbook Digitl Design, with RTL Design, VHDL, nd Verilog, 2nd Edition, by Frnk Vhid, John Wiley nd Sons Publishers, 2. http://www.ddvhid.com

More information

Suffix trees, suffix arrays, BWT

Suffix trees, suffix arrays, BWT ALGORITHMES POUR LA BIO-INFORMATIQUE ET LA VISUALISATION COURS 3 Rluc Uricru Suffix trees, suffix rrys, BWT Bsed on: Suffix trees nd suffix rrys presenttion y Him Kpln Suffix trees course y Pco Gomez Liner-Time

More information

II. THE ALGORITHM. A. Depth Map Processing

II. THE ALGORITHM. A. Depth Map Processing Lerning Plnr Geometric Scene Context Using Stereo Vision Pul G. Bumstrck, Bryn D. Brudevold, nd Pul D. Reynolds {pbumstrck,brynb,pulr2}@stnford.edu CS229 Finl Project Report December 15, 2006 Abstrct A

More information

CS143 Handout 07 Summer 2011 June 24 th, 2011 Written Set 1: Lexical Analysis

CS143 Handout 07 Summer 2011 June 24 th, 2011 Written Set 1: Lexical Analysis CS143 Hndout 07 Summer 2011 June 24 th, 2011 Written Set 1: Lexicl Anlysis In this first written ssignment, you'll get the chnce to ply round with the vrious constructions tht come up when doing lexicl

More information

Algorithm Design (5) Text Search

Algorithm Design (5) Text Search Algorithm Design (5) Text Serch Tkshi Chikym School of Engineering The University of Tokyo Text Serch Find sustring tht mtches the given key string in text dt of lrge mount Key string: chr x[m] Text Dt:

More information

Stained Glass Design. Teaching Goals:

Stained Glass Design. Teaching Goals: Stined Glss Design Time required 45-90 minutes Teching Gols: 1. Students pply grphic methods to design vrious shpes on the plne.. Students pply geometric trnsformtions of grphs of functions in order to

More information

Integration. October 25, 2016

Integration. October 25, 2016 Integrtion October 5, 6 Introduction We hve lerned in previous chpter on how to do the differentition. It is conventionl in mthemtics tht we re supposed to lern bout the integrtion s well. As you my hve

More information

10.5 Graphing Quadratic Functions

10.5 Graphing Quadratic Functions 0.5 Grphing Qudrtic Functions Now tht we cn solve qudrtic equtions, we wnt to lern how to grph the function ssocited with the qudrtic eqution. We cll this the qudrtic function. Grphs of Qudrtic Functions

More information

arxiv: v1 [cs.cg] 9 Dec 2016

arxiv: v1 [cs.cg] 9 Dec 2016 Some Counterexmples for Comptible Tringultions rxiv:62.0486v [cs.cg] 9 Dec 206 Cody Brnson Dwn Chndler 2 Qio Chen 3 Christin Chung 4 Andrew Coccimiglio 5 Sen L 6 Lily Li 7 Aïn Linn 8 Ann Lubiw 9 Clre Lyle

More information

On the Detection of Step Edges in Algorithms Based on Gradient Vector Analysis

On the Detection of Step Edges in Algorithms Based on Gradient Vector Analysis On the Detection of Step Edges in Algorithms Bsed on Grdient Vector Anlysis A. Lrr6, E. Montseny Computer Engineering Dept. Universitt Rovir i Virgili Crreter de Slou sin 43006 Trrgon, Spin Emil: lrre@etse.urv.es

More information

A Heuristic Approach for Discovering Reference Models by Mining Process Model Variants

A Heuristic Approach for Discovering Reference Models by Mining Process Model Variants A Heuristic Approch for Discovering Reference Models by Mining Process Model Vrints Chen Li 1, Mnfred Reichert 2, nd Andres Wombcher 3 1 Informtion System Group, University of Twente, The Netherlnds lic@cs.utwente.nl

More information

Representation of Numbers. Number Representation. Representation of Numbers. 32-bit Unsigned Integers 3/24/2014. Fixed point Integer Representation

Representation of Numbers. Number Representation. Representation of Numbers. 32-bit Unsigned Integers 3/24/2014. Fixed point Integer Representation Representtion of Numbers Number Representtion Computer represent ll numbers, other thn integers nd some frctions with imprecision. Numbers re stored in some pproximtion which cn be represented by fixed

More information

Integration. September 28, 2017

Integration. September 28, 2017 Integrtion September 8, 7 Introduction We hve lerned in previous chpter on how to do the differentition. It is conventionl in mthemtics tht we re supposed to lern bout the integrtion s well. As you my

More information

Introduction. Chapter 4: Complex Integration. Introduction (Cont d)

Introduction. Chapter 4: Complex Integration. Introduction (Cont d) Introduction Chpter 4: Complex Integrtion Li, Yongzho Stte Key Lbortory of Integrted Services Networks, Xidin University October 10, 2010 The two-dimensionl nture of the complex plne required us to generlize

More information

A New Learning Algorithm for the MAXQ Hierarchical Reinforcement Learning Method

A New Learning Algorithm for the MAXQ Hierarchical Reinforcement Learning Method A New Lerning Algorithm for the MAXQ Hierrchicl Reinforcement Lerning Method Frzneh Mirzzdeh 1, Bbk Behsz 2, nd Hmid Beigy 1 1 Deprtment of Computer Engineering, Shrif University of Technology, Tehrn,

More information

L. Yaroslavsky. Fundamentals of Digital Image Processing. Course

L. Yaroslavsky. Fundamentals of Digital Image Processing. Course L. Yroslvsky. Fundmentls of Digitl Imge Processing. Course 0555.330 Lecture. Imge enhncement.. Imge enhncement s n imge processing tsk. Clssifiction of imge enhncement methods Imge enhncement is processing

More information

Ma/CS 6b Class 1: Graph Recap

Ma/CS 6b Class 1: Graph Recap M/CS 6 Clss 1: Grph Recp By Adm Sheffer Course Detils Adm Sheffer. Office hour: Tuesdys 4pm. dmsh@cltech.edu TA: Victor Kstkin. Office hour: Tuesdys 7pm. 1:00 Mondy, Wednesdy, nd Fridy. http://www.mth.cltech.edu/~2014-15/2term/m006/

More information

12-B FRACTIONS AND DECIMALS

12-B FRACTIONS AND DECIMALS -B Frctions nd Decimls. () If ll four integers were negtive, their product would be positive, nd so could not equl one of them. If ll four integers were positive, their product would be much greter thn

More information

4452 Mathematical Modeling Lecture 4: Lagrange Multipliers

4452 Mathematical Modeling Lecture 4: Lagrange Multipliers Mth Modeling Lecture 4: Lgrnge Multipliers Pge 4452 Mthemticl Modeling Lecture 4: Lgrnge Multipliers Lgrnge multipliers re high powered mthemticl technique to find the mximum nd minimum of multidimensionl

More information

1 Quad-Edge Construction Operators

1 Quad-Edge Construction Operators CS48: Computer Grphics Hndout # Geometric Modeling Originl Hndout #5 Stnford University Tuesdy, 8 December 99 Originl Lecture #5: 9 November 99 Topics: Mnipultions with Qud-Edge Dt Structures Scribe: Mike

More information

ΕΠΛ323 - Θεωρία και Πρακτική Μεταγλωττιστών

ΕΠΛ323 - Θεωρία και Πρακτική Μεταγλωττιστών ΕΠΛ323 - Θωρία και Πρακτική Μταγλωττιστών Lecture 3 Lexicl Anlysis Elis Athnsopoulos elisthn@cs.ucy.c.cy Recognition of Tokens if expressions nd reltionl opertors if è if then è then else è else relop

More information

Slides for Data Mining by I. H. Witten and E. Frank

Slides for Data Mining by I. H. Witten and E. Frank Slides for Dt Mining y I. H. Witten nd E. Frnk Simplicity first Simple lgorithms often work very well! There re mny kinds of simple structure, eg: One ttriute does ll the work All ttriutes contriute eqully

More information

CSE 401 Midterm Exam 11/5/10 Sample Solution

CSE 401 Midterm Exam 11/5/10 Sample Solution Question 1. egulr expressions (20 points) In the Ad Progrmming lnguge n integer constnt contins one or more digits, but it my lso contin embedded underscores. Any underscores must be preceded nd followed

More information

a < a+ x < a+2 x < < a+n x = b, n A i n f(x i ) x. i=1 i=1

a < a+ x < a+2 x < < a+n x = b, n A i n f(x i ) x. i=1 i=1 Mth 33 Volume Stewrt 5.2 Geometry of integrls. In this section, we will lern how to compute volumes using integrls defined by slice nlysis. First, we recll from Clculus I how to compute res. Given the

More information

6.2 Volumes of Revolution: The Disk Method

6.2 Volumes of Revolution: The Disk Method mth ppliction: volumes by disks: volume prt ii 6 6 Volumes of Revolution: The Disk Method One of the simplest pplictions of integrtion (Theorem 6) nd the ccumultion process is to determine so-clled volumes

More information

Better Hill-Climbing Searches for Parsimony

Better Hill-Climbing Searches for Parsimony Better Hill-Climbing Serches for Prsimony Gneshkumr Gnpthy, Vijy Rmchndrn, nd Tndy Wrnow Deprtment of Computer Sciences, University of Texs, Austin, TX 78712; gsgk, vlr, tndy @cs.utexs.edu Abstrct. The

More information

Pointwise convergence need not behave well with respect to standard properties such as continuity.

Pointwise convergence need not behave well with respect to standard properties such as continuity. Chpter 3 Uniform Convergence Lecture 9 Sequences of functions re of gret importnce in mny res of pure nd pplied mthemtics, nd their properties cn often be studied in the context of metric spces, s in Exmples

More information

Preserving Constraints for Aggregation Relationship Type Update in XML Document

Preserving Constraints for Aggregation Relationship Type Update in XML Document Preserving Constrints for Aggregtion Reltionship Type Updte in XML Document Eric Prdede 1, J. Wenny Rhyu 1, nd Dvid Tnir 2 1 Deprtment of Computer Science nd Computer Engineering, L Trobe University, Bundoor

More information

Intermediate Information Structures

Intermediate Information Structures CPSC 335 Intermedite Informtion Structures LECTURE 13 Suffix Trees Jon Rokne Computer Science University of Clgry Cnd Modified from CMSC 423 - Todd Trengen UMD upd Preprocessing Strings We will look t

More information

such that the S i cover S, or equivalently S

such that the S i cover S, or equivalently S MATH 55 Triple Integrls Fll 16 1. Definition Given solid in spce, prtition of consists of finite set of solis = { 1,, n } such tht the i cover, or equivlently n i. Furthermore, for ech i, intersects i

More information

Math 464 Fall 2012 Notes on Marginal and Conditional Densities October 18, 2012

Math 464 Fall 2012 Notes on Marginal and Conditional Densities October 18, 2012 Mth 464 Fll 2012 Notes on Mrginl nd Conditionl Densities klin@mth.rizon.edu October 18, 2012 Mrginl densities. Suppose you hve 3 continuous rndom vribles X, Y, nd Z, with joint density f(x,y,z. The mrginl

More information

From Indexing Data Structures to de Bruijn Graphs

From Indexing Data Structures to de Bruijn Graphs From Indexing Dt Structures to de Bruijn Grphs Bstien Czux, Thierry Lecroq, Eric Rivls LIRMM & IBC, Montpellier - LITIS Rouen June 1, 201 Czux, Lecroq, Rivls (LIRMM) Generlized Suffix Tree & DBG June 1,

More information

Eliminating left recursion grammar transformation. The transformed expression grammar

Eliminating left recursion grammar transformation. The transformed expression grammar Eliminting left recursion grmmr trnsformtion Originl! rnsformed! 0 0! 0 α β α α α α α α α α β he two grmmrs generte the sme lnguge, but the one on the right genertes the rst, nd then string of s, using

More information

Solving Problems by Searching. CS 486/686: Introduction to Artificial Intelligence Winter 2016

Solving Problems by Searching. CS 486/686: Introduction to Artificial Intelligence Winter 2016 Solving Prolems y Serching CS 486/686: Introduction to Artificil Intelligence Winter 2016 1 Introduction Serch ws one of the first topics studied in AI - Newell nd Simon (1961) Generl Prolem Solver Centrl

More information

Control-Flow Analysis and Loop Detection

Control-Flow Analysis and Loop Detection ! Control-Flow Anlysis nd Loop Detection!Lst time! PRE!Tody! Control-flow nlysis! Loops! Identifying loops using domintors! Reducibility! Using loop identifiction to identify induction vribles CS553 Lecture

More information

Scanner Termination. Multi Character Lookahead

Scanner Termination. Multi Character Lookahead If d.doublevlue() represents vlid integer, (int) d.doublevlue() will crete the pproprite integer vlue. If string representtion of n integer begins with ~ we cn strip the ~, convert to double nd then negte

More information

From Dependencies to Evaluation Strategies

From Dependencies to Evaluation Strategies From Dependencies to Evlution Strtegies Possile strtegies: 1 let the user define the evlution order 2 utomtic strtegy sed on the dependencies: use locl dependencies to determine which ttriutes to compute

More information

Scanner Termination. Multi Character Lookahead. to its physical end. Most parsers require an end of file token. Lex and Jlex automatically create an

Scanner Termination. Multi Character Lookahead. to its physical end. Most parsers require an end of file token. Lex and Jlex automatically create an Scnner Termintion A scnner reds input chrcters nd prtitions them into tokens. Wht hppens when the end of the input file is reched? It my be useful to crete n Eof pseudo-chrcter when this occurs. In Jv,

More information

A dual of the rectangle-segmentation problem for binary matrices

A dual of the rectangle-segmentation problem for binary matrices A dul of the rectngle-segmenttion prolem for inry mtrices Thoms Klinowski Astrct We consider the prolem to decompose inry mtrix into smll numer of inry mtrices whose -entries form rectngle. We show tht

More information

arxiv:cs.cg/ v1 18 Oct 2005

arxiv:cs.cg/ v1 18 Oct 2005 A Pir of Trees without Simultneous Geometric Embedding in the Plne rxiv:cs.cg/0510053 v1 18 Oct 2005 Mrtin Kutz Mx-Plnck-Institut für Informtik, Srbrücken, Germny mkutz@mpi-inf.mpg.de October 19, 2005

More information

Lecture T4: Pattern Matching

Lecture T4: Pattern Matching Introduction to Theoreticl CS Lecture T4: Pttern Mtching Two fundmentl questions. Wht cn computer do? How fst cn it do it? Generl pproch. Don t tlk bout specific mchines or problems. Consider miniml bstrct

More information

Research Announcement: MAXIMAL CONNECTED HAUSDORFF TOPOLOGIES

Research Announcement: MAXIMAL CONNECTED HAUSDORFF TOPOLOGIES Volume 2, 1977 Pges 349 353 http://topology.uburn.edu/tp/ Reserch Announcement: MAXIMAL CONNECTED HAUSDORFF TOPOLOGIES by J. A. Guthrie, H. E. Stone, nd M. L. Wge Topology Proceedings Web: http://topology.uburn.edu/tp/

More information

Unit 5 Vocabulary. A function is a special relationship where each input has a single output.

Unit 5 Vocabulary. A function is a special relationship where each input has a single output. MODULE 3 Terms Definition Picture/Exmple/Nottion 1 Function Nottion Function nottion is n efficient nd effective wy to write functions of ll types. This nottion llows you to identify the input vlue with

More information

Ma/CS 6b Class 1: Graph Recap

Ma/CS 6b Class 1: Graph Recap M/CS 6 Clss 1: Grph Recp By Adm Sheffer Course Detils Instructor: Adm Sheffer. TA: Cosmin Pohot. 1pm Mondys, Wednesdys, nd Fridys. http://mth.cltech.edu/~2015-16/2term/m006/ Min ook: Introduction to Grph

More information

arxiv:math/ v2 [math.co] 28 Feb 2006

arxiv:math/ v2 [math.co] 28 Feb 2006 Chord Digrms nd Guss Codes for Grphs rxiv:mth/0508269v2 [mth.co] 28 Feb 2006 Thoms Fleming Deprtment of Mthemtics University of Cliforni, Sn Diego L Joll, C 92093-0112 tfleming@mth.ucsd.edu bstrct lke

More information

Wang Tiles. May 2, 2006

Wang Tiles. May 2, 2006 Wng Tiles My 2, 2006 Abstrct Suppose we wnt to cover the plne with decorted squre tiles of the sme size. Tiles re to be chosen from finite number of types. There re unbounded tiles of ech type vilble.

More information

Ray surface intersections

Ray surface intersections Ry surfce intersections Some primitives Finite primitives: polygons spheres, cylinders, cones prts of generl qudrics Infinite primitives: plnes infinite cylinders nd cones generl qudrics A finite primitive

More information

CS311H: Discrete Mathematics. Graph Theory IV. A Non-planar Graph. Regions of a Planar Graph. Euler s Formula. Instructor: Işıl Dillig

CS311H: Discrete Mathematics. Graph Theory IV. A Non-planar Graph. Regions of a Planar Graph. Euler s Formula. Instructor: Işıl Dillig CS311H: Discrete Mthemtics Grph Theory IV Instructor: Işıl Dillig Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 1/25 A Non-plnr Grph Regions of Plnr Grph The plnr representtion of

More information

Semistructured Data Management Part 2 - Graph Databases

Semistructured Data Management Part 2 - Graph Databases Semistructured Dt Mngement Prt 2 - Grph Dtbses 2003/4, Krl Aberer, EPFL-SSC, Lbortoire de systèmes d'informtions réprtis Semi-structured Dt - 1 1 Tody's Questions 1. Schems for Semi-structured Dt 2. Grph

More information

Available at ISSN: Vol. 4, Issue 2 (December 2009) pp (Previously Vol. 4, No.

Available at   ISSN: Vol. 4, Issue 2 (December 2009) pp (Previously Vol. 4, No. Avilble t http://pvmu.edu.edu/pges/398.sp ISSN: 93-9466 Vol. 4, Issue December 009 pp. 434 444 Previously Vol. 4, No. Applictions nd Applied Mthemtics: An Interntionl Journl AAM On -ry Subdivision for

More information

Notes for Graph Theory

Notes for Graph Theory Notes for Grph Theory These re notes I wrote up for my grph theory clss in 06. They contin most of the topics typiclly found in grph theory course. There re proofs of lot of the results, ut not of everything.

More information

Math 142, Exam 1 Information.

Math 142, Exam 1 Information. Mth 14, Exm 1 Informtion. 9/14/10, LC 41, 9:30-10:45. Exm 1 will be bsed on: Sections 7.1-7.5. The corresponding ssigned homework problems (see http://www.mth.sc.edu/ boyln/sccourses/14f10/14.html) At

More information

Typing with Weird Keyboards Notes

Typing with Weird Keyboards Notes Typing with Weird Keyords Notes Ykov Berchenko-Kogn August 25, 2012 Astrct Consider lnguge with n lphet consisting of just four letters,,,, nd. There is spelling rule tht sys tht whenever you see n next

More information

ON THE DEHN COMPLEX OF VIRTUAL LINKS

ON THE DEHN COMPLEX OF VIRTUAL LINKS ON THE DEHN COMPLEX OF VIRTUAL LINKS RACHEL BYRD, JENS HARLANDER Astrct. A virtul link comes with vriety of link complements. This rticle is concerned with the Dehn spce, pseudo mnifold with oundry, nd

More information

Tree Structured Symmetrical Systems of Linear Equations and their Graphical Solution

Tree Structured Symmetrical Systems of Linear Equations and their Graphical Solution Proceedings of the World Congress on Engineering nd Computer Science 4 Vol I WCECS 4, -4 October, 4, Sn Frncisco, USA Tree Structured Symmetricl Systems of Liner Equtions nd their Grphicl Solution Jime

More information

Midterm I Solutions CS164, Spring 2006

Midterm I Solutions CS164, Spring 2006 Midterm I Solutions CS164, Spring 2006 Februry 23, 2006 Plese red ll instructions (including these) crefully. Write your nme, login, SID, nd circle the section time. There re 8 pges in this exm nd 4 questions,

More information

If f(x, y) is a surface that lies above r(t), we can think about the area between the surface and the curve.

If f(x, y) is a surface that lies above r(t), we can think about the area between the surface and the curve. Line Integrls The ide of line integrl is very similr to tht of single integrls. If the function f(x) is bove the x-xis on the intervl [, b], then the integrl of f(x) over [, b] is the re under f over the

More information

CS481: Bioinformatics Algorithms

CS481: Bioinformatics Algorithms CS481: Bioinformtics Algorithms Cn Alkn EA509 clkn@cs.ilkent.edu.tr http://www.cs.ilkent.edu.tr/~clkn/teching/cs481/ EXACT STRING MATCHING Fingerprint ide Assume: We cn compute fingerprint f(p) of P in

More information

CSCI1950 Z Computa4onal Methods for Biology Lecture 2. Ben Raphael January 26, hhp://cs.brown.edu/courses/csci1950 z/ Outline

CSCI1950 Z Computa4onal Methods for Biology Lecture 2. Ben Raphael January 26, hhp://cs.brown.edu/courses/csci1950 z/ Outline CSCI1950 Z Comput4onl Methods for Biology Lecture 2 Ben Rphel Jnury 26, 2009 hhp://cs.brown.edu/courses/csci1950 z/ Outline Review of trees. Coun4ng fetures. Chrcter bsed phylogeny Mximum prsimony Mximum

More information

CS412/413. Introduction to Compilers Tim Teitelbaum. Lecture 4: Lexical Analyzers 28 Jan 08

CS412/413. Introduction to Compilers Tim Teitelbaum. Lecture 4: Lexical Analyzers 28 Jan 08 CS412/413 Introduction to Compilers Tim Teitelum Lecture 4: Lexicl Anlyzers 28 Jn 08 Outline DFA stte minimiztion Lexicl nlyzers Automting lexicl nlysis Jlex lexicl nlyzer genertor CS 412/413 Spring 2008

More information

Engineer To Engineer Note

Engineer To Engineer Note Engineer To Engineer Note EE-188 Technicl Notes on using Anlog Devices' DSP components nd development tools Contct our technicl support by phone: (800) ANALOG-D or e-mil: dsp.support@nlog.com Or visit

More information

Today. Search Problems. Uninformed Search Methods. Depth-First Search Breadth-First Search Uniform-Cost Search

Today. Search Problems. Uninformed Search Methods. Depth-First Search Breadth-First Search Uniform-Cost Search Uninformed Serch [These slides were creted by Dn Klein nd Pieter Abbeel for CS188 Intro to AI t UC Berkeley. All CS188 mterils re vilble t http://i.berkeley.edu.] Tody Serch Problems Uninformed Serch Methods

More information