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

Size: px
Start display at page:

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

Transcription

1 Informtics 2: Lecture 20 Shy Cohen 31 October / 32

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

3 1 Problems with Prsing s Serch Grmmr Restructuring Problems with Prsing s Serch 2 The CYK lgorithm Prsing s Dynmic Progrmming The CYK lgorithm Properties of the lgorithm 3 / 32

4 1 Problems with Prsing s Serch Grmmr Restructuring Problems with Prsing s Serch 2 The CYK lgorithm Prsing s Dynmic Progrmming The CYK lgorithm Properties of the lgorithm 4 / 32

5 5 / 32

6 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. 6 / 32

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

8 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 8 / 32

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

10 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. 9 / 32

11 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! 9 / 32

12 How mny prses re there? 10 / 32

13 How mny prses re there? 10 / 32

14 How mny prses re there? 10 / 32

15 How mny prses re there? 10 / 32

16 How mny prses re there? 10 / 32

17 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 11 / 32

18 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) / 32

19 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. 12 / 32

20 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 13 / 32

21 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! 14 / 32

22 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. 15 / 32

23 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 16 / 32

24 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 17 / 32

25 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 18 / 32

26 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 18 / 32

27 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 18 / 32

28 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 18 / 32

29 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 18 / 32

30 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 18 / 32

31 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 18 / 32

32 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 18 / 32

33 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 18 / 32

34 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 18 / 32

35 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 18 / 32

36 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 18 / 32

37 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 18 / 32

38 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 18 / 32

39 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]} 19 / 32

40 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]. 20 / 32

41 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 21 / 32

42 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. 22 / 32

43 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. 23 / 32

44 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 book flight money Let s prse Book the flight through Houston! 24 / 32

45 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 book flight money Let s prse Book the flight through Houston! 24 / 32

46 Second exmple Book the flight through Houston S, VP, Verb, Nominl, [0, 1] 25 / 32

47 Second exmple Book the flight through Houston S, VP, Verb, Nominl, [0, 1] Det [1, 2] 25 / 32

48 Second exmple Book the flight through Houston S, VP, Verb, Nominl, [0, 1] Det [1, 2] Nominl, [2, 3] 25 / 32

49 Second exmple Book the flight through Houston S, VP, Verb, Nominl, [0, 1] Det [1, 2] Nominl, [2, 3] Prep [3, 4] 25 / 32

50 Second exmple Book the flight through Houston S, VP, Verb, Nominl, [0, 1] Det [1, 2] Nominl, [2, 3] Prep [3, 4] NP, Proper- [4, 5] 25 / 32

51 Second exmple Book the flight through Houston S, VP, Verb, Nominl, [0, 1] [0, 2] Det [1, 2] Nominl, [2, 3] Prep [3, 4] NP, Proper- [4, 5] 25 / 32

52 Second exmple Book the flight through Houston S, VP, Verb, Nominl, [0, 1] [0, 2] Det NP [1, 2] [1, 3] Nominl, [2, 3] Prep [3, 4] NP, Proper- [4, 5] 25 / 32

53 Second exmple Book the flight through Houston S, VP, Verb, Nominl, S, VP, X2 [0, 1] [0, 2] [0, 3] Det NP [1, 2] [1, 3] Nominl, [2, 3] Prep [3, 4] NP, Proper- [4, 5] 25 / 32

54 Second exmple Book the flight through Houston S, VP, Verb, Nominl, S, VP, X2 [0, 1] [0, 2] [0, 3] Det NP [1, 2] [1, 3] Nominl, [2, 3] [2, 4] Prep [3, 4] NP, Proper- [4, 5] 25 / 32

55 Second exmple Book the flight through Houston S, VP, Verb, Nominl, S, VP, X2 [0, 1] [0, 2] [0, 3] Det NP [1, 2] [1, 3] [1, 4] Nominl, [2, 3] [2, 4] Prep [3, 4] NP, Proper- [4, 5] 25 / 32

56 Second exmple Book the flight through Houston S, VP, Verb, Nominl, S, VP, X2 [0, 1] [0, 2] [0, 3] [0, 4] Det NP [1, 2] [1, 3] [1, 4] Nominl, [2, 3] [2, 4] Prep [3, 4] NP, Proper- [4, 5] 25 / 32

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

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

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

60 Second exmple Book the flight through Houston S, VP, Verb, Nominl, 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 [2, 3] [2, 4] [2, 5] Prep PP [3, 4] [3, 5] NP, Proper- [4, 5] 25 / 32

61 Visulizing the Chrt 26 / 32

62 Visulizing the Chrt 27 / 32

63 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! 28 / 32

64 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. 29 / 32

65 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. 30 / 32

66 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. 31 / 32

67 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 32 / 32

Chart Parsing: the CYK Algorithm

Chart Parsing: the CYK Algorithm Chrt Prsing: the CYK lgorithm Informtics 2: Lecture 20 Shy Cohen 2 November 2018 1 / 43 Lst Clss Constituents nd Phrses: phrse inherits the ctegory of its hed. mbiguity: sentence cn hve multiple prse trees

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

CSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes

CSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes CSE 260-002: Exm 3-ANSWERS, Spring 20 ime: 50 minutes Nme: his exm hs 4 pges nd 0 prolems totling 00 points. his exm is closed ook nd closed notes.. Wrshll s lgorithm for trnsitive closure computtion is

More information

Introduction to Group Theory

Introduction to Group Theory Introduction to Group Theory Let G be n rbitrry set of elements, typiclly denoted s, b, c,, tht is, let G = {, b, c, }. A binry opertion in G is rule tht ssocites with ech ordered pir (,b) of elements

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

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

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

Recursively Enumerable and Recursive. Languages

Recursively Enumerable and Recursive. Languages Recursively Enumerble nd Recursive nguges 1 Recll Definition (clss 19.pdf) Definition 10.4, inz, 6 th, pge 279 et S be set of strings. An enumertion procedure for Turing Mchine tht genertes ll strings

More information

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata CS103B ndout 18 Winter 2007 Ferury 28, 2007 Finite Automt Initil text y Mggie Johnson. Introduction Severl childrens gmes fit the following description: Pieces re set up on plying ord; dice re thrown or

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

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

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014 CS125 Lecture 12 Fll 2014 12.1 Nondeterminism The ide of nondeterministic computtions is to llow our lgorithms to mke guesses, nd only require tht they ccept when the guesses re correct. For exmple, simple

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

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

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

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

More information

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

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

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

Module 9: Tries and String Matching

Module 9: Tries and String Matching Module 9: Tries nd String Mtching CS 240 - Dt Structures nd Dt Mngement Sjed Hque Veronik Irvine Tylor Smith Bsed on lecture notes by mny previous cs240 instructors Dvid R. Cheriton School of Computer

More information

Module 9: Tries and String Matching

Module 9: Tries and String Matching Module 9: Tries nd String Mtching CS 240 - Dt Structures nd Dt Mngement Sjed Hque Veronik Irvine Tylor Smith Bsed on lecture notes by mny previous cs240 instructors Dvid R. Cheriton School of Computer

More information

UNIT 1 FUNCTIONS AND THEIR INVERSES Lesson 1.4: Logarithmic Functions as Inverses Instruction

UNIT 1 FUNCTIONS AND THEIR INVERSES Lesson 1.4: Logarithmic Functions as Inverses Instruction Lesson : Logrithmic Functions s Inverses Prerequisite Skills This lesson requires the use of the following skills: determining the dependent nd independent vribles in n exponentil function bsed on dt from

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

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

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.) CS 373, Spring 29. Solutions to Mock midterm (sed on first midterm in CS 273, Fll 28.) Prolem : Short nswer (8 points) The nswers to these prolems should e short nd not complicted. () If n NF M ccepts

More information

Nondeterminism. Nondeterministic Finite Automata. Example: Moves on a Chessboard. Nondeterminism (2) Example: Chessboard (2) Formal NFA

Nondeterminism. Nondeterministic Finite Automata. Example: Moves on a Chessboard. Nondeterminism (2) Example: Chessboard (2) Formal NFA Nondeterminism Nondeterministic Finite Automt Nondeterminism Subset Construction A nondeterministic finite utomton hs the bility to be in severl sttes t once. Trnsitions from stte on n input symbol cn

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

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

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

SOLUTIONS FOR ADMISSIONS TEST IN MATHEMATICS, COMPUTER SCIENCE AND JOINT SCHOOLS WEDNESDAY 5 NOVEMBER 2014

SOLUTIONS FOR ADMISSIONS TEST IN MATHEMATICS, COMPUTER SCIENCE AND JOINT SCHOOLS WEDNESDAY 5 NOVEMBER 2014 SOLUTIONS FOR ADMISSIONS TEST IN MATHEMATICS, COMPUTER SCIENCE AND JOINT SCHOOLS WEDNESDAY 5 NOVEMBER 014 Mrk Scheme: Ech prt of Question 1 is worth four mrks which re wrded solely for the correct nswer.

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

CSCI FOUNDATIONS OF COMPUTER SCIENCE

CSCI FOUNDATIONS OF COMPUTER SCIENCE 1 CSCI- 2200 FOUNDATIONS OF COMPUTER SCIENCE Spring 2015 My 7, 2015 2 Announcements Homework 9 is due now. Some finl exm review problems will be posted on the web site tody. These re prcqce problems not

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

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

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

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

Scanner. Specifying patterns. Specifying patterns. Operations on languages. A scanner must recognize the units of syntax Some parts are easy:

Scanner. Specifying patterns. Specifying patterns. Operations on languages. A scanner must recognize the units of syntax Some parts are easy: Scnner Specifying ptterns source code tokens scnner prser IR A scnner must recognize the units of syntx Some prts re esy: errors mps chrcters into tokens the sic unit of syntx x = x + y; ecomes

More information

USA Mathematical Talent Search Round 1 Solutions Year 21 Academic Year

USA Mathematical Talent Search Round 1 Solutions Year 21 Academic Year 1/1/21. Fill in the circles in the picture t right with the digits 1-8, one digit in ech circle with no digit repeted, so tht no two circles tht re connected by line segment contin consecutive digits.

More information

Math 4310 Solutions to homework 1 Due 9/1/16

Math 4310 Solutions to homework 1 Due 9/1/16 Mth 4310 Solutions to homework 1 Due 9/1/16 1. Use the Eucliden lgorithm to find the following gretest common divisors. () gcd(252, 180) = 36 (b) gcd(513, 187) = 1 (c) gcd(7684, 4148) = 68 252 = 180 1

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

Regular expressions, Finite Automata, transition graphs are all the same!!

Regular expressions, Finite Automata, transition graphs are all the same!! CSI 3104 /Winter 2011: Introduction to Forml Lnguges Chpter 7: Kleene s Theorem Chpter 7: Kleene s Theorem Regulr expressions, Finite Automt, trnsition grphs re ll the sme!! Dr. Neji Zgui CSI3104-W11 1

More information