Single-Player and Two-Player Buttons & Scissors Games

Size: px
Start display at page:

Download "Single-Player and Two-Player Buttons & Scissors Games"

Transcription

1 Single-Plyer nd Two-Plyer Buttons & Scissors Gmes The MIT Fculty hs mde this rticle openly ville. Plese shre how this ccess enefits you. Your story mtters. Cittion As Pulished Pulisher Burke, Kyle, et l. Single-Plyer nd Two-Plyer Buttons & Scissors Gmes. Discrete nd Computtionl Geometry nd Grphs, edited y Jin Akiym et l., vol. 9943, Springer Interntionl Pulishing, 2016, pp Springer Version Author's finl mnuscript Accessed Tue Jn 01 22:20:19 EST 2019 Citle Link Terms of Use Cretive Commons Attriution-Noncommercil-Shre Alike Detiled Terms

2 Single-Plyer nd Two-Plyer Buttons & Scissors Gmes Kyle Burke 1, Erik D. Demine 2, Hrrison Gregg 3, Roert A. Hern 4, Adm Hestererg 2, Michel Hoffmnn 5, Hiro Ito 6, Irin Kostitsyn 7, Jody Leonrd 3, Mrten Löffler 8, Aron Sntigo 3, Christine Schmidt 9, Ryuhei Uehr 10, Yushi Uno 11, nd Aron Willims 3 rxiv: v1 [cs.cc] 6 Jul 2016 Astrct. We study the computtionl compleity of the Buttons & Scissors gme nd otin shrp thresholds with respect to severl prmeters. Specificlly we show tht the gme is NP-complete for C = 2 colors ut polytime solvle for C = 1. Similrly the gme is NP-complete if every color is used y t most F = 4 uttons ut polytime solvle for F 3. We lso consider restrictions on the ord size, cut directions, nd cut sizes. Finlly, we introduce severl nturl two-plyer versions of the gme nd show tht they re PSPACE-complete. 1 Introduction Buttons & Scissors is single-plyer puzzle y KyWorks. The gol of ech level is to remove every utton y sequence of horizontl, verticl, nd digonl cuts, s illustrted y Fig. 1. It is NP-complete to decide if given level is solvle [2]. We study severl restricted versions of the gme nd show tht some remin hrd, wheres others cn e solved in polynomil time. We lso consider nturl etensions to two plyer gmes which turn out to e PSPACE-complete. Section 2 egins with preliminries, then we discuss one-plyer puzzles in Section 3 nd two-plyer gmes in Section 4. Open prolems pper in Section 5. 1 Plymouth Stte University, kgurke@plymouth.edu 2 Msschusetts Institute of Technology, {edemine,chester}@mit.edu 3 Brd College t Simon s Rock, {hgregg11,jleonrd11,sntigo11,willims}@simons-rock.edu 4 o@hern.to 5 ETH Zürich, hoffmnn@inf.ethz.ch 6 The University of Electro-Communictions, itohiro@uec.c.jp 7 Technische Universiteit Eindhoven, i.kostitsyn@tue.nl. Supported in prt y NWO project no Universiteit Utrecht, m.loffler@uu.nl 9 Linköping University, christine.schmidt@liu.se. Supported in prt y grnt from Sweden s innovtion gency VINNOVA. 10 Jpn Advnced Institute of Science nd Technology, uehr@jist.c.jp 11 Osk Prefecture University, uno@mi.s.oskfu-u.c.jp

3 () () (c) Fig. 1. () Level 7 in the Buttons & Scissors pp is n m n = 5 5 grid with C = 5 colors, ech used t most F = 7 times; () solution using nine cuts with sizes in S = {2,3} nd directions d = (no verticl cut is used); (c) gdget used in Theorem 5. 2 Preliminries A Buttons & Scissors ord B is n m n grid, where ech grid position is either empty or occupied y utton with one of C different colors. A cut is given y two distinct uttons 1, 2 of the sme color c tht shre either the -coordinte, the y-coordinte, or re locted on the sme digonl (45 nd 45 ). The size s of cut is the numer of uttons on the line segment 1 2 nd so s 2. A cut is fesile for B if 1 2 only contins uttons of single color. When fesile cut is pplied to ord B, the resulting ord B is otined y sustituting the uttons of color c on 1 2 with empty grid entries. A solution to ord B is sequence of ords nd fesile cuts B 1, 1,B 2, 2,...,B t, t,b t+1, where B t+1 is empty, nd ech cut i is fesile for B i nd cretes B i+1. Ech instnce cn e prmeterized s follows (see Fig. 1 for n emple): 1. The ord size m n. 2. The numer of colors C. 3. The mimum frequency F of n individul color. 4. The cut directions d cn e limited to d {,,, }. 5. The cut size set S limits fesile cuts to hving size s S. Ech d {,,, } is set of cut directions (i.e. for horizontl nd verticl). We limit ourselves to these options ecuse n m n ord cn e rotted 90 to n equivlent n m ord, or 45 to n equivlent k k ord for k = m+n 1 with lnk squres. Similrly, we cn sher the grid y pdding row i with i 1 lnks on the left nd m i lnks on the right which converts d = to d =. We otin the fmily of gmes elow (B&S[n n,,,,{2,3}](b) is the originl): Decision Prolem: B&S[m n,c,f,d,s](b). Input: An m n ord B with uttons of C colors, ech used t most F times. Output: True B is solvle with cuts of size s S nd directions d. Now we provide three oservtions for lter use. First note tht single cut of size s cn e ccomplished y cuts of size s 1,s 2,...,s k so long s s = s 1 + s s k nd s i 2 for ll i. Second note tht removing ll uttons of single color from solvle instnce cnnot result in n unsolvle instnce.

4 3 Remrk 1. A ord cn e solved with cut sizes S = {2,3,...} if nd only if it cn e solved with cut sizes S = {2,3}. Also, {3,4,...} nd {3,4,5} re equivlent. Remrk 2. If ord B is otined from ord B y removing every utton of single color, then B&S[m n,c,f,d,s](b) = B&S[m n,c,f,d,s](b ). 3 Single-Plyer Puzzle 3.1 Bord Size We solve one row prolems elow, nd give conjecture for two rows in Section 5. Theorem 1. B&S[1 n,,,,{2,3}](b) is polytime solvle. Proof. Consider the following contet-free grmmr, S ε SS S SS where is n empty squre nd {1,2,...,C}. By Remrk 1, the solvle 1 n ords re in one-to-one correspondence with the strings in this lnguge. 3.2 Numer of Colors Hrdness for 2 colors. We egin with strightforwrd reduction from 3SAT. The result will e strengthened lter y Theorem 7 using more difficult proof. Theorem 2. B&S[n n,2,,,{2,3}](b) is NP-complete. Proof Sketch: A vrile gdget hs its own row with ectly three uttons. The middle utton is lone in its column, nd must e mtched with t lest one of the other two in the vrile row. If the left utton is not used in this mtch, we consider the vrile set to true. If the right utton is not used, we consider the vrile set to flse. A utton not used in vrile is n ville output, nd cn then serve s n ville input to e used in other gdgets. Every cluse gdget hs its own column, with ectly four uttons. The topmost utton (cluse utton) is lone in its row; the others re inputs. If t lest one of these is n ville input, then we cn mtch the cluse utton with ll ville inputs. We construct one cluse gdget per formul cluse, connecting its inputs to the pproprite vrile outputs. Then, we cn cler ll the cluses just when we hve mde vrile selections tht stisfy the formul. The vriles re connected to the cluses vi multi-purpose split gdget (Fig. 2()). Unlike the vrile nd the cluse, this gdget uses uttons of two colors. The ottom utton is n input; the top two re outputs. If the input utton is ville, we cn mtch the middle row of the gdget s shown in Fig. 2(), leving the output uttons ville. But if the input is not ville, then the only wy the middle row cn e clered is to first cler the red uttons in verticl pirs, s shown in Fig. 2(c); then the output uttons re not ville.

5 4 () () (c) Fig. 2. Split gdget () nd the two possile wys to cler it () nd (c). The split gdget hs two dditionl effects eyond splitting. First, it chnges the signl color from one of the two colors to the other. Second, it rottes the signl direction from verticl to horizontl: if the input is ville to e used verticlly y the split, then the outputs re ville to e used horizontlly s inputs to other gdgets. Therefore, we cn restore the originl signl color nd direction y ttching further splits to the originl split outputs. We split ech vrile output s often s needed to rech the cluse inputs, ech of which will lso e the output of split rotted 90 from Fig. 2(). If we otin more split outputs thn cluse inputs for vrile, then we dd red utton in the sme column s red pir on n unused split rnch. Then ll uttons in this column cn e clered regrdless of how the split is clered. Polynomil-Time Algorithm for 1-color nd ny cut directions. Given n instnce B with C = 1 color nd cut directions d {,,, }, we construct hypergrph G tht hs one node per utton in B. A set of nodes is connected with hyperedge if the corresponding uttons lie on the sme horizontl, verticl, or digonl line whose direction is in d, i.e., they cn potentilly e removed y the sme cut. By Remrk 1 it is sufficient to consider hypergrph with only 2- nd 3-edges. A solution to B corresponds to perfect mtching in G. For clrity, we shll cll 3-edge in G tringle, nd 2-edge simply n edge. Cornuéjols et l. [1] showed how to compute perfect K 2 nd K 3 mtching in grph in polynomil time. However, their result is not directly pplicle to our grph G yet, s we need to find mtching tht consists only of edges nd proper tringles, nd voids K 3 s formed y cycles of three edges. To pply [1] we construct grph G y dding vertices to eliminte ll cycles of three edges s follows (see top of Fig. 3). Strt with G = G. Consider n e = (v,w) G in 3-cycle ( cycle of three edges). There re two cses: e is not djcent to ny tringle in G, or e is djcent to some tringles in G. In the first cse we dd vertices u 1 nd u 2 tht split e into three edges (v,u 1 ), (u 1,u 2 ), nd (u 2,w). In the second cse, when e is djcent to k tringles, we dd 2k vertices u 1,u 2...,u 2k long e, nd replce every p i vw with p i vu 2i 1. Lemm 1. There eists perfect edge- nd tringle-mtching in G iff there eists perfect edge- nd tringle-mtching in G.

6 5 = e v w v w u 1 u 2 = u 3 u 4 u 5 u 6 e u 1 u 2 v w v w p 1 p 2 p 3 p 1 p 2 p 3 d c = d c d c = d c Fig. 3. Top-left: splitting 3-cycles when there re no djcent tringles to edge e; top-right: splitting 3-cycles when e hs djcent tringles (shded). Bottom-left: constructing G c from four cuts locking ech other in cycle; ottom-right: constructing G c from the sme cuts fter ressigning the locking uttons Proof. Given perfect mtching M in G, we construct perfect mtching M in G. Consider e = (v,w) in G. If e is not djcent to ny tringles in G, then if e M then dd edges (v,u 1 ) nd (u 2,w) of G to M (oth v nd w re covered y e, nd ll v, w, u 1, nd u 2 re covered y M ); if e M then dd edge (u 1,u 2 ) of G to M (v nd w re not covered y e, nd u 1 nd u 2 re covered y M ). In oth cses ove the etr nodes in G re covered y edges in M, nd if v nd w in G re covered y e in M then v nd w re covered y (v,u 1 ) nd (u 2,w) in G. If e is djcent to some tringles in G, if e M then in G dd edges (v,u 1 ), (u 2k,w), nd (u 2j,u 2j+1 ) to M, for 1 j < k; if p i vw M for some i then dd p i vu 2i 1, edges (u 2j 1,u 2j ) for 1 j < i, (u 2j,u 2j+1 ) for i j < k, nd (u 2k,w) of G to M ; if neither e nor ny tringle djcent to e is in M then dd edges (u 2j 1,u 2j ) of G to M, for 1 j k. In ll the ove cses the etr nodes in G re covered y edges in M, nd if v nd w in G re covered y e or tringle in M then v nd w re lso covered y (v,u 1 ) nd (u 2,w) or y corresponding tringle in G. Now, given perfect mtching M in G we show how to construct perfect mtching M in G. Agin, consider n edge e in G tht is replced y severl edges in G. If e is not djcent to ny tringles in G, then if u 1 is covered y edge (v,u 1 ) in M then u 2 hs to e covered y edge (u 2,w), therefore we cn dd edge e to M (ll v, w, u 1, nd u 2 re covered y M, nd oth v nd w re covered y e in M); if u 1 is covered y edge (u 1,u 2 ) in M then v nd w hve to e covered y other edges or tringles in M, nd v nd w will e covered y the corresponding edges or tringles in M. In the second cse, when e is djcent to some tringles in G,

7 6 if p i vu 2i 1 M for some i then dd p i vw to M. Edges (u 2j 1,u 2j ) for 1 j < i, (u 2j,u 2j+1 ) for i j < k, nd (u 2k,w) re forced in M, nd thus oth nodes v nd w re covered. Both nodes v nd w re covered y the corresponding tringle p i vw in M; if none of the tringles p i vu 2i 1 is in M then consider node u 1 in G : if u 1 is covered y edge (v,u 1 ) in M then edges (u 2j,u 2j+1 ) for 1 j < k nd (u 2k,w) re forced in M. Therefore we cn dd edge e to M (ll v, w, u j re covered y M, nd oth v nd w re covered y e in M); if u 1 is covered y edge (u 1,u 2 ) in M then edges (u 2j 1,u 2j ) for 2 j k re forced in M, therefore v nd w hve to e covered y other edges or tringles in M, nd v nd w will e covered y the corresponding edges or tringles in M. Thus, perfect edge- nd tringle-mtching in G tht does not use 3-cycle (if it eists) cn e found y first converting G to G nd pplying the result in [1] to G. A solution of B consisting of 2- nd 3-cuts cn e reduced to perfect edge- nd tringle-mtching in G; however, the opposite is not trivil tsk. A perfect mtching in G cn correspond to set of cuts C M in B tht re locking ech other (see ottom of Fig. 3). To etrct proper order of the cuts we uild nother grph G c tht hs node per cut in C M nd directed edge etween two nodes if the cut corresponding to the second node is locking the cut corresponding to the first node. If G c does not hve cycles, then there is prtil order on the cuts. The cuts tht correspond to the nodes with no outgoing edges cn e pplied first, nd the corresponding nodes cn e removed from G c. However, if G c contins cycles, there is no order in which the cuts cn e pplied to cler up ord B. In this cse we will need to modify some of the cuts in order to remove cycles from G c. To do so we perform the following two steps: Repet: choose cycle in G c nd for every edge (c 1,c 2 ) in it ressign the utton of c 2 tht is locking cut c 1 to c 1. After one step the totl numer of uttons in ll the cuts stys the sme, if cut c 2 consisted of two uttons, or if cut c 2 consisted of three uttons nd the utton locking cut c 1 ws not in the middle of c 2, then fter ressigning the uttons the length of c 2 decreses, if cut c 2 consisted of three uttons nd the utton locking cut c 1 ws in the middle of c 2, then fter ressigning the uttons the direction of the edge (c 1,c 2 ) chnges to (c 2,c 1 ). After the previous step cn no longer e pplied to G c such tht the totl length of the cuts decreses, there cn only e cycles left in G c tht consist of 3-cuts with the locking uttons eing the middle ones. Then for ny edge (c 1,c 2 ), if we ressign the middle utton of c 2 to c 1, c 2 will ecome 2-cut, nd c 1 will hve four uttons, nd therefore cn e split into two 2-cuts. The direction of the corresponding edge will lso chnge its direction. In this wy the rest of the cycles cn e removed from G c.

8 7 To summrize, solution to 1-color Buttons & Scissors level B cn e found, if it eists, with following lgorithm: 1. Convert B to hypergrph G tht encodes ll possile cuts of length two nd three uttons using the llowed cut directions. 2. Convert G to G tht contins no 3-cycles tht re not tringles, nd find mtching in G. 3. Construct the directed grph G c tht encodes which cuts from the mtching re locking ech other nd remove ll the cycles from G c y ressigning some uttons to other cuts. 4. Etrct prtil order from G c tht will give proper order in which the cuts cn e pplied to solve B. By Lemm 1 nd y the construction ove we otin the following theorem. Theorem 3. Buttons & Scissors for 1-color, i.e., B&S[n n,1,,,{2,3}](b), is polytime solvle. 3.3 Frequency of Colors Theorem 4. Buttons & Scissors with mimum color frequency F = 3, i.e. B&S[n n,,3,,{2,3}](b), is polytime solvle. Proof. A single cut in ny solution removes color. By Remrk 2, these cuts do not mke solvle ord unsolvle. Thus, greedy lgorithm suffices. Hrdness ws estlished for mimum frequency F = 7 in [2]. We strengthen this to F = 4 vi the modified cluse gdget in Fig. 1 (c). In this gdget the leftmost circulr utton cn e removed if nd only if t lest one of the three non-circulr uttons is removed y verticl cut. Thus, it cn replce the cluse gdget in Section 4.1 of [2]. Theorem 5. Buttons & Scissors with mimum color frequency F = 4, i.e. B&S[n n,,4,,{2,3}](b), is NP-complete. Proof. The puzzle with F = 7, i.e. B&S[n n,,7,,2](b), ws proven NPcomplete in [2] vi 3-SAT whose cluses hve literls of distinct vriles. (The construction creted ords tht do not hve uttons of the sme color on ny digonl, so the NP-completeness ws lso estlished for these prmeters nd oth d = nd d = in [2].) We otin hrdness for F = 4 y modifying the originl proof s cluse gdget. The top of Fig. 4 illustrtes the originl gdget for cluse C = L i L j L k, where L i is either the positive literl for vrile V i or the negtive literl V i, nd similrly L j {V j, V j } nd L k {V k, V k }. Included in this gdget re the following uttons: Two cluse uttons L nd R. The L nd R suscripts denote Left nd Right, respectively. Literl instnce uttons i, M, j, M, nd k, M. The prmeter, refers to the cluse C under considertion, nd we omit it from Fig. 4 nd the discussion elow. The M suscripts denote Middle.

9 8 By convention different shpes nd interior lels different colored uttons, wheres suscripts do not lter the color. Thus, L nd R hve the sme color, wheres i M, j M, nd k M re ll distinct. Ech of the middle uttons cn e removed y verticl cut s denoted y the downwrd rrows. This originl cluse gdget hs the following property: L cn e removed if nd only if t lest one of i M, j M, or k M is removed y verticl cut. The ottom of Fig. 4 illustrtes the new gdget for the sme cluse C = L i L j L k. If n is the numer of vriles in the 3-SAT instnce, then originl gdget ws contined in one row nd 4n + 12 columns, including n + 1 lnk columns to clrify the presenttion. The new gdget uses 8n+5 rows nd 8n+5 columns (see the ottom of Figure 2 in [2]). In this gdget we dd two uttons to those discussed ove: Two dditionl cluse uttons T nd B. The T nd B suscripts denote Top nd Bottom, respectively. We now prove tht the new gdget hs the sme property s the old gdget. We consider four cses tht cover ll possiilities: If i M is cut verticlly, then cut L nd T (nd then B nd R ); If j M is cut verticlly, then cut L nd B (nd then T nd R ); If k M is cut verticlly, then cut L nd R (nd then T nd B ); If none of these uttons is removed y verticl cut, then L cnnot e removed since the only other uttons of the sme color re locked. Therefore, the new gdget is perfect replcement for the previous cluse gdget. This sustitution increses the frequency of ech cluse utton from 2 to 4, nd decreses the frequency of ech instnce literl utton color to 3. Thus, the mimum frequency is reduced from F = 7 to F = 4 y Remrk 6 in [2]. 3.4 Cut Sizes Section 3.2 provided polytime lgorithm for 1-color. However, if we reduce the cut size set from {2,3,4} to {3,4} then it is NP-complete. We lso strengthen Theorem 2 y showing tht 2-color puzzles re hrd with cut size set {2}. Hrdness for Cut Sizes {3, 4} nd 1-Color Theorem 6. Buttons & Scissors for 1-color with cut sizes {3,4}, i.e. B&S[n n, 1,,,{3, 4}](B), is NP-complete. Proof. We show B&S[n n,1,,,{3,4}](b) to e NP-hrd y reduction from PLANAR 3-SAT, which ws shown to e NP-complete y Lichtenstein [4]. An instnce F of the PLANAR 3-SAT prolem is Boolen formul in 3- CNF consisting of set C = {C 1,C 2,...,C m } of m cluses over n vriles V = { 1, 2,..., n }. Cluses in F contin vriles nd negted vriles, denoted s literls. The vrile-cluse incidence grph G = (C V, E) is plnr, where {C i, j } E j or j is in C i, nd with ll vriles connected in cycle. It is sufficient to consider formule where G hs rectiliner emedding, see Knuth

10 9 L i L1 i L2 j L1 j L2 i M j M k M j R1 j R2 k R1 k R2 R T i M L k M R j M B Fig. 4. The originl (top) nd new (ottom) gdget for cluse C = L 1 L 2 L 3. In oth cses the leftmost circulr utton L cn e removed if nd only if t lest one of the three middle uttons i M, j M, k M is removed y verticl cut, s denoted y downwrd rrows. Lels, re omitted from ll of the squre uttons to sve spce, nd the denote empty squres etween the three middle uttons.

11 10 nd Rghunthn [3]. The PLANAR 3-SAT prolem is to decide whether there eists truth ssignment to the vriles such tht t lest one literl per cluse is true. We turn the plnr emedding of G into Buttons & Scissors ord, i.e., we present vriles, cluses nd edges y single-color uttons tht need to e cut. We continue y descriing ech of the gdgets necessry. The vrile gdget is shown in Fig. 5(). The uttons to the right re positioned such tht they cn only e cut with either horizontl cuts of size 3 (lck) or digonl cuts of size 3 (gry)., see Fig. 5(). To otin fesile cutting pttern for the rest, this leves only two cut possiilities for the four verticlly ligned uttons of the vrile gdget: cutting the topmost three uttons, in which cse further cuts in the wire re enforced to e horizontl, or cutting the two topmost nd the ottom utton (which is possile y eecuting the first digonl cut first), in which cse further cuts in the wire re enforced to e digonl. These ectly two fesile solutions of the vrile gdget correspond to truth setting of true (lck) nd flse (gry) of the vrile. The end gdget, shown in Fig. 5(), enles us to end wire to mtch the ends in G s emedding while enforcing tht the sme vlues re propgted through the ent wire. Note tht the three lower of the four verticlly ligned uttons,, 1,..., 4,, hve to e removed with the sme verticl cut, s none of them is ligned with ny other utton pir on the ord. The split gdget, shown in Fig. 6(), enles us to increse the numer of wires leving vrile nd propgting its truth ssignment. The lst digonl cut (gry) nd the lst horizontl cut (lck) of the input wire from the left only feture two uttons in this wire, i.e., if we wnt to mke fesile cut, we need to pick up nother utton, single utton tht strts the two output wires. If we enter with the lck cut pttern, the upper output wire s single utton is cut, () () Fig. 5. () The only two cut possiilities in the vrile gdget (shown in lck nd gry), corresponding to truth ssignments of true nd flse, respectively. () The end gdget for the 1-color cse.

12 11 () () Fig. 6. () The not gdget, negting the input truth ssignment, for the 1-color cse. () The split gdget for the 1-color cse. enforcing lck, horizontl cuts in the rest. In the lower output wire, the single utton still needs to e cut. Ecept for the two uttons of the lst digonl of the input wire, it is only ligned with the other uppermost uttons of this output wire, thus, the horizontl cuts need to e mde, enforcing lck, horizontl cuts in the rest of the wire. An nlogous rgument is used for the gry cut pttern. The not gdget, shown in Fig. 6(), enles us to reverse the truth ssignment in vrile wire. (Tht is, the cut pttern switches from verticl/horizontl to digonl nd vice vers.) Agin, the lst digonl cut (gry) nd the lst horizontl cut (lck) of the input wire from the left only feture two uttons in this wire. Moreover, there is gin single isolted utton. If the gdget is entered with the lck, verticl cut pttern, the isolted utton cnnot e cut with ny cut from the input wire. The only remining possiility is to cut the isolted utton with the two leftmost digonl uttons of the output wire, enforcing digonl cuts in the rest of the wire. If the gdget is entered with the gry, digonl cut pttern, the isolted utton needs to e cut with the lst digonl wire cut (s otherwise its size of two would render it infesile). In the output wire the first digonl cut would e to short, enforcing horizontl cuts in the rest of the wire. The cluse gdget is shown in Fig. 7. Wires from literls pproch the gdget long three digonls. The cluse hs one isolted utton (shown enlrged), nd two dditionl uttons for ech wire tht uild row of four ligned uttons with the lst two uttons of the wire. When gry cut direction is used, the two lower plus the topmost of this row of four comine for fesile cut. If lck cut direction is used, the three lower uttons of this row llow fesile cut. But this still leves the isolted utton to cut: Only if in t lest one of the input wires the lck cuts, corresponding to truth setting of true for the literl, re used, this utton cn e dded to the lst lck cut of the wire (etending its size from 3 to 4). If ll literls re set to flse, i.e., long ll three input wires the gry cut pttern is used, cutting the isolted utton with two others long one of the horizontl/verticl is, leves t lest one isolted utton, rendering the complete ord infesile, s we re not left with n empty ord.

13 12 Fig. 7. The cluse gdget for the 1-color cse. Thus, the resulting Buttons & Scissors ord hs solution if nd only if t lest one of the literls per cluse is set to true, tht is, if nd only if the originl PLANAR 3-SAT formul F is stisfile. It is esy to see tht this reduction is possile in polynomil time. In ddition, given Buttons & Scissors ord nd sequence of cuts, it is esy to check whether those constitute solution, i.e., whether ll cuts re fesile nd result in ord with only empty grid entries. Hence, B&S[n n,1,,,{3,4}](b) is in the clss NP. Consequently, B&S[n n,1,,,{3,4}](b) is NP-complete. Hrdness for Cut Size {2} nd 2-Colors An intermedite prolem is elow. Decision Prolem: Grph Decycling on (G, S). Input: Directed grph G = (V,E) nd set of disjoint pirs of vertices S V V. Output: True, if we cn mke G cyclic y removing either s or s from G for every pir (s,s ) S. Otherwise, Flse. Lemm 2. Grph Decycling reduces to Buttons & Scissors with 2 colors. Proof. Consider n instnce (G, S) to grph decycling. First, we oserve tht we cn ssume tht every verte in G hs degree 2 or 3, nd more specificlly, in-degree 1 or 2, nd out-degree 1 or 2. Indeed, we cn sfely remove ny vertices with in- or out-degree 0 without chnging the outcome of the prolem. Also, we cn replce node with out-degree k y inry tree of nodes with out-degree 2. The sme pplies to nodes with in-degree k. Furthermore, we cn ssume tht every verte tht ppers in S hs degree 2. Indeed, we cn replce ny degree 3 verte y two vertices of degree 2 nd 3, nd use the degree 2 verte in S without chnging the outcome. Similrly, we cn ssume tht no two vertices of degree 3 re djcent. Finlly, we cn ssume

14 13 w u t u v s t u v w t u v s v t () () (c) (d) Fig. 8. Three types of nodes: () in-degree 1 (tu) nd out-degree 1 (uv); () in-degree 2 (su nd tu) nd out-degree 1 (uv); (c) in-degree 1 (tu) nd out-degree 2 (uv nd uw). In (d) the nodes u nd v re linked in S nd we cn choose to remove u or v. tht G is iprtite, nd furthermore, tht ll vertices tht occur in S re in the sme hlf of V, since we cn replce ny edge y pth of two edges. Now, we discuss how to model such grph in Buttons & Scissors instnce. Ech node will correspond to pir of uttons, either red or green pir ccording to iprtition of V. These pirs of uttons will e mpped to loctions in the plne on common (horizontl for red, verticl for green) line, nd such tht ny two uttons of the sme color tht re not pir re not on common (horizontl, verticl, or digonl) line (unless otherwise specified). If two nodes of opposite colors u nd v re connected y n edge in G, we sy tht u locks v. In this cse, one of the uttons of u will e on the sme line s the uttons of v, nd more specificlly, it will e etween the two uttons of v. Tht is, v cn only e cut if u is cut first. Buttons of opposite colors tht re not connected y n edge will not e on ny common lines either. As discussed ove, we cn ssume we hve only three possile types of nodes. Fig. 8() illustrtes the simplest cse, of node u with one incoming edge tu nd one outgoing edge uv. Clerly, t locks u nd u locks v. To model node with in-degree 2, we need to put two uttons of different sme-colored nodes on the sme line (see Fig. 8()). As long s the other endpoints of these two edges re not on common line this is no prolem: we never wnt to crete cut tht removes one utton of s nd one of t, since tht would crete n unsolvle instnce. Finlly, to model node with out-degree 2, we simply plce verticl edge on oth ends of u (see Fig. 8(c)). Note tht is it importnt here tht we do not connect two nodes with out-degree 2 to the sme two nodes with in-degree 2, since then we would hve oth pirs of endpoints on common line; however, we ssumed tht nodes of degree 3 re never djcent so this does not occur. We emed G in this fshion. Wht is left is to crete mechnism to remove vertices from G s dictted y S. We ssume ll vertices in S correspond to green utton pirs. Suppose we hve edges su, uw, tv, nd v, nd u nd v re linked in S. We plce si dditionl green uttons on two verticl lines s illustrted in Fig. 8(d). Three uttons re plced such tht one is on the sme horizontl line s the top end of u nd the other is on the sme horizontl line s the top end of

15 14 v, nd the third is not on common line with ny other node. The third utton ssures we must use this verticl cut, ut we cn choose whether to remove the top of u or the top of v. Similrly, we crete construction tht llows us to remove the ottom of u or the ottom of v. Since u nd v re ordinry degree 2 nodes, we never wnt to remove the top of one nd the ottom of the other, since this would yield n unsolvle sitution. Note tht, in cse we re llows to mke cuts of size 3, we cn lso remove ll si etr nodes completely. This does not ffect the reduction, since it never pys to do so. Lemm 3. SAT reduces to Grph Decycling. Proof. Crete cycle for ech cluse, nd mrk verte in it for ech literl in the cluse: one of these needs to e removed to mke the grph cyclic. Crete pir of removle vertices for ech vrile. Duplicte literls with little ow-tie gdgets: two cycles tht shre verte. If shred verte is not removed, we must remove two more vertices, one from ech cycle. Lemms 2 nd 3 give Theorem 7. Theorem 7. Buttons & Scissors for 2-colors with only cuts of two directions of size 2, i.e., B&S[n n,2,,,{2}](b) is NP-complete. 4 Two-Plyer Gmes We consider four different types of two-plyer Buttons & Scissors vrints, in two different types: Gmes where ech plyer my only mke cuts on specific colors: 1. One plyer my only cut Blue uttons, while the other plyer my only cut Red uttons. 2. Either plyer my cut Green uttons. Gmes where plyers re not restricted to the colors they my cut: 1. The lst plyer who mkes fesile cut wins. (Imprtil) 2. Plyers keep trck of the totl numer of uttons they ve cut. After no more cuts cn e mde, the plyer with the highest numer of uttons cut wins. (Scoring) In the following sections, we show tht ll four vrints re PSPACE-complete. 4.1 Cut-By-Color Gmes In this section the first plyer cn only cut lue uttons, the second plyer cn only cut red uttons, nd the lst plyer to mke cut wins. Theorem 8. The prtisn LAST two-plyer Buttons & Scissors gme, where one plyer cuts lue uttons, the other red uttons, is PSPACE-complete.

16 15 () () (c) (d) (e) Fig. 9. () The red (dshed) vrile gdget, () the lue (solid) vrile gdget, (c) the split gdget, (d) the OR gdget, nd (e) the AND gdget. Lines (or rcs used for clrity) indicte which uttons re ligned. Proof. The proof is y reduction from G %free (CNF) [6]: given oolen formul Φ( 1,..., n ) in CNF nd prtition of the vriles into two disjoint susets of equl size V nd V r, two plyers tke turns in setting vlues of the vriles, the first (Blue) plyer sets the vlues of vriles in V, nd the second (Red) plyer sets the vlues of vriles in V r. Blue wins if, fter ll vriles hve een ssigned some vlues, formul Φ is stisfied, nd loses otherwise. For given instnce of formul Φ we construct Buttons & Scissors ord B, such tht Blue cn win the gme on B if nd only if he cn stisfy formul Φ. We will prove this sttement in different formultion: Red wins the gme on B if nd only if formul Φ cnnot e stisfied. See Fig. 10 for full emple. The red vrile gdget is shown in Fig. 9 (). Red sets the vlue of the corresponding vrile y choosing the first cut to e (flse) or (true), nd thus unlocking one of the two cuts, c or d, respectively, for Blue to follow up (nd to propgte the vlue of the vrile). The lue vrile gdget is shown in Fig. 9 (). Blue sets the vlue of the corresponding vrile y choosing the first cut to e (flse) or (true), nd thus unlocking one of the two cuts, d or e, respectively, for the red plyer to follow up. Blue hs one etr cut c tht is used to pss the turn to Red. Alterntively, Blue cn choose to strt with the 3-utton cut c nd disllow Red from mking ny cuts in the gdget. In tht cse the corresponding vrile cnnot e used to stisfy Φ.

17 16 Fig. 10. Emple for the construction from the proof of Theorem 8: we consider ( y) ( y) (z w).

18 17 Fig. 9 (d) depicts the OR gdget: if Blue cuts or (or oth), Red cn leve the gdget with cut h. Cuts nd unlock cuts c nd d, respectively, which in turn unlock e nd f, respectively. Fig. 9 (e) depicts the AND gdget for two inputs. The proper wy of pssing the gdget: Blue mkes oth cuts nd, nd Red mkes cuts c nd d when they get unlocked, thus enling Blue to mke cut g nd eit the gdget. However, Red could lso tke n illegl cut, thus, unlocking two etr cuts, e nd f, for the lue plyer, nd, hence, putting Red t disdvntge. Thus, if t ny point in the gme Red chooses (or is forced to) mke cut in ny of the AND gdgets, the gme result is predetermined, nd Red cnnot win on B. Fig. 9 (c) shows the split gdget; it enles us to increse the numer of cuts leving vrile nd propgting its truth ssignment. Blue s cut unlocks Red s cut, which unlocks oth c nd d. If Blue cuts c nd d this enles Red to cut e nd f, respectively. The gdget lso eists with Blue nd Red reversed. A vrint of the split gdget evlutes the formul Φ: cuts e nd f re deleted. If the vrile vlues re propgted to this gdget nd Red is forced to mke the cut, Blue then gets etr cuts which Red will not e le to follow up. The gme progresses s follows: Blue selects n ssignment to lue vrile. This unlocks pth of red-lue cuts tht goes through some AND nd OR gdgets nd leds to the finl gdget. As the order of the cuts in such pth is deterministic, nd does not ffect the choice of vlues of other vriles, w.l.o.g., we ssume tht Red nd Blue mke ll the cuts in this pth (until it gets stuck ) efore setting the net vrile. The pth gets stuck when it reches some AND gdget for which the other input hs not een clered. The lst cut in such pth ws mde y Red, thus fterwrds it will e Blue s turn, nd he my choose to mke the leftover cut c from the vrile gdget to pss the turn to Red. If the finl gdget is not unlocked yet, Red lwys hs cut to mke fter Blue mkes move, s there is the sme numer of lue nd red vriles. However, if Blue cn force Red to mke moves until the finl gdget is reched, then Blue gets etr cuts; thus, Red will run out of moves nd lose the gme. Otherwise, if Blue cnnot fulfill some AND or OR gdgets, the Red plyer will mke the lst move nd win. Therefore, if Φ cnnot e stisfied, Red wins. 4.2 Any Color Gmes Theorem 9. Imprtil two-plyer Buttons & Scissors ( Imprtil) is PSPACEcomplete. Theorem 10. Scoring two-plyer Buttons & Scissors ( Scoring) is PSPACEcomplete. We show tht Imprtil is PSPACE-complete, then use one more gdget to show Scoring is PSPACE-complete. We reduce from Geogrphy 1, (PSPACEcomplete [5]). We use Lemm 4 to strt with low-degree Geogrphy instnces. 1 Specificlly, Directed Verte Geogrphy, usully clled Geogrphy.

19 18 Lemm 4. Geogrphy is PSPACE-complete even when vertices hve m degree 3 nd the m in-degree nd out-degree of ech verte is 2. Proof. The proof is simply reduction tht dds some vertices to reduce the degree. To reduce the in-degree, we use the gdget shown in Fig. 11 to itertively reduce the numer of edges entering ny verte, v, with in-degree ove 3. Notice tht the plyer who moves to v will e the sme in oth gmes. y v y v z z Fig. 11. Reducing the in-degree to v y 1 in Geogrphy. To reduce the out-degree, use use n nlgous construction, s shown in Fig. 12. Just s in the previous gdget, we ensure tht the sme plyer will rrive t, y, nd z s in the originl gme. Additionlly, we ensure tht the plyer tht leves v still mkes the choice etween nd y in the reduced gdget. v y v y z z Fig. 12. Reducing the out-degree of v y 1 in Geogrphy. After repetedly reducing the in nd out degree to t most 2, some vertices my still hve oth in nd out degree 2. To fi this, we simply dd two vertices s shown in Fig. 13. v y v y Fig. 13. Finl step for vertices, v, with oth in nd out-degree of 2.

20 19 () c (c) y c c y c () z y y c z z Fig. 14. Reduction gdgets for verte with () one incoming rc nd one outgoing rc, () one incoming rc nd two outgoing rcs, nd (c) two incoming rcs nd one outgoing rcs. The following gdgets prove Theorem 9. In-degree 1, out-degree 1: The gdget for this is pir of uttons such tht removing the first pir frees up the second, s in Fig. 14(). In-degree 1, out-degree 2: The gdget for this is shown in Fig. 14(). Incoming edge is represented y the utton pir colored. The outgoing edges nd c re represented y three non-coliner uttons colored z. After the first plyer removes the utton pir, the second plyer will cut the pir colored, nd the first plyer will cut the y pir. Just s the second plyer would choose etween moving to or c in the Geogrphy position, so do they choose etween cutting the z pir lelled or the z pir lelled c. Once one of those pirs is chosen, the other z-colored utton is strnded. In-degree 2, out-degree 1: The gdget for this is shown in Fig. 14(c). Incoming Geogrphy rcs nd re represented y utton pirs nd, respectively. No mtter which of those two re cut, it llows the pir to e cut, followed y the y pir, then the c pir, representing the c rc in the Geogrphy position. The plyer tht cuts the c pir will e the opposite of the plyer tht cuts the or pir, just s in the Geogrphy position. In-degree 0: The gdgets for this look just like the gdgets for the nlgous in-degree 1 gdgets, ut with the utton pir missing tht represents the incoming edge. Out-degree 0: Ech edge is utton pir tht doesn t free up other uttons upon removl. Proof. (For Theorem 9.) We reduce from our restricted-degree version of Geogrphy. The reduction replces ech Geogrphy verte, v, with the cooresponding gdget descried ove. Ech rc etween two vertices ecomes utton pir (s descried in the reduction) used in the gdgets for oth vertices. To show Scoring is hrd, we crete reduction where fter ech turn, tht plyer will hve cut the most uttons; the lst plyer to move wins. This lternting-

21 20 dvntge sitution is cused y n initil gdget. The optiml ply sequence egins y cutting two uttons, then three, then three, then three finl time. After these first four moves, the first plyer will hve five points nd the second plyer si. Ech susequent cut removes two uttons so ech turn ends with the current plyer hed. c d e c c d d f e f Fig. 15. The strting gdget for Scoring. Fig. 15 shows the strting gdget tht sets up this initil ck-nd-forth. The color-f uttons will e the lst two cut; the right-hnd f utton must e locking the net gdget. Lemm 5 postultes tht f will e lst. Lemm 5. If plyer hs winning strtegy, then prt of tht winning strtegy includes cutting ll possile uttons of colors,, c, d, nd e efore cutting f. Proof. The first plyer only erns two points y cutting ny of,, c, or d. After this first move, there is lwys nother three-point move to tke until ll of,, c, nd d re gone. Thus there re three chnces to ern three points. This gdget is the only plce for plyer to ern three points in one turn, so the second plyer must tke two of those three triple utton cuts. If they don t, they will never hve more points thn the first plyer. The second plyer must spend ech of their first two moves cutting three uttons. Similrly, the first plyer cnnot spend the first three turns erning only two points ech time. If they do, then the second plyer cn tke three on ech of their first three turns, mking the score 6 to 9 in fvor of the second plyer. Since ll moves therefter only ern 2 points, the second plyer will lwys hve more points. The first plyer must cut three uttons on their second or third turn. Thus, fter the first five turns (first-second-first-second-first) the score must e 7 to 6 in fvor of the first plyer. The only wy for this to hppen is if f is cut fter,, c, d, nd e. With the lemms in plce, we cn prove Theorem 10. Proof. (Proof of Theorem 10.) We reduce gin from the low-degree Geogrphy gme considered in Lemm 4. Use the reduction to Imprtil descried erlier to generte Buttons & Scissors ord B. Add the strting gdget for

22 21 Scoring (shown in Fig. 15) to crete B so tht the uttons mrked f lock the first move tht cn e mde on B. After the uttons f re cut, the second plyer will hve ectly one more point thn the first. Throughout ll the gdgets used in the PSPACE-hrd reduction for Imprtil, ech cut removes two uttons. Thus the lst plyer who cn win plying Imprtil on B cn win plying Scoring on B. 5 Open Prolems Interesting prolems for ords with constnt numer of rows re still open. A conjecture for m = 2 rows ppers elow. Conjecture 1. There is polynomil time lgorithm tht removes ll ut s uttons from ny full 2 n ord with C = 2 colors for some constnt s. References 1. G. Cornuéjols, D. Hrtvigsen, nd W. Pulleylnk. Pcking sugrphs in grph. Opertions Reserch Letters, 1(4): , H. Gregg, J. Leonrd, A. Sntigo, nd A. Willims. Buttons & Scissors is NPcomplete. In Proc. 27th Cnd. Conf. Comput. Geom., D. E. Knuth nd A. Rghunthn. The prolem of comptile representtives. SIAM Journl of Discrete Mth., 5(3): , D. Lichtenstein. Plnr formule nd their uses. SIAM J. Comput., 11(2): , D. Lichtenstein nd M. Sipser. Go is polynomil-spce hrd. J. ACM, 27(2): , T. J. Schefer. On the compleity of some two-person perfect-informtion gmes. Journl of Computer nd System Sciences, 16(2): , 1978.

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

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

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

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

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

F. R. K. Chung y. University ofpennsylvania. Philadelphia, Pennsylvania R. L. Graham. AT&T Labs - Research. March 2,1997.

F. R. K. Chung y. University ofpennsylvania. Philadelphia, Pennsylvania R. L. Graham. AT&T Labs - Research. March 2,1997. Forced convex n-gons in the plne F. R. K. Chung y University ofpennsylvni Phildelphi, Pennsylvni 19104 R. L. Grhm AT&T Ls - Reserch Murry Hill, New Jersey 07974 Mrch 2,1997 Astrct In seminl pper from 1935,

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

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

MTH 146 Conics Supplement

MTH 146 Conics Supplement 105- Review of Conics MTH 146 Conics Supplement In this section we review conics If ou ne more detils thn re present in the notes, r through section 105 of the ook Definition: A prol is the set of points

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

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

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

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

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

8.2 Areas in the Plane

8.2 Areas in the Plane 39 Chpter 8 Applictions of Definite Integrls 8. Ares in the Plne Wht ou will lern out... Are Between Curves Are Enclosed Intersecting Curves Boundries with Chnging Functions Integrting with Respect to

More information

arxiv: v1 [math.co] 18 Sep 2015

arxiv: v1 [math.co] 18 Sep 2015 Improvements on the density o miml -plnr grphs rxiv:509.05548v [mth.co] 8 Sep 05 János Brát MTA-ELTE Geometric nd Algeric Comintorics Reserch Group rt@cs.elte.hu nd Géz Tóth Alréd Rényi Institute o Mthemtics,

More information

Before We Begin. Introduction to Spatial Domain Filtering. Introduction to Digital Image Processing. Overview (1): Administrative Details (1):

Before We Begin. Introduction to Spatial Domain Filtering. Introduction to Digital Image Processing. Overview (1): Administrative Details (1): Overview (): Before We Begin Administrtive detils Review some questions to consider Winter 2006 Imge Enhncement in the Sptil Domin: Bsics of Sptil Filtering, Smoothing Sptil Filters, Order Sttistics Filters

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

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

Outline. Introduction Suffix Trees (ST) Building STs in linear time: Ukkonen s algorithm Applications of ST

Outline. Introduction Suffix Trees (ST) Building STs in linear time: Ukkonen s algorithm Applications of ST Suffi Trees Outline Introduction Suffi Trees (ST) Building STs in liner time: Ukkonen s lgorithm Applictions of ST 2 3 Introduction Sustrings String is ny sequence of chrcters. Sustring of string S is

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

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

this grammar generates the following language: Because this symbol will also be used in a later step, it receives the

this grammar generates the following language: Because this symbol will also be used in a later step, it receives the LR() nlysis Drwcks of LR(). Look-hed symols s eplined efore, concerning LR(), it is possile to consult the net set to determine, in the reduction sttes, for which symols it would e possile to perform reductions.

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

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

Summer Review Packet For Algebra 2 CP/Honors

Summer Review Packet For Algebra 2 CP/Honors Summer Review Pcket For Alger CP/Honors Nme Current Course Mth Techer Introduction Alger uilds on topics studied from oth Alger nd Geometr. Certin topics re sufficientl involved tht the cll for some review

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

Grade 7/8 Math Circles Geometric Arithmetic October 31, 2012

Grade 7/8 Math Circles Geometric Arithmetic October 31, 2012 Fculty of Mthemtics Wterloo, Ontrio N2L 3G1 Grde 7/8 Mth Circles Geometric Arithmetic Octoer 31, 2012 Centre for Eduction in Mthemtics nd Computing Ancient Greece hs given irth to some of the most importnt

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

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

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

An Algorithm for Enumerating All Maximal Tree Patterns Without Duplication Using Succinct Data Structure

An Algorithm for Enumerating All Maximal Tree Patterns Without Duplication Using Succinct Data Structure , Mrch 12-14, 2014, Hong Kong An Algorithm for Enumerting All Mximl Tree Ptterns Without Dupliction Using Succinct Dt Structure Yuko ITOKAWA, Tomoyuki UCHIDA nd Motoki SANO Astrct In order to extrct structured

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

Lecture 7: Integration Techniques

Lecture 7: Integration Techniques Lecture 7: Integrtion Techniques Antiderivtives nd Indefinite Integrls. In differentil clculus, we were interested in the derivtive of given rel-vlued function, whether it ws lgeric, eponentil or logrithmic.

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

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

LR Parsing, Part 2. Constructing Parse Tables. Need to Automatically Construct LR Parse Tables: Action and GOTO Table

LR Parsing, Part 2. Constructing Parse Tables. Need to Automatically Construct LR Parse Tables: Action and GOTO Table TDDD55 Compilers nd Interpreters TDDB44 Compiler Construction LR Prsing, Prt 2 Constructing Prse Tles Prse tle construction Grmmr conflict hndling Ctegories of LR Grmmrs nd Prsers Peter Fritzson, Christoph

More information

EXPONENTIAL & POWER GRAPHS

EXPONENTIAL & POWER GRAPHS Eponentil & Power Grphs EXPONENTIAL & POWER GRAPHS www.mthletics.com.u Eponentil EXPONENTIAL & Power & Grphs POWER GRAPHS These re grphs which result from equtions tht re not liner or qudrtic. The eponentil

More information

PPS: User Manual. Krishnendu Chatterjee, Martin Chmelik, Raghav Gupta, and Ayush Kanodia

PPS: User Manual. Krishnendu Chatterjee, Martin Chmelik, Raghav Gupta, and Ayush Kanodia PPS: User Mnul Krishnendu Chtterjee, Mrtin Chmelik, Rghv Gupt, nd Ayush Knodi IST Austri (Institute of Science nd Technology Austri), Klosterneuurg, Austri In this section we descrie the tool fetures,

More information

Solutions to Math 41 Final Exam December 12, 2011

Solutions to Math 41 Final Exam December 12, 2011 Solutions to Mth Finl Em December,. ( points) Find ech of the following its, with justifiction. If there is n infinite it, then eplin whether it is or. ( ) / ln() () (5 points) First we compute the it:

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

Presentation Martin Randers

Presentation Martin Randers Presenttion Mrtin Rnders Outline Introduction Algorithms Implementtion nd experiments Memory consumption Summry Introduction Introduction Evolution of species cn e modelled in trees Trees consist of nodes

More information

The Complexity of Nonrepetitive Coloring

The Complexity of Nonrepetitive Coloring The Complexity of Nonrepetitive Coloring Dániel Mrx Institut für Informtik Humoldt-Universitt zu Berlin dmrx@informtik.hu-erlin.de Mrcus Schefer Deprtment of Computer Science DePul University mschefer@cs.depul.edu

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

The Greedy Method. The Greedy Method

The Greedy Method. The Greedy Method Lists nd Itertors /8/26 Presenttion for use with the textook, Algorithm Design nd Applictions, y M. T. Goodrich nd R. Tmssi, Wiley, 25 The Greedy Method The Greedy Method The greedy method is generl lgorithm

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

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

Lily Yen and Mogens Hansen

Lily Yen and Mogens Hansen SKOLID / SKOLID No. 8 Lily Yen nd Mogens Hnsen Skolid hs joined Mthemticl Myhem which is eing reformtted s stnd-lone mthemtics journl for high school students. Solutions to prolems tht ppered in the lst

More information

Reducing a DFA to a Minimal DFA

Reducing a DFA to a Minimal DFA Lexicl Anlysis - Prt 4 Reducing DFA to Miniml DFA Input: DFA IN Assume DFA IN never gets stuck (dd ded stte if necessry) Output: DFA MIN An equivlent DFA with the minimum numer of sttes. Hrry H. Porter,

More information

MATH 2530: WORKSHEET 7. x 2 y dz dy dx =

MATH 2530: WORKSHEET 7. x 2 y dz dy dx = MATH 253: WORKSHT 7 () Wrm-up: () Review: polr coordintes, integrls involving polr coordintes, triple Riemnn sums, triple integrls, the pplictions of triple integrls (especilly to volume), nd cylindricl

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

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

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

UT1553B BCRT True Dual-port Memory Interface

UT1553B BCRT True Dual-port Memory Interface UTMC APPICATION NOTE UT553B BCRT True Dul-port Memory Interfce INTRODUCTION The UTMC UT553B BCRT is monolithic CMOS integrted circuit tht provides comprehensive MI-STD- 553B Bus Controller nd Remote Terminl

More information

Systems I. Logic Design I. Topics Digital logic Logic gates Simple combinational logic circuits

Systems I. Logic Design I. Topics Digital logic Logic gates Simple combinational logic circuits Systems I Logic Design I Topics Digitl logic Logic gtes Simple comintionl logic circuits Simple C sttement.. C = + ; Wht pieces of hrdwre do you think you might need? Storge - for vlues,, C Computtion

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

ΕΠΛ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

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

9.1 apply the distance and midpoint formulas

9.1 apply the distance and midpoint formulas 9.1 pply the distnce nd midpoint formuls DISTANCE FORMULA MIDPOINT FORMULA To find the midpoint between two points x, y nd x y 1 1,, we Exmple 1: Find the distnce between the two points. Then, find the

More information

YOU ARE: AND THIS IS:

YOU ARE: AND THIS IS: YOU ARE: AND THIS IS: SoHE CMS Mnul As edited August 4, 015 TABLE OF CONTENTS 3 Logging in 4 Pge types within the dshord 5-6 Exploring the toolr 7-8 Adding pge 9 Editing pge 10 Pge templtes: Met Templte

More information

The Complexity of Nonrepetitive Coloring

The Complexity of Nonrepetitive Coloring The Complexity of Nonrepetitive Coloring Dániel Mrx Deprtment of Computer Science nd Informtion Theory Budpest University of Technology nd Econonomics Budpest H-1521, Hungry dmrx@cs.me.hu Mrcus Schefer

More information

The Math Learning Center PO Box 12929, Salem, Oregon Math Learning Center

The Math Learning Center PO Box 12929, Salem, Oregon Math Learning Center Resource Overview Quntile Mesure: Skill or Concept: 80Q Multiply two frctions or frction nd whole numer. (QT N ) Excerpted from: The Mth Lerning Center PO Box 99, Slem, Oregon 9709 099 www.mthlerningcenter.org

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

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

UNIVERSITY OF EDINBURGH COLLEGE OF SCIENCE AND ENGINEERING SCHOOL OF INFORMATICS INFORMATICS 1 COMPUTATION & LOGIC INSTRUCTIONS TO CANDIDATES

UNIVERSITY OF EDINBURGH COLLEGE OF SCIENCE AND ENGINEERING SCHOOL OF INFORMATICS INFORMATICS 1 COMPUTATION & LOGIC INSTRUCTIONS TO CANDIDATES UNIVERSITY OF EDINBURGH COLLEGE OF SCIENCE AND ENGINEERING SCHOOL OF INFORMATICS INFORMATICS COMPUTATION & LOGIC Sturdy st April 7 : to : INSTRUCTIONS TO CANDIDATES This is tke-home exercise. It will not

More information

Lexical Analysis. Amitabha Sanyal. (www.cse.iitb.ac.in/ as) Department of Computer Science and Engineering, Indian Institute of Technology, Bombay

Lexical Analysis. Amitabha Sanyal. (www.cse.iitb.ac.in/ as) Department of Computer Science and Engineering, Indian Institute of Technology, Bombay Lexicl Anlysis Amith Snyl (www.cse.iit.c.in/ s) Deprtment of Computer Science nd Engineering, Indin Institute of Technology, Bomy Septemer 27 College of Engineering, Pune Lexicl Anlysis: 2/6 Recp The input

More information

Fall 2018 Midterm 1 October 11, ˆ You may not ask questions about the exam except for language clarifications.

Fall 2018 Midterm 1 October 11, ˆ You may not ask questions about the exam except for language clarifications. 15-112 Fll 2018 Midterm 1 October 11, 2018 Nme: Andrew ID: Recittion Section: ˆ You my not use ny books, notes, extr pper, or electronic devices during this exm. There should be nothing on your desk or

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

Information Retrieval and Organisation

Information Retrieval and Organisation Informtion Retrievl nd Orgnistion Suffix Trees dpted from http://www.mth.tu.c.il/~himk/seminr02/suffixtrees.ppt Dell Zhng Birkeck, University of London Trie A tree representing set of strings { } eef d

More information

Chapter44. Polygons and solids. Contents: A Polygons B Triangles C Quadrilaterals D Solids E Constructing solids

Chapter44. Polygons and solids. Contents: A Polygons B Triangles C Quadrilaterals D Solids E Constructing solids Chpter44 Polygons nd solids Contents: A Polygons B Tringles C Qudrilterls D Solids E Constructing solids 74 POLYGONS AND SOLIDS (Chpter 4) Opening prolem Things to think out: c Wht different shpes cn you

More information

Today. CS 188: Artificial Intelligence Fall Recap: Search. Example: Pancake Problem. Example: Pancake Problem. General Tree Search.

Today. CS 188: Artificial Intelligence Fall Recap: Search. Example: Pancake Problem. Example: Pancake Problem. General Tree Search. CS 88: Artificil Intelligence Fll 00 Lecture : A* Serch 9//00 A* Serch rph Serch Tody Heuristic Design Dn Klein UC Berkeley Multiple slides from Sturt Russell or Andrew Moore Recp: Serch Exmple: Pncke

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

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

P(r)dr = probability of generating a random number in the interval dr near r. For this probability idea to make sense we must have

P(r)dr = probability of generating a random number in the interval dr near r. For this probability idea to make sense we must have Rndom Numers nd Monte Crlo Methods Rndom Numer Methods The integrtion methods discussed so fr ll re sed upon mking polynomil pproximtions to the integrnd. Another clss of numericl methods relies upon using

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

Simplifying Algebra. Simplifying Algebra. Curriculum Ready.

Simplifying Algebra. Simplifying Algebra. Curriculum Ready. Simplifying Alger Curriculum Redy www.mthletics.com This ooklet is ll out turning complex prolems into something simple. You will e le to do something like this! ( 9- # + 4 ' ) ' ( 9- + 7-) ' ' Give this

More information

box Boxes and Arrows 3 true 7.59 'X' An object is drawn as a box that contains its data members, for example:

box Boxes and Arrows 3 true 7.59 'X' An object is drawn as a box that contains its data members, for example: Boxes nd Arrows There re two kinds of vriles in Jv: those tht store primitive vlues nd those tht store references. Primitive vlues re vlues of type long, int, short, chr, yte, oolen, doule, nd flot. References

More information

View, evaluate, and publish assignments using the Assignment dropbox.

View, evaluate, and publish assignments using the Assignment dropbox. Blckord Lerning System CE 6 Mnging Assignments Competencies After reding this document, you will e le to: Crete ssignments using the Assignment tool. View, evlute, nd pulish ssignments using the Assignment

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

The notation y = f(x) gives a way to denote specific values of a function. The value of f at a can be written as f( a ), read f of a.

The notation y = f(x) gives a way to denote specific values of a function. The value of f at a can be written as f( a ), read f of a. Chpter Prerequisites for Clculus. Functions nd Grphs Wht ou will lern out... Functions Domins nd Rnges Viewing nd Interpreting Grphs Even Functions nd Odd Functions Smmetr Functions Defined in Pieces Asolute

More information

Journal of Graph Algorithms and Applications

Journal of Graph Algorithms and Applications Journl of Grph Algorithms nd Applictions http://www.cs.brown.edu/publictions/jg/ vol. 5, no. 5, pp. 17 38 (2001) New Bounds for Oblivious Mesh Routing Kzuo Iwm School of Informtics Kyoto University Kyoto

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

Announcements. CS 188: Artificial Intelligence Fall Recap: Search. Today. Example: Pancake Problem. Example: Pancake Problem

Announcements. CS 188: Artificial Intelligence Fall Recap: Search. Today. Example: Pancake Problem. Example: Pancake Problem Announcements Project : erch It s live! Due 9/. trt erly nd sk questions. It s longer thn most! Need prtner? Come up fter clss or try Pizz ections: cn go to ny, ut hve priority in your own C 88: Artificil

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

Topics in Analytic Geometry

Topics in Analytic Geometry Nme Chpter 10 Topics in Anltic Geometr Section 10.1 Lines Objective: In this lesson ou lerned how to find the inclintion of line, the ngle between two lines, nd the distnce between point nd line. Importnt

More information

ZZ - Advanced Math Review 2017

ZZ - Advanced Math Review 2017 ZZ - Advnced Mth Review Mtrix Multipliction Given! nd! find the sum of the elements of the product BA First, rewrite the mtrices in the correct order to multiply The product is BA hs order x since B is

More information

Lecture 8: Graph-theoretic problems (again)

Lecture 8: Graph-theoretic problems (again) COMP36111: Advned Algorithms I Leture 8: Grph-theoreti prolems (gin) In Prtt-Hrtmnn Room KB2.38: emil: iprtt@s.mn..uk 2017 18 Reding for this leture: Sipser: Chpter 7. A grph is pir G = (V, E), where V

More information

Inference of node replacement graph grammars

Inference of node replacement graph grammars Glley Proof 22/6/27; :6 File: id293.tex; BOKCTP/Hin p. Intelligent Dt Anlysis (27) 24 IOS Press Inference of node replcement grph grmmrs Jcek P. Kukluk, Lwrence B. Holder nd Dine J. Cook Deprtment of Computer

More information

4-1 NAME DATE PERIOD. Study Guide. Parallel Lines and Planes P Q, O Q. Sample answers: A J, A F, and D E

4-1 NAME DATE PERIOD. Study Guide. Parallel Lines and Planes P Q, O Q. Sample answers: A J, A F, and D E 4-1 NAME DATE PERIOD Pges 142 147 Prllel Lines nd Plnes When plnes do not intersect, they re sid to e prllel. Also, when lines in the sme plne do not intersect, they re prllel. But when lines re not in

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

Section 9.2 Hyperbolas

Section 9.2 Hyperbolas Section 9. Hperols 597 Section 9. Hperols In the lst section, we lerned tht plnets hve pproimtel ellipticl orits round the sun. When n oject like comet is moving quickl, it is le to escpe the grvittionl

More information

Example: 2:1 Multiplexer

Example: 2:1 Multiplexer Exmple: 2:1 Multiplexer Exmple #1 reg ; lwys @( or or s) egin if (s == 1') egin = ; else egin = ; 1 s B. Bs 114 Exmple: 2:1 Multiplexer Exmple #2 Normlly lwys include egin nd sttements even though they

More information

Geometric transformations

Geometric transformations Geometric trnsformtions Computer Grphics Some slides re bsed on Shy Shlom slides from TAU mn n n m m T A,,,,,, 2 1 2 22 12 1 21 11 Rows become columns nd columns become rows nm n n m m A,,,,,, 1 1 2 22

More information

Agenda & Reading. Class Exercise. COMPSCI 105 SS 2012 Principles of Computer Science. Arrays

Agenda & Reading. Class Exercise. COMPSCI 105 SS 2012 Principles of Computer Science. Arrays COMPSCI 5 SS Principles of Computer Science Arrys & Multidimensionl Arrys Agend & Reding Agend Arrys Creting & Using Primitive & Reference Types Assignments & Equlity Pss y Vlue & Pss y Reference Copying

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

Position Heaps: A Simple and Dynamic Text Indexing Data Structure

Position Heaps: A Simple and Dynamic Text Indexing Data Structure Position Heps: A Simple nd Dynmic Text Indexing Dt Structure Andrzej Ehrenfeucht, Ross M. McConnell, Niss Osheim, Sung-Whn Woo Dept. of Computer Science, 40 UCB, University of Colordo t Boulder, Boulder,

More information

ASTs, Regex, Parsing, and Pretty Printing

ASTs, Regex, Parsing, and Pretty Printing ASTs, Regex, Prsing, nd Pretty Printing CS 2112 Fll 2016 1 Algeric Expressions To strt, consider integer rithmetic. Suppose we hve the following 1. The lphet we will use is the digits {0, 1, 2, 3, 4, 5,

More information

Improper Integrals. October 4, 2017

Improper Integrals. October 4, 2017 Improper Integrls October 4, 7 Introduction We hve seen how to clculte definite integrl when the it is rel number. However, there re times when we re interested to compute the integrl sy for emple 3. Here

More information

1.1. Interval Notation and Set Notation Essential Question When is it convenient to use set-builder notation to represent a set of numbers?

1.1. Interval Notation and Set Notation Essential Question When is it convenient to use set-builder notation to represent a set of numbers? 1.1 TEXAS ESSENTIAL KNOWLEDGE AND SKILLS Prepring for 2A.6.K, 2A.7.I Intervl Nottion nd Set Nottion Essentil Question When is it convenient to use set-uilder nottion to represent set of numers? A collection

More information

1.5 Extrema and the Mean Value Theorem

1.5 Extrema and the Mean Value Theorem .5 Extrem nd the Men Vlue Theorem.5. Mximum nd Minimum Vlues Definition.5. (Glol Mximum). Let f : D! R e function with domin D. Then f hs n glol mximum vlue t point c, iff(c) f(x) for ll x D. The vlue

More information