Chart Parsing: the CYK Algorithm

Size: px
Start display at page:

Download "Chart Parsing: the CYK Algorithm"

Transcription

1 Chrt Prsing: the CYK lgorithm Informtics 2: Lecture 20 Shy Cohen 2 November / 43

2 Lst Clss Constituents nd Phrses: phrse inherits the ctegory of its hed. mbiguity: sentence cn hve multiple prse trees (or multiple POS nlyses) Recursive descent Prsing: top-down prser. Iterte through ll rules, in depth-first style, until prse tht mtches the sentence is found. Exhustive serch, essentilly. Shift-Reduce Prsing: Two opertions SHIFT: put word with its POS tg on the stck. REDUCE: Tke sequence of top symbols on the stck nd pop them if they mtch with right-hnd side of rule, nd then plce the left-hnd side on the top of the stck. Why not LL(1)? We hve mbiguous grmmrs! 2 / 43

3 Shift-Reduce Prsing Shift-Reduce prser tries to find sequences of words nd phrses tht correspond to the righthnd side of grmmr production nd replce them with the lefthnd side: Directionlity = bottom-up: strts with the words of the input nd tries to build trees from the words up. Serch strtegy = bredth-first: strts with the words, then pplies rules with mtching right hnd sides, nd so on until the whole sentence is reduced to n S. 3 / 43

4 lgorithm Sketch: Shift-Reduce Prsing Until the words in the sentences re substituted with S: Scn through the input until we recognise something tht corresponds to the RHS of one of the production rules (shift) pply production rule in reverse; i.e., replce the RHS of the rule which ppers in the sententil form with the LHS of the rule (reduce) shift-reduce prser implemented using stck: 1. strt with n empty stck 2. shift ction pushes the current input symbol onto the stck 3. reduce ction replces n items with single item 4 / 43

5 Shift-Reduce Prsing Stck Remining T my dog sw mn in the prk with s 5 / 43

6 Shift-Reduce Prsing Stck Det Remining T dog sw mn in the prk with s my 6 / 43

7 Shift-Reduce Prsing Stck Det N Remining T sw mn in the prk with s my dog 7 / 43

8 Shift-Reduce Prsing Stck NP Remining T sw mn in the prk with s Det my N dog 8 / 43

9 Shift-Reduce Prsing Stck Remining T NP V NP in the prk with s Det N sw Det N my dog mn 9 / 43

10 Shift-Reduce Prsing Stck Remining T NP V NP PP with s Det N sw Det N P NP my dog mn in Det N the prk 10 / 43

11 Shift-Reduce Prsing Stck NP V NP Det N sw NP PP my dog Det N P NP mn in Det N the prk 11 / 43

12 Shift-Reduce Prsing Stck NP VP Det N V NP my dog sw NP PP Det N P NP mn in Det N the prk 12 / 43

13 Shift-Reduce Prsing Stck S NP VP Det N V NP my dog sw NP PP Det N P NP mn in Det N the prk 13 / 43

14 Modern shift-reduce prsers Shift-reduce prsers re highly efficient, they re liner in the length of the string they prse, if they explore only one pth How to do tht? Lern from dt wht ctions to tke t ech point, nd try to mke the optiml decisions so tht the correct prse tree will be found This keeps the prser liner in the length of the string, but one smll error cn propgte through the whole prse, nd led to the wrong prse tree 14 / 43

15 Try it out Yourselves! Recursive Descent Prser >>> from nltk.pp import rdprser >>> rdprser() Shift-Reduce Prser >>> from nltk.pp import srprser >>> srprser() 15 / 43

16 Problems with Prsing s Serch Grmmr Restructuring Problems with Prsing s Serch The CYK lgorithm Prsing s Dynmic Progrmming The CYK lgorithm Properties of the lgorithm 16 / 43

17 Grmmr Restructuring Deterministic prsing (e.g., LL(1)) ims to ddress limited mount of locl mbiguity the problem of not being ble to decide uniquely which grmmr rule to use next in left-to-right nlysis of the input string. By re-structuring the grmmr, the prser cn mke unique decision, bsed on limited mount of look-hed. Recursive Descent prsing lso demnds grmmr restructuring, in order to eliminte left-recursive rules tht cn get it into hopeless loop. 17 / 43

18 Left Recursion But grmmrs for nturl humn lnguges should be reveling, re-structuring the grmmr my destroy this. (Indirectly) left-recursive rules re needed in English. NP DET N NP NPR DET NP s These rules generte NPs with possessive modifiers such s: John s sister John s mother s sister John s mother s uncle s sister John s mother s uncle s sister s niece 18 / 43

19 Left Recursion NP NP NP DET N DET N DET N NP NP NP NPR DET N DET N John s sister NP NPR mother s sister DET NP N uncle s sister John s NP mother s NPR John We don t wnt to re-structure our grmmr rules just to be ble to use prticulr pproch to prsing. Need n lterntive. s 19 / 43

20 How mny prses re there? If our grmmr is mbiguous (inherently, or by design) then how mny possible prses re there? 20 / 43

21 How mny prses re there? If our grmmr is mbiguous (inherently, or by design) then how mny possible prses re there? In generl: n infinite number, if we llow unry recursion. 20 / 43

22 How mny prses re there? If our grmmr is mbiguous (inherently, or by design) then how mny possible prses re there? In generl: n infinite number, if we llow unry recursion. More specific: suppose tht we hve grmmr in Chomsky norml form. How mny possible prses re there for sentence of n words? Imgine tht every nonterminl cn rewrite s every pir of nonterminls ( BC) nd every nonterminl ( ) 1. n 2. n 2 3. n log n 4. (2n)! (n+1)!n! 20 / 43

23 How mny prses re there? 21 / 43

24 How mny prses re there? 21 / 43

25 How mny prses re there? 21 / 43

26 How mny prses re there? 21 / 43

27 How mny prses re there? 21 / 43

28 How mny prses re there? Intution. Let C(n) be the number of binry trees over sentence of length n. The root of this tree hs two subtrees: one over k words (1 k < n), nd one over n k words. Hence, for ll vlues of k, we cn combine ny subtree over k words with ny subtree over n k words: n 1 C(n) = C(k) C(n k) k=1 22 / 43

29 How mny prses re there? Intution. Let C(n) be the number of binry trees over sentence of length n. The root of this tree hs two subtrees: one over k words (1 k < n), nd one over n k words. Hence, for ll vlues of k, we cn combine ny subtree over k words with ny subtree over n k words: n 1 C(n) = C(k) C(n k) k=1 C(n) = (2n)! (n + 1)!n! These numbers re clled the Ctln numbers. They re big numbers! n C(n) / 43

30 Problems with Prsing s Serch 1. recursive descent prser (top-down) will do bdly if there re mny different rules for the sme LHS. Hopeless for rewriting prts of speech (preterminls) with words (terminls). 2. shift-reduce prser (bottom-up) does lot of useless work: mny phrse structures will be loclly possible, but globlly impossible. lso inefficient when there is much lexicl mbiguity. 3. Both strtegies do repeted work by re-nlyzing the sme substring mny times. We will see how chrt prsing solves the re-prsing problem, nd lso copes well with mbiguity. 23 / 43

31 Dynmic Progrmming With CFG, prser should be ble to void re-nlyzing sub-strings becuse the nlysis of ny sub-string is independent of the rest of the prse. The dog sw mn in the prk NP The prser s explortion of its serch spce cn exploit this independence if the prser uses dynmic progrmming. NP Dynmic progrmming is the bsis for ll chrt prsing lgorithms. NP NP 24 / 43

32 Prsing s Dynmic Progrmming Given problem, systemticlly fill tble of solutions to sub-problems: this is clled memoiztion. Once solutions to ll sub-problems hve been ccumulted, solve the overll problem by composing them. For prsing, the sub-problems re nlyses of sub-strings nd correspond to constituents tht hve been found. Sub-trees re stored in chrt (k well-formed substring tble), which is record of ll the substructures tht hve ever been built during the prse. Solves re-prsing problem: sub-trees re looked up, not re-prsed! Solves mbiguity problem: chrt implicitly stores ll prses! 25 / 43

33 Depicting Chrt chrt cn be depicted s mtrix: Rows nd columns of the mtrix correspond to the strt nd end positions of spn (ie, strting right before the first word, ending right fter the finl one); cell in the mtrix corresponds to the sub-string tht strts t the row index nd ends t the column index. It cn contin informtion bout the type of constituent (or constituents) tht spn(s) the substring, pointers to its sub-constituents, nd/or predictions bout wht constituents might follow the substring. 26 / 43

34 CYK lgorithm CYK (Cocke, Younger, Ksmi) is n lgorithm for recognizing nd recording constituents in the chrt. ssumes tht the grmmr is in Chomsky Norml Form: rules ll hve form BC or w. Conversion to CNF cn be done utomticlly. NP Det Nom NP Det Nom Nom N OptP Nom Nom book ornge P Nom OptP ɛ Optdv P hevy ornge dv hevy ornge hevy ornge Det Det Optdv ɛ very dv very N book ornge 27 / 43

35 CYK: n exmple Let s look t simple exmple before we explin the generl cse. Grmmr Rules in CNF NP Det Nom Nom book ornge P Nom P hevy ornge dv hevy ornge Det dv very (N.B. Converting to CNF sometimes breeds dupliction!) Now let s prse: very hevy ornge book 28 / 43

36 Filling out the CYK chrt 0 1 very 2 hevy 3 ornge 4 book very 2 hevy 3 ornge 4 book very hevy ornge book 29 / 43

37 Filling out the CYK chrt 0 1 very 2 hevy 3 ornge 4 book very hevy ornge book 0 Det 1 very 2 hevy 3 ornge 4 book 29 / 43

38 Filling out the CYK chrt 0 1 very 2 hevy 3 ornge 4 book very hevy ornge book 0 Det 1 very dv 2 hevy 3 ornge 4 book 29 / 43

39 Filling out the CYK chrt 0 1 very 2 hevy 3 ornge 4 book very hevy ornge book 0 Det 1 very dv 2 hevy,p 3 ornge 4 book 29 / 43

40 Filling out the CYK chrt 0 1 very 2 hevy 3 ornge 4 book very hevy ornge book 0 Det 1 very dv P 2 hevy,p 3 ornge 4 book 29 / 43

41 Filling out the CYK chrt 0 1 very 2 hevy 3 ornge 4 book very hevy ornge book 0 Det 1 very dv P 2 hevy,p 3 ornge Nom,,P 4 book 29 / 43

42 Filling out the CYK chrt 0 1 very 2 hevy 3 ornge 4 book very hevy ornge book 0 Det 1 very dv P 2 hevy,p Nom 3 ornge Nom,,P 4 book 29 / 43

43 Filling out the CYK chrt 0 1 very 2 hevy 3 ornge 4 book very hevy ornge book 0 Det 1 very dv P Nom 2 hevy,p Nom 3 ornge Nom,,P 4 book 29 / 43

44 Filling out the CYK chrt 0 1 very 2 hevy 3 ornge 4 book very hevy ornge book 0 Det NP 1 very dv P Nom 2 hevy,p Nom 3 ornge Nom,,P 4 book 29 / 43

45 Filling out the CYK chrt 0 1 very 2 hevy 3 ornge 4 book very hevy ornge book 0 Det NP 1 very dv P Nom 2 hevy,p Nom 3 ornge Nom,,P 4 book Nom 29 / 43

46 Filling out the CYK chrt 0 1 very 2 hevy 3 ornge 4 book very hevy ornge book 0 Det NP 1 very dv P Nom 2 hevy,p Nom 3 ornge Nom,,P Nom 4 book Nom 29 / 43

47 Filling out the CYK chrt 0 1 very 2 hevy 3 ornge 4 book very hevy ornge book 0 Det NP 1 very dv P Nom 2 hevy,p Nom Nom 3 ornge Nom,,P Nom 4 book Nom 29 / 43

48 Filling out the CYK chrt 0 1 very 2 hevy 3 ornge 4 book very hevy ornge book 0 Det NP 1 very dv P Nom Nom 2 hevy,p Nom Nom 3 ornge Nom,,P Nom 4 book Nom 29 / 43

49 Filling out the CYK chrt 0 1 very 2 hevy 3 ornge 4 book very hevy ornge book 0 Det NP NP 1 very dv P Nom Nom 2 hevy,p Nom Nom 3 ornge Nom,,P Nom 4 book Nom 29 / 43

50 CYK: The generl lgorithm function CKY-Prse(words, grmmr) returns tble for j from 1 to Length(words) do tble[j 1, j] { words[j] grmmr} for i from j 2 downto 0 do for k i + 1 to j 1 do tble[i, j] tble[i, j] { BC grmmr, B tble[i, k] C tble[k, j]} 30 / 43

51 CYK: The generl lgorithm function CKY-Prse(words, grmmr) returns tble for j from 1 to Length(words) do loop over the columns tble[j 1, j] { words[j] grmmr} fill bottom cell for i from j 2 downto 0 do fill row i in column j for k i + 1 to j 1 do loop over split loctions tble[i, j] tble[i, j] between i nd j { BC grmmr, Check the grmmr B tble[i, k] for rules tht C tble[k, j]} link the constituents in [i, k] with those in [k, j]. For ech rule found store LHS in cell [i, j]. 31 / 43

52 succinct representtion of CKY We hve Boolen tble clled Chrt, such tht Chrt[, i, j] is true if there is sub-phrse ccording the grmmr tht domintes words i through words j Build this chrt recursively, similrly to the Viterbi lgorithm: For j > i + 1: Chrt[, i, j] = j 1 k=i+1 B C Chrt[B, i, k] Chrt[C, k, j] Seed the chrt, for i + 1 = j: Chrt[, i, i + 1] = True if there exists rule w i+1 where w i+1 is the (i + 1)th word in the string 32 / 43

53 From CYK Recognizer to CYK Prser So fr, we just hve chrt recognizer, wy of determining whether string belongs to the given lnguge. Chnging this to prser requires recording which existing constituents were combined to mke ech new constituent. This requires nother field to record the one or more wys in which constituent spnning (i,j) cn be mde from constituents spnning (i,k) nd (k,j). (More clerly displyed in grph representtion, see next lecture.) In ny cse, for fixed grmmr, the CYK lgorithm runs in time O(n 3 ) on n input string of n tokens. The lgorithm identifies ll possible prses. 33 / 43

54 CYK-style prse chrts Even without converting grmmr to CNF, we cn drw CYK-style prse chrts: very hevy ornge book 0 Det NP NP 1 very Optdv OptP Nom Nom 2 hevy,optp Nom Nom 3 ornge N,Nom,,P Nom 4 book N,Nom (We hven t ttempted to show ɛ-phrses here. Could in principle use cells below the min digonl for this... ) However, CYK-style prsing will hve run-time worse thn O(n 3 ) if e.g. the grmmr hs rules BCD. 34 / 43

55 Second exmple Grmmr Rules in CNF S NP VP Nominl book flight money S X 1 VP Nominl Nominl noun X 1 ux VP Nominl Nominl PP S book include prefer VP book include prefer S Verb NP VPVerb NP S X 2 VP X 2 PP S Verb PP X 2 Verb NP S VP PP VP Verb NP NP TW Houston VP VP PP NP Det Nominl PP Preposition NP Verb book include prefer Noun book flight money Let s prse Book the flight through Houston! 35 / 43

56 Second exmple Grmmr Rules in CNF S NP VP Nominl book flight money S X 1 VP Nominl Nominl noun X 1 ux VP Nominl Nominl PP S book include prefer VP book include prefer S Verb NP VPVerb NP S X 2 VP X 2 PP S Verb PP X 2 Verb NP S VP PP VP Verb NP NP TW Houston VP VP PP NP Det Nominl PP Preposition NP Verb book include prefer Noun book flight money Let s prse Book the flight through Houston! 35 / 43

57 Second exmple Book the flight through Houston S, VP, Verb, Nominl, Noun [0, 1] 36 / 43

58 Second exmple Book the flight through Houston S, VP, Verb, Nominl, Noun [0, 1] Det [1, 2] 36 / 43

59 Second exmple Book the flight through Houston S, VP, Verb, Nominl, Noun [0, 1] Det [1, 2] Nominl, Noun [2, 3] 36 / 43

60 Second exmple Book the flight through Houston S, VP, Verb, Nominl, Noun [0, 1] Det [1, 2] Nominl, Noun [2, 3] Prep [3, 4] 36 / 43

61 Second exmple Book the flight through Houston S, VP, Verb, Nominl, Noun [0, 1] Det [1, 2] Nominl, Noun [2, 3] Prep [3, 4] NP, Proper- Noun [4, 5] 36 / 43

62 Second exmple Book the flight through Houston S, VP, Verb, Nominl, Noun [0, 1] [0, 2] Det [1, 2] Nominl, Noun [2, 3] Prep [3, 4] NP, Proper- Noun [4, 5] 36 / 43

63 Second exmple Book the flight through Houston S, VP, Verb, Nominl, Noun [0, 1] [0, 2] Det NP [1, 2] [1, 3] Nominl, Noun [2, 3] Prep [3, 4] NP, Proper- Noun [4, 5] 36 / 43

64 Second exmple Book the flight through Houston S, VP, Verb, Nominl, Noun S, VP, X2 [0, 1] [0, 2] [0, 3] Det NP [1, 2] [1, 3] Nominl, Noun [2, 3] Prep [3, 4] NP, Proper- Noun [4, 5] 36 / 43

65 Second exmple Book the flight through Houston S, VP, Verb, Nominl, Noun S, VP, X2 [0, 1] [0, 2] [0, 3] Det NP [1, 2] [1, 3] Nominl, Noun [2, 3] [2, 4] Prep [3, 4] NP, Proper- Noun [4, 5] 36 / 43

66 Second exmple Book the flight through Houston S, VP, Verb, Nominl, Noun S, VP, X2 [0, 1] [0, 2] [0, 3] Det NP [1, 2] [1, 3] [1, 4] Nominl, Noun [2, 3] [2, 4] Prep [3, 4] NP, Proper- Noun [4, 5] 36 / 43

67 Second exmple Book the flight through Houston S, VP, Verb, Nominl, Noun S, VP, X2 [0, 1] [0, 2] [0, 3] [0, 4] Det NP [1, 2] [1, 3] [1, 4] Nominl, Noun [2, 3] [2, 4] Prep [3, 4] NP, Proper- Noun [4, 5] 36 / 43

68 Second exmple Book the flight through Houston S, VP, Verb, Nominl, Noun S, VP, X2 [0, 1] [0, 2] [0, 3] [0, 4] Det NP [1, 2] [1, 3] [1, 4] Nominl, Noun [2, 3] [2, 4] Prep PP [3, 4] [3, 5] NP, Proper- Noun [4, 5] 36 / 43

69 Second exmple Book the flight through Houston S, VP, Verb, Nominl, Noun S, VP, X2 [0, 1] [0, 2] [0, 3] [0, 4] Det NP [1, 2] [1, 3] [1, 4] Nominl, Nominl Noun [2, 3] [2, 4] [2, 5] Prep PP [3, 4] [3, 5] NP, Proper- Noun [4, 5] 36 / 43

70 Second exmple Book the flight through Houston S, VP, Verb, Nominl, Noun S, VP, X2 [0, 1] [0, 2] [0, 3] [0, 4] Det NP NP [1, 2] [1, 3] [1, 4] [1, 5] Nominl, Nominl Noun [2, 3] [2, 4] [2, 5] Prep PP [3, 4] [3, 5] NP, Proper- Noun [4, 5] 36 / 43

71 Second exmple Book the flight through Houston S, VP, Verb, Nominl, Noun S, VP, X2 S 1, VP, X2, S 2, VP, S 3 [0, 1] [0, 2] [0, 3] [0, 4] [0, 5] Det NP NP [1, 2] [1, 3] [1, 4] [1, 5] Nominl, Nominl Noun [2, 3] [2, 4] [2, 5] Prep PP [3, 4] [3, 5] NP, Proper- Noun [4, 5] 36 / 43

72 Visulizing the Chrt 37 / 43

73 Visulizing the Chrt 38 / 43

74 Dynmic Progrmming s problem-solving technique Given problem, systemticlly fill tble of solutions to sub-problems: this is clled memoiztion. Once solutions to ll sub-problems hve been ccumulted, solve the overll problem by composing them. For prsing, the sub-problems re nlyses of sub-strings nd correspond to constituents tht hve been found. Sub-trees re stored in chrt (k well-formed substring tble), which is record of ll the substructures tht hve ever been built during the prse. Solves re-prsing problem: sub-trees re looked up, not re-prsed! Solves mbiguity problem: chrt implicitly stores ll prses! 39 / 43

75 Tribute to CKY (prt 1/3) You, my CKY lgorithm, dictte every prser s rhythm, if Cocke, Younger nd Ksmi hdn t bothered, ll of our prsing drems would hve been shttered. You re so simple, yet so powerful, nd with the proper semiring nd time, you will be truthful, to return the best prse - nything less would be crime. With dynmic progrmming or memoiztion, you re one of kind, I relly don t need to mention, if it werent for you, ll syntx trees would be behind. 40 / 43

76 Tribute to CKY (prt 2/3) Filed ttempts hve been mde to show there re better, for exmple, by using mtrix multipliction, ll of these imprcticl lgorithms didn t mtter you cme out stronger, insisting on just using summtion. ll prsing lgorithms to you hil, t lest those with bckbones which re context-free, you will never become stle, s long s we need to hve syntx tree. It doesn t mtter tht the C is lwys in front, or tht the K nd Y cn swp, you re still on the sme hunt, mximizing nd summing, nonstop. 41 / 43

77 Tribute to CKY (prt 3/3) Every Informtics student knows you intimtely, they hve seen your vrints dozens of times, you hve erned tht respect legitimtely, nd you will follow them through their primes. CKY, going bckwrd nd forwrd, inside nd out, it is so strightforwrd - You re the best, there is no doubt. 42 / 43

78 Summry Prsing s serch is inefficient (typiclly exponentil time). lterntive: use dynmic progrmming nd memoize sub-nlysis in chrt to void duplicte work. The chrt cn be visulized s s mtrix. The CYK lgorithm builds chrt in O(n 3 ) time. The bsic version gives just recognizer, but it cn be mde into prser if more info is recorded in the chrt. Reding: J&M (2nd ed), Chpter. 13, Sections NLTK Book, Chpter. 8 (nlyzing Sentence Structure), Section 8.4 Next lecture: the Erley prser or dynmic progrmming for topdown prsing 43 / 43

Informatics 2A: Lecture 20. Shay Cohen. 31 October 2017

Informatics 2A: Lecture 20. Shay Cohen. 31 October 2017 Informtics 2: Lecture 20 Shy Cohen 31 October 2017 1 / 32 Lst Clss Constituents nd Phrses: phrse inherits the ctegory of its hed. mbiguity: sentence cn hve multiple prse trees (or multiple POS nlyses)

More information

1.4 Nonregular Languages

1.4 Nonregular Languages 74 1.4 Nonregulr Lnguges The number of forml lnguges over ny lphbet (= decision/recognition problems) is uncountble On the other hnd, the number of regulr expressions (= strings) is countble Hence, ll

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 Automt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Problem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) Anton Setzer (Bsed on book drft by J. V. Tucker nd K. Stephenson)

More information

CS 314 Principles of Programming Languages

CS 314 Principles of Programming Languages C 314 Principles of Progrmming Lnguges Lecture 6: LL(1) Prsing Zheng (Eddy) Zhng Rutgers University Ferury 5, 2018 Clss Informtion Homework 2 due tomorrow. Homework 3 will e posted erly next week. 2 Top

More information

Closure Properties of Regular Languages

Closure Properties of Regular Languages Closure Properties of Regulr Lnguges Regulr lnguges re closed under mny set opertions. Let L 1 nd L 2 e regulr lnguges. (1) L 1 L 2 (the union) is regulr. (2) L 1 L 2 (the conctention) is regulr. (3) L

More information

Parse trees, ambiguity, and Chomsky normal form

Parse trees, ambiguity, and Chomsky normal form Prse trees, miguity, nd Chomsky norml form In this lecture we will discuss few importnt notions connected with contextfree grmmrs, including prse trees, miguity, nd specil form for context-free grmmrs

More information

First Midterm Examination

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

More information

FABER Formal Languages, Automata and Models of Computation

FABER Formal Languages, Automata and Models of Computation DVA337 FABER Forml Lnguges, Automt nd Models of Computtion Lecture 5 chool of Innovtion, Design nd Engineering Mälrdlen University 2015 1 Recp of lecture 4 y definition suset construction DFA NFA stte

More information

Normal Forms for Context-free Grammars

Normal Forms for Context-free Grammars Norml Forms for Context-free Grmmrs 1 Linz 6th, Section 6.2 wo Importnt Norml Forms, pges 171--178 2 Chomsky Norml Form All productions hve form: A BC nd A vrile vrile terminl 3 Exmples: S AS S AS S S

More information

Formal Languages Simplifications of CFGs

Formal Languages Simplifications of CFGs Forml Lnguges implifictions of CFGs ubstitution Rule Equivlent grmmr b bc ubstitute b bc bbc b 2 ubstitution Rule b bc bbc ubstitute b bc bbc bc Equivlent grmmr 3 In generl: xz y 1 ubstitute y 1 xz xy1z

More information

Parsing and Pattern Recognition

Parsing and Pattern Recognition Topics in IT Prsing nd Pttern Recognition Week Context-Free Prsing College of Informtion Science nd Engineering Ritsumeikn University this week miguity in nturl lnguge in mchine lnguges top-down, redth-first

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 Automt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Problem (II) Chpter II.6.: Push Down Automt Remrk: This mteril is no longer tught nd not directly exm relevnt Anton Setzer (Bsed

More information

Formal languages, automata, and theory of computation

Formal languages, automata, and theory of computation Mälrdlen University TEN1 DVA337 2015 School of Innovtion, Design nd Engineering Forml lnguges, utomt, nd theory of computtion Thursdy, Novemer 5, 14:10-18:30 Techer: Dniel Hedin, phone 021-107052 The exm

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automt Theory nd Forml Lnguges TMV027/DIT321 LP4 2018 Lecture 10 An Bove April 23rd 2018 Recp: Regulr Lnguges We cn convert between FA nd RE; Hence both FA nd RE ccept/generte regulr lnguges; More

More information

CS 188: Artificial Intelligence Spring 2007

CS 188: Artificial Intelligence Spring 2007 CS 188: Artificil Intelligence Spring 2007 Lecture 3: Queue-Bsed Serch 1/23/2007 Srini Nrynn UC Berkeley Mny slides over the course dpted from Dn Klein, Sturt Russell or Andrew Moore Announcements Assignment

More information

Overview HC9. Parsing: Top-Down & LL(1) Context-Free Grammars (1) Introduction. CFGs (3) Context-Free Grammars (2) Vertalerbouw HC 9: Ch.

Overview HC9. Parsing: Top-Down & LL(1) Context-Free Grammars (1) Introduction. CFGs (3) Context-Free Grammars (2) Vertalerbouw HC 9: Ch. Overview H9 Vertlerouw H 9: Prsing: op-down & LL(1) do 3 mei 2001 56 heo Ruys h. 8 - Prsing 8.1 ontext-free Grmmrs 8.2 op-down Prsing 8.3 LL(1) Grmmrs See lso [ho, Sethi & Ullmn 1986] for more thorough

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 utomt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Prolem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) nton Setzer (Bsed on ook drft y J. V. Tucker nd K. Stephenson)

More information

Context-Free Grammars and Languages

Context-Free Grammars and Languages Context-Free Grmmrs nd Lnguges (Bsed on Hopcroft, Motwni nd Ullmn (2007) & Cohen (1997)) Introduction Consider n exmple sentence: A smll ct ets the fish English grmmr hs rules for constructing sentences;

More information

Convert the NFA into DFA

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

More information

First Midterm Examination

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

More information

Where did dynamic programming come from?

Where did dynamic programming come from? Where did dynmic progrmming come from? String lgorithms Dvid Kuchk cs302 Spring 2012 Richrd ellmn On the irth of Dynmic Progrmming Sturt Dreyfus http://www.eng.tu.c.il/~mi/cd/ or50/1526-5463-2002-50-01-0048.pdf

More information

Handout: Natural deduction for first order logic

Handout: Natural deduction for first order logic MATH 457 Introduction to Mthemticl Logic Spring 2016 Dr Json Rute Hndout: Nturl deduction for first order logic We will extend our nturl deduction rules for sententil logic to first order logic These notes

More information

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

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4 Intermedite Mth Circles Wednesdy, Novemer 14, 2018 Finite Automt II Nickols Rollick nrollick@uwterloo.c Regulr Lnguges Lst time, we were introduced to the ide of DFA (deterministic finite utomton), one

More information

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh Lnguges nd Automt Finite Automt Informtics 2A: Lecture 3 John Longley School of Informtics University of Edinburgh jrl@inf.ed.c.uk 22 September 2017 1 / 30 Lnguges nd Automt 1 Lnguges nd Automt Wht is

More information

1 Online Learning and Regret Minimization

1 Online Learning and Regret Minimization 2.997 Decision-Mking in Lrge-Scle Systems My 10 MIT, Spring 2004 Hndout #29 Lecture Note 24 1 Online Lerning nd Regret Minimiztion In this lecture, we consider the problem of sequentil decision mking in

More information

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

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

More information

Chapter 0. What is the Lebesgue integral about?

Chapter 0. What is the Lebesgue integral about? Chpter 0. Wht is the Lebesgue integrl bout? The pln is to hve tutoril sheet ech week, most often on Fridy, (to be done during the clss) where you will try to get used to the ides introduced in the previous

More information

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

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

More information

This lecture covers Chapter 8 of HMU: Properties of CFLs

This lecture covers Chapter 8 of HMU: Properties of CFLs This lecture covers Chpter 8 of HMU: Properties of CFLs Turing Mchine Extensions of Turing Mchines Restrictions of Turing Mchines Additionl Reding: Chpter 8 of HMU. Turing Mchine: Informl Definition B

More information

Math 520 Final Exam Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008

Math 520 Final Exam Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008 Mth 520 Finl Exm Topic Outline Sections 1 3 (Xio/Dums/Liw) Spring 2008 The finl exm will be held on Tuesdy, My 13, 2-5pm in 117 McMilln Wht will be covered The finl exm will cover the mteril from ll of

More information

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

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

More information

Reinforcement Learning

Reinforcement Learning Reinforcement Lerning Tom Mitchell, Mchine Lerning, chpter 13 Outline Introduction Comprison with inductive lerning Mrkov Decision Processes: the model Optiml policy: The tsk Q Lerning: Q function Algorithm

More information

19 Optimal behavior: Game theory

19 Optimal behavior: Game theory Intro. to Artificil Intelligence: Dle Schuurmns, Relu Ptrscu 1 19 Optiml behvior: Gme theory Adversril stte dynmics hve to ccount for worst cse Compute policy π : S A tht mximizes minimum rewrd Let S (,

More information

1.3 Regular Expressions

1.3 Regular Expressions 56 1.3 Regulr xpressions These hve n importnt role in describing ptterns in serching for strings in mny pplictions (e.g. wk, grep, Perl,...) All regulr expressions of lphbet re 1.Ønd re regulr expressions,

More information

For convenience, we rewrite m2 s m2 = m m m ; where m is repeted m times. Since xyz = m m m nd jxyj»m, we hve tht the string y is substring of the fir

For convenience, we rewrite m2 s m2 = m m m ; where m is repeted m times. Since xyz = m m m nd jxyj»m, we hve tht the string y is substring of the fir CSCI 2400 Models of Computtion, Section 3 Solutions to Homework 4 Problem 1. ll the solutions below refer to the Pumping Lemm of Theorem 4.8, pge 119. () L = f n b l k : k n + lg Let's ssume for contrdiction

More information

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

CS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions CS 330 Forml Methods nd Models Dn Richrds, George Mson University, Spring 2016 Quiz Solutions Quiz 1, Propositionl Logic Dte: Ferury 9 1. (4pts) ((p q) (q r)) (p r), prove tutology using truth tles. p

More information

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

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

More information

Duality # Second iteration for HW problem. Recall our LP example problem we have been working on, in equality form, is given below.

Duality # Second iteration for HW problem. Recall our LP example problem we have been working on, in equality form, is given below. Dulity #. Second itertion for HW problem Recll our LP emple problem we hve been working on, in equlity form, is given below.,,,, 8 m F which, when written in slightly different form, is 8 F Recll tht we

More information

CSC 473 Automata, Grammars & Languages 11/9/10

CSC 473 Automata, Grammars & Languages 11/9/10 CSC 473 utomt, Grmmrs & Lnguges 11/9/10 utomt, Grmmrs nd Lnguges Discourse 06 Decidbility nd Undecidbility Decidble Problems for Regulr Lnguges Theorem 4.1: (embership/cceptnce Prob. for DFs) = {, w is

More information

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun: CMPU 240 Lnguge Theory nd Computtion Spring 2019 NFAs nd Regulr Expressions Lst clss: Introduced nondeterministic finite utomt with -trnsitions Tody: Prove n NFA- is no more powerful thn n NFA Introduce

More information

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

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

More information

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

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations. Lecture 3 3 Solving liner equtions In this lecture we will discuss lgorithms for solving systems of liner equtions Multiplictive identity Let us restrict ourselves to considering squre mtrices since one

More information

Coalgebra, Lecture 15: Equations for Deterministic Automata

Coalgebra, Lecture 15: Equations for Deterministic Automata Colger, Lecture 15: Equtions for Deterministic Automt Julin Slmnc (nd Jurrin Rot) Decemer 19, 2016 In this lecture, we will study the concept of equtions for deterministic utomt. The notes re self contined

More information

The transformation to right derivation is called the canonical reduction sequence. Bottom-up analysis

The transformation to right derivation is called the canonical reduction sequence. Bottom-up analysis Bottom-up nlysis Shift-reduce prsing. Constructs the derivtion tree from ottom to top. Reduces the string to the strt symol. Produces reverse right derivtion. Exmple: G(E): 1. E E + T 2. T 3. T T * F 4.

More information

Lecture 2e Orthogonal Complement (pages )

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

More information

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS CS 310 (sec 20) - Winter 2003 - Finl Exm (solutions) SOLUTIONS 1. (Logic) Use truth tles to prove the following logicl equivlences: () p q (p p) (q q) () p q (p q) (p q) () p q p q p p q q (q q) (p p)

More information

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages Deprtment of Computer Science, Austrlin Ntionl University COMP2600 Forml Methods for Softwre Engineering Semester 2, 206 Assignment Automt, Lnguges, nd Computility Smple Solutions Finite Stte Automt nd

More information

General idea LR(0) SLR LR(1) LALR To best exploit JavaCUP, should understand the theoretical basis (LR parsing);

General idea LR(0) SLR LR(1) LALR To best exploit JavaCUP, should understand the theoretical basis (LR parsing); Bottom up prsing Generl ide LR(0) SLR LR(1) LLR To best exploit JvCUP, should understnd the theoreticl bsis (LR prsing); 1 Top-down vs Bottom-up Bottom-up more powerful thn top-down; Cn process more powerful

More information

q 2 in δ 2. [4: 1 mark q 1 in δ 1 and q 2 and (q 1, q 2 ) (q 1, q 2) whenever q 1 for each component] (b) The resulting DFA:

q 2 in δ 2. [4: 1 mark q 1 in δ 1 and q 2 and (q 1, q 2 ) (q 1, q 2) whenever q 1 for each component] (b) The resulting DFA: Module Title: Informtics 2A Exm Diet (Dec/April/Aug): Aug 2015 Brief notes on nswers: 1. () Lexing: The input is progrm text [1].The output is strem of lexemes pired with their lexicl clsses [1]. For exmple

More information

Vyacheslav Telnin. Search for New Numbers.

Vyacheslav Telnin. Search for New Numbers. Vycheslv Telnin Serch for New Numbers. 1 CHAPTER I 2 I.1 Introduction. In 1984, in the first issue for tht yer of the Science nd Life mgzine, I red the rticle "Non-Stndrd Anlysis" by V. Uspensky, in which

More information

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute Victor Admchik Dnny Sletor Gret Theoreticl Ides In Computer Science CS 5-25 Spring 2 Lecture 2 Mr 3, 2 Crnegie Mellon University Deterministic Finite Automt Finite Automt A mchine so simple tht you cn

More information

Homework 3 Solutions

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

More information

KNOWLEDGE-BASED AGENTS INFERENCE

KNOWLEDGE-BASED AGENTS INFERENCE AGENTS THAT REASON LOGICALLY KNOWLEDGE-BASED AGENTS Two components: knowledge bse, nd n inference engine. Declrtive pproch to building n gent. We tell it wht it needs to know, nd It cn sk itself wht to

More information

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

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS The University of Nottinghm SCHOOL OF COMPUTER SCIENCE LEVEL 2 MODULE, SPRING SEMESTER 2016 2017 LNGUGES ND COMPUTTION NSWERS Time llowed TWO hours Cndidtes my complete the front cover of their nswer ook

More information

Lexical Analysis Finite Automate

Lexical Analysis Finite Automate Lexicl Anlysis Finite Automte CMPSC 470 Lecture 04 Topics: Deterministic Finite Automt (DFA) Nondeterministic Finite Automt (NFA) Regulr Expression NFA DFA A. Finite Automt (FA) FA re grph, like trnsition

More information

DATA Search I 魏忠钰. 复旦大学大数据学院 School of Data Science, Fudan University. March 7 th, 2018

DATA Search I 魏忠钰. 复旦大学大数据学院 School of Data Science, Fudan University. March 7 th, 2018 DATA620006 魏忠钰 Serch I Mrch 7 th, 2018 Outline Serch Problems Uninformed Serch Depth-First Serch Bredth-First Serch Uniform-Cost Serch Rel world tsk - Pc-mn Serch problems A serch problem consists of:

More information

Administrivia CSE 190: Reinforcement Learning: An Introduction

Administrivia CSE 190: Reinforcement Learning: An Introduction Administrivi CSE 190: Reinforcement Lerning: An Introduction Any emil sent to me bout the course should hve CSE 190 in the subject line! Chpter 4: Dynmic Progrmming Acknowledgment: A good number of these

More information

Things to Memorize: A Partial List. January 27, 2017

Things to Memorize: A Partial List. January 27, 2017 Things to Memorize: A Prtil List Jnury 27, 2017 Chpter 2 Vectors - Bsic Fcts A vector hs mgnitude (lso clled size/length/norm) nd direction. It does not hve fixed position, so the sme vector cn e moved

More information

Part 5 out of 5. Automata & languages. A primer on the Theory of Computation. Last week was all about. a superset of Regular Languages

Part 5 out of 5. Automata & languages. A primer on the Theory of Computation. Last week was all about. a superset of Regular Languages Automt & lnguges A primer on the Theory of Computtion Lurent Vnbever www.vnbever.eu Prt 5 out of 5 ETH Zürich (D-ITET) October, 19 2017 Lst week ws ll bout Context-Free Lnguges Context-Free Lnguges superset

More information

1 Nondeterministic Finite Automata

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

More information

Lecture 6 Regular Grammars

Lecture 6 Regular Grammars Lecture 6 Regulr Grmmrs COT 4420 Theory of Computtion Section 3.3 Grmmr A grmmr G is defined s qudruple G = (V, T, S, P) V is finite set of vribles T is finite set of terminl symbols S V is specil vrible

More information

Lecture Note 9: Orthogonal Reduction

Lecture Note 9: Orthogonal Reduction MATH : Computtionl Methods of Liner Algebr 1 The Row Echelon Form Lecture Note 9: Orthogonl Reduction Our trget is to solve the norml eution: Xinyi Zeng Deprtment of Mthemticl Sciences, UTEP A t Ax = A

More information

Harvard University Computer Science 121 Midterm October 23, 2012

Harvard University Computer Science 121 Midterm October 23, 2012 Hrvrd University Computer Science 121 Midterm Octoer 23, 2012 This is closed-ook exmintion. You my use ny result from lecture, Sipser, prolem sets, or section, s long s you quote it clerly. The lphet is

More information

UNIFORM CONVERGENCE. Contents 1. Uniform Convergence 1 2. Properties of uniform convergence 3

UNIFORM CONVERGENCE. Contents 1. Uniform Convergence 1 2. Properties of uniform convergence 3 UNIFORM CONVERGENCE Contents 1. Uniform Convergence 1 2. Properties of uniform convergence 3 Suppose f n : Ω R or f n : Ω C is sequence of rel or complex functions, nd f n f s n in some sense. Furthermore,

More information

Goals: Determine how to calculate the area described by a function. Define the definite integral. Explore the relationship between the definite

Goals: Determine how to calculate the area described by a function. Define the definite integral. Explore the relationship between the definite Unit #8 : The Integrl Gols: Determine how to clculte the re described by function. Define the definite integrl. Eplore the reltionship between the definite integrl nd re. Eplore wys to estimte the definite

More information

HW3, Math 307. CSUF. Spring 2007.

HW3, Math 307. CSUF. Spring 2007. HW, Mth 7. CSUF. Spring 7. Nsser M. Abbsi Spring 7 Compiled on November 5, 8 t 8:8m public Contents Section.6, problem Section.6, problem Section.6, problem 5 Section.6, problem 7 6 5 Section.6, problem

More information

N 0 completions on partial matrices

N 0 completions on partial matrices N 0 completions on prtil mtrices C. Jordán C. Mendes Arújo Jun R. Torregros Instituto de Mtemátic Multidisciplinr / Centro de Mtemátic Universidd Politécnic de Vlenci / Universidde do Minho Cmino de Ver

More information

MAA 4212 Improper Integrals

MAA 4212 Improper Integrals Notes by Dvid Groisser, Copyright c 1995; revised 2002, 2009, 2014 MAA 4212 Improper Integrls The Riemnn integrl, while perfectly well-defined, is too restrictive for mny purposes; there re functions which

More information

Uninformed Search Lecture 4

Uninformed Search Lecture 4 Lecture 4 Wht re common serch strtegies tht operte given only serch problem? How do they compre? 1 Agend A quick refresher DFS, BFS, ID-DFS, UCS Unifiction! 2 Serch Problem Formlism Defined vi the following

More information

3 Regular expressions

3 Regular expressions 3 Regulr expressions Given n lphet Σ lnguge is set of words L Σ. So fr we were le to descrie lnguges either y using set theory (i.e. enumertion or comprehension) or y n utomton. In this section we shll

More information

Solution for Assignment 1 : Intro to Probability and Statistics, PAC learning

Solution for Assignment 1 : Intro to Probability and Statistics, PAC learning Solution for Assignment 1 : Intro to Probbility nd Sttistics, PAC lerning 10-701/15-781: Mchine Lerning (Fll 004) Due: Sept. 30th 004, Thursdy, Strt of clss Question 1. Bsic Probbility ( 18 pts) 1.1 (

More information

Natural examples of rings are the ring of integers, a ring of polynomials in one variable, the ring

Natural examples of rings are the ring of integers, a ring of polynomials in one variable, the ring More generlly, we define ring to be non-empty set R hving two binry opertions (we ll think of these s ddition nd multipliction) which is n Abelin group under + (we ll denote the dditive identity by 0),

More information

Theoretical foundations of Gaussian quadrature

Theoretical foundations of Gaussian quadrature Theoreticl foundtions of Gussin qudrture 1 Inner product vector spce Definition 1. A vector spce (or liner spce) is set V = {u, v, w,...} in which the following two opertions re defined: (A) Addition of

More information

Recitation 3: More Applications of the Derivative

Recitation 3: More Applications of the Derivative Mth 1c TA: Pdric Brtlett Recittion 3: More Applictions of the Derivtive Week 3 Cltech 2012 1 Rndom Question Question 1 A grph consists of the following: A set V of vertices. A set E of edges where ech

More information

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh Finite Automt Informtics 2A: Lecture 3 Mry Cryn School of Informtics University of Edinburgh mcryn@inf.ed.c.uk 21 September 2018 1 / 30 Lnguges nd Automt Wht is lnguge? Finite utomt: recp Some forml definitions

More information

Agenda. Agenda. Regular Expressions. Examples of Regular Expressions. Regular Expressions (crash course) Computational Linguistics 1

Agenda. Agenda. Regular Expressions. Examples of Regular Expressions. Regular Expressions (crash course) Computational Linguistics 1 Agend CMSC/LING 723, LBSC 744 Kristy Hollingshed Seitz Institute for Advnced Computer Studies University of Mrylnd HW0 questions? Due Thursdy before clss! When in doubt, keep it simple... Lecture 2: 6

More information

The Regulated and Riemann Integrals

The Regulated and Riemann Integrals Chpter 1 The Regulted nd Riemnn Integrls 1.1 Introduction We will consider severl different pproches to defining the definite integrl f(x) dx of function f(x). These definitions will ll ssign the sme vlue

More information

Matrix Solution to Linear Equations and Markov Chains

Matrix Solution to Linear Equations and Markov Chains Trding Systems nd Methods, Fifth Edition By Perry J. Kufmn Copyright 2005, 2013 by Perry J. Kufmn APPENDIX 2 Mtrix Solution to Liner Equtions nd Mrkov Chins DIRECT SOLUTION AND CONVERGENCE METHOD Before

More information

Alignment of Long Sequences. BMI/CS Spring 2016 Anthony Gitter

Alignment of Long Sequences. BMI/CS Spring 2016 Anthony Gitter Alignment of Long Sequences BMI/CS 776 www.biostt.wisc.edu/bmi776/ Spring 2016 Anthony Gitter gitter@biostt.wisc.edu Gols for Lecture Key concepts how lrge-scle lignment differs from the simple cse the

More information

Chapter 14. Matrix Representations of Linear Transformations

Chapter 14. Matrix Representations of Linear Transformations Chpter 4 Mtrix Representtions of Liner Trnsformtions When considering the Het Stte Evolution, we found tht we could describe this process using multipliction by mtrix. This ws nice becuse computers cn

More information

Linear Systems with Constant Coefficients

Linear Systems with Constant Coefficients Liner Systems with Constnt Coefficients 4-3-05 Here is system of n differentil equtions in n unknowns: x x + + n x n, x x + + n x n, x n n x + + nn x n This is constnt coefficient liner homogeneous system

More information

Is there an easy way to find examples of such triples? Why yes! Just look at an ordinary multiplication table to find them!

Is there an easy way to find examples of such triples? Why yes! Just look at an ordinary multiplication table to find them! PUSHING PYTHAGORAS 009 Jmes Tnton A triple of integers ( bc,, ) is clled Pythgoren triple if exmple, some clssic triples re ( 3,4,5 ), ( 5,1,13 ), ( ) fond of ( 0,1,9 ) nd ( 119,10,169 ). + b = c. For

More information

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science CSCI 340: Computtionl Models Kleene s Theorem Chpter 7 Deprtment of Computer Science Unifiction In 1954, Kleene presented (nd proved) theorem which (in our version) sttes tht if lnguge cn e defined y ny

More information

1 From NFA to regular expression

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

More information

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

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

More information

Lexical Analysis Part III

Lexical Analysis Part III Lexicl Anlysis Prt III Chpter 3: Finite Automt Slides dpted from : Roert vn Engelen, Florid Stte University Alex Aiken, Stnford University Design of Lexicl Anlyzer Genertor Trnslte regulr expressions to

More information

Minimal DFA. minimal DFA for L starting from any other

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

More information

Strong Bisimulation. Overview. References. Actions Labeled transition system Transition semantics Simulation Bisimulation

Strong Bisimulation. Overview. References. Actions Labeled transition system Transition semantics Simulation Bisimulation Strong Bisimultion Overview Actions Lbeled trnsition system Trnsition semntics Simultion Bisimultion References Robin Milner, Communiction nd Concurrency Robin Milner, Communicting nd Mobil Systems 32

More information

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives Block #6: Properties of Integrls, Indefinite Integrls Gols: Definition of the Definite Integrl Integrl Clcultions using Antiderivtives Properties of Integrls The Indefinite Integrl 1 Riemnn Sums - 1 Riemnn

More information

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1 Chpter Five: Nondeterministic Finite Automt Forml Lnguge, chpter 5, slide 1 1 A DFA hs exctly one trnsition from every stte on every symol in the lphet. By relxing this requirement we get relted ut more

More information

Review of basic calculus

Review of basic calculus Review of bsic clculus This brief review reclls some of the most importnt concepts, definitions, nd theorems from bsic clculus. It is not intended to tech bsic clculus from scrtch. If ny of the items below

More information

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton 25. Finite Automt AUTOMATA AND LANGUAGES A system of computtion tht only hs finite numer of possile sttes cn e modeled using finite utomton A finite utomton is often illustrted s stte digrm d d d. d q

More information

CS 330 Formal Methods and Models

CS 330 Formal Methods and Models CS 330 Forml Methods nd Models Dn Richrds, section 003, George Mson University, Fll 2017 Quiz Solutions Quiz 1, Propositionl Logic Dte: Septemer 7 1. Prove (p q) (p q), () (5pts) using truth tles. p q

More information

A recursive construction of efficiently decodable list-disjunct matrices

A recursive construction of efficiently decodable list-disjunct matrices CSE 709: Compressed Sensing nd Group Testing. Prt I Lecturers: Hung Q. Ngo nd Atri Rudr SUNY t Bufflo, Fll 2011 Lst updte: October 13, 2011 A recursive construction of efficiently decodble list-disjunct

More information

Improper Integrals, and Differential Equations

Improper Integrals, and Differential Equations Improper Integrls, nd Differentil Equtions October 22, 204 5.3 Improper Integrls Previously, we discussed how integrls correspond to res. More specificlly, we sid tht for function f(x), the region creted

More information

We will see what is meant by standard form very shortly

We will see what is meant by standard form very shortly THEOREM: For fesible liner progrm in its stndrd form, the optimum vlue of the objective over its nonempty fesible region is () either unbounded or (b) is chievble t lest t one extreme point of the fesible

More information

Finite Automata-cont d

Finite Automata-cont d Automt Theory nd Forml Lnguges Professor Leslie Lnder Lecture # 6 Finite Automt-cont d The Pumping Lemm WEB SITE: http://ingwe.inghmton.edu/ ~lnder/cs573.html Septemer 18, 2000 Exmple 1 Consider L = {ww

More information

Equations and Inequalities

Equations and Inequalities Equtions nd Inequlities Equtions nd Inequlities Curriculum Redy ACMNA: 4, 5, 6, 7, 40 www.mthletics.com Equtions EQUATIONS & Inequlities & INEQUALITIES Sometimes just writing vribles or pronumerls in

More information

CS 188 Introduction to Artificial Intelligence Fall 2018 Note 7

CS 188 Introduction to Artificial Intelligence Fall 2018 Note 7 CS 188 Introduction to Artificil Intelligence Fll 2018 Note 7 These lecture notes re hevily bsed on notes originlly written by Nikhil Shrm. Decision Networks In the third note, we lerned bout gme trees

More information

The graphs of Rational Functions

The graphs of Rational Functions Lecture 4 5A: The its of Rtionl Functions s x nd s x + The grphs of Rtionl Functions The grphs of rtionl functions hve severl differences compred to power functions. One of the differences is the behvior

More information