The Minimization Problem. The Minimization Problem. The Minimization Problem. The Minimization Problem. The Minimization Problem

Size: px
Start display at page:

Download "The Minimization Problem. The Minimization Problem. The Minimization Problem. The Minimization Problem. The Minimization Problem"

Transcription

1 Simpler & More Generl Minimiztion for Weighted Finite-Stte Automt Json Eisner Johns Hopkins University My 28, 2003 HLT-NAACL First hlf of tlk is setup - revies pst ork. Second hlf gives outline of the ne results. The Minimiztion Prolem Input: A DFA (deterministic finite-stte utomton) Output: An equiv. DFA ith s fe sttes s possile Compleity: O( rcs log sttes ) (Hopcroft 1971) Represents the lnguge {,,, } The Minimiztion Prolem The Minimiztion Prolem Input: A DFA (deterministic finite-stte utomton) Output: An equiv. DFA ith s fe sttes s possile Compleity: O( rcs log sttes ) (Hopcroft 1971) Input: A DFA (deterministic finite-stte utomton) Output: An equiv. DFA ith s fe sttes s possile Compleity: O( rcs log sttes ) (Hopcroft 1971) Represents the lnguge {,,, } Represents the lnguge {,,, } The Minimiztion Prolem The Minimiztion Prolem Input: A DFA (deterministic finite-stte utomton) Output: An equiv. DFA ith s fe sttes s possile Compleity: O( rcs log sttes ) (Hopcroft 1971) Input: A DFA (deterministic finite-stte utomton) Output: An equiv. DFA ith s fe sttes s possile Compleity: O( rcs log sttes ) (Hopcroft 1971) Represents the lnguge {,,, } Represents the lnguge {,,, } 1

2 The Minimiztion Prolem The Minimiztion Prolem Input: A DFA (deterministic finite-stte utomton) Output: An equiv. DFA ith s fe sttes s possile Compleity: O( rcs log sttes ) (Hopcroft 1971) Input: A DFA (deterministic finite-stte utomton) Output: An equiv. DFA ith s fe sttes s possile Compleity: O( rcs log sttes ) (Hopcroft 1971) Here s ht you should orry out: Cn t lys ork ckrd from finl stte like this. A it more complicted ecuse of cycles. Don t orry out it for this tlk. Mergele ecuse they hve the sme suffi lnguge: {,} Mergele ecuse they hve the sme suffi lnguge: {} An equivlence reltion on sttes merge the equivlence clsses The Minimiztion Prolem Input: A DFA (deterministic finite-stte utomton) Output: An equiv. DFA ith s fe sttes s possile Compleity: O( rcs log sttes ) (Hopcroft 1971) Q: Why minimize # sttes, rther thn # rcs? A: Minimizing # sttes lso minimizes # rcs! Q: Wht if the input is n NDFA (nondeterministic)? A: Determinize it first. (could yield eponentil loup ) Q: Ho out minimizing n NDFA to n NDFA? A: Yes, could e eponentilly smller, ut prolem is PSPACE-complete so e don t try. Rel-World NLP: Automt With Weights or Outputs Finite-stte computtion of functions Conctente strings : : z Add scores :3 :2 d:0 7 Multiply proilities :0.3 :0.2 d:1 0.7 d cd z d 5 cd 9 d 0.06 cd 0.14 Rel-World NLP: Automt With Weights or Outputs Wnt to compute functions on strings: Σ* K After ll, e re doing lnguge nd speech! Finite-stte mchines cn often do the jo Esy to uild, esy to comine, run fst Build them ith eighted regulr epressions To clen up the resulting DFA, minimize it to merge redundnt portions This smller mchine is fster to intersect/compose More likely to fit on hnd-held device More likely to fit into cche memory Rel-World NLP: Automt With Weights or Outputs Wnt to compute functions on strings: Σ* K After ll, e re doing lnguge nd speech! Finite-stte mchines cn often do the jo Ho do e minimize such DFAs? Didn t Mohri lredy nser this question? Only for specil cses of the output set K! Is there generl recipe? Wht ne lgorithms cn e cook ith it? 2

3 Weight Algers Finite-stte computtion of fu Specify eight lger (K, ) Conctente strings Define DFAs over (K, ) : Arcs hve eights in set K : A pth s eight is lso in K: multiply its rc eights ith z Emples: Add scores (strings, conctention) :3 :2 d:0 (scores, ddition) (proilities, multipliction) 7 (score vectors, ddition) OT phonology (rel eights, multipliction) conditionl Multiply rndom proilities fields, rtionl kernels (ojective func & grdient, trining the prmeters of :0.3 model product-rule multipliction) :0.2 d:1 (it vectors, conjunction) memership in multiple lnguges t once 0.7 Weight Algers Specify eight lger (K, ) Define DFAs over (K, ) Arcs hve eights in set K A pth s eight is lso in K: multiply its rc eights ith Q: Semiring is (K,, ). Why ren t you tlking out too? A: Minimiztion is out DFAs. At most one pth per input. So no need to the eights of multiple ccepting pths. Finite-stte computtion of fu Conctente strings : : z Add scores :3 :2 d:0 7 Multiply proilities :0.3 :0.2 d:1 0.7 Shifting Outputs Along Pths Doesn t chnge the function computed: Shifting Outputs Along Pths Doesn t chnge the function computed: : : z d cd z : : z d cd z Shifting Outputs Along Pths Doesn t chnge the function computed: Shifting Outputs Along Pths Doesn t chnge the function computed: : : z d cd z :ε : z d cd z 3

4 Shifting Outputs Along Pths Doesn t chnge the function computed: Shifting Outputs Along Pths Doesn t chnge the function computed: : : z d cd z :3 :2 d:0 7 d 5 cd 9 Shifting Outputs Along Pths Doesn t chnge the function computed: Shifting Outputs Along Pths Doesn t chnge the function computed: 2 3 :2+1 :3-1 d: d 5 cd :2+2 :3-2 d: d 5 cd 9 Shifting Outputs Along Pths Shifting Outputs Along Pths Doesn t chnge the function computed: 0 5 :2+3 :3-3 d: d 5 cd 9 : : z d cd z ed u ecd uz 4

5 Shifting Outputs Along Pths Shifting Outputs Along Pths Stte sucks ck prefi from its out-rcs : : z d cd z ed u ecd uz Stte sucks ck prefi from its out-rcs nd deposits it t end of its in-rcs. : : z d cd z ed u ecd uz Shifting Outputs Along Pths Shifting Outputs Along Pths : : z d cd z ed u ecd uz : : : z d cd z ed u ecd uz n d u() n n cd u() n z Shifting Outputs Along Pths Shifting Outputs Along Pths : : : z d cd z ed u ecd uz : : : z d cd z ed u ecd uz n d u() n n cd u() n z n d u() n n cd u() n z n d u() n n cd u() n z 5

6 Shifting Outputs Along Pths Shifting Outputs Along Pths : : : z d cd z ed u ecd uz : : : z d cd z ed u ecd uz n d u() n n cd u() n z n d u() n n cd u() n z n d u() n n cd u() n z n d u() n n cd u() n z Shifting Outputs Along Pths (Mohri) Shifting Outputs Along Pths (Mohri) Here, not ll the out-rcs strt ith But ll the out-pths strt ith Do pushck t lter sttes first: : : ε :z ε: ε d: Here, not ll the out-rcs strt ith But ll the out-pths strt ith Do pushck t lter sttes first: no e re ok! : : : z ε: ε Shifting Outputs Along Pths (Mohri) Shifting Outputs Along Pths (Mohri) Here, not ll the out-rcs strt ith But ll the out-pths strt ith Do pushck t lter sttes first: no e re ok! : : ε : z ε: ε Here, not ll the out-rcs strt ith But ll the out-pths strt ith Do pushck t lter sttes first: no e re ok! : : ε : z ε: ε 6

7 Shifting Outputs Along Pths (Mohri) Actully, push ck t ll sttes t once Shifting Outputs Along Pths (Mohri) Actully, push ck t ll sttes t once At every stte q, compute some λ(q) : : ε ε: ε d: : : ε ε ε: ε d: :z :z Shifting Outputs Along Pths (Mohri) Shifting Outputs Along Pths (Mohri) Actully, push ck t ll sttes t once Add λ(q) to end of q s in-rcs : : ε ε ε : z ε: ε d: Actully, push ck t ll sttes t once Add λ(q) to end of q s in-rcs Remove λ(q) from strt of q s out-rcs : : ε ε :z ε ε: ε d: Shifting Outputs Along Pths (Mohri) Actully, push ck t ll sttes t once Add λ(q) to end of q s in-rcs Remove λ(q) from strt of q s out-rcs q :k r : : ecomes ε : z q ε: ε : λ(q) -1 k λ(r) r Mergele ecuse they ccept the sme suffi lnguge: {,} 7

8 Still ccept sme suffi lnguge, ut produce different outputs on it : :ε :y :zz :y :zzz :z :ε Still ccept sme suffi lnguge, ut produce different outputs on it : :ε Not mergele - compute different suffi functions: yz or y cd zzz or zzz :y :zz :y :zzz :z :ε Fi y shifting outputs leftrd Fi y shifting outputs leftrd : :ε :y :zz :y : zzz :z :ε : :ε :y :zz : : y zzz :z :ε Fi y shifting outputs leftrd If e do this t ll sttes s efore : :y :zz :z : :y :zz y :z : No mergele - they hve the sme suffi function: yz cd zzz : : y zzz But still no esy y to detect mergeility. :ε : No mergele - they hve the sme suffi function: yz cd zzz : : zzz :ε 8

9 If e do this t ll sttes s efore If e do this t ll sttes s efore : : No mergele - they hve the sme suffi function: yz cd zzz :y :zz : : y zzz z :ε :ε : : No mergele - they hve the sme suffi function: yz cd zzz :yz :zzz : : yz zzz :ε :ε No these hve the sme sufffi function too: ε No e cn discover & perform the merges: Tret ech lel :yz s single tomic symol : : No mergele - they hve the sme suffi function: yz cd zzz :yz :zzz : : yz zzz no these hve sme rc lels :ε :ε so do these ecuse e rrnged for cnonicl plcement of outputs long pths : : No mergele - they hve the sme suffi function: yz cd zzz :yz :zzz : : yz zzz no these hve sme rc lels :ε :ε so do these ecuse e rrnged for cnonicl plcement of outputs long pths Tret ech lel :yz s single tomic symol Tret ech lel :yz s single tomic symol : : No mergele - they hve the sme suffi function: yz cd zzz :yz :zzz : : yz zzz no these hve sme rc lels :ε :ε so do these ecuse e rrnged for cnonicl plcement of outputs long pths : : No mergele - they hve the sme suffi function: yz cd zzz :yz :zzz :yz :zzz no these hve sme rc lels :ε :ε so do these ecuse e rrnged for cnonicl plcement of outputs long pths 9

10 Tret ech lel :yz s single tomic symol Use uneighted minimiztion lgorithm! : : No mergele - they hve the sme suffi function: yz cd zzz :yz :zzz :yz :zzz :ε :ε Tret ech lel :yz s single tomic symol Use uneighted minimiztion lgorithm! : : No mergele - they hve the sme suffi lnguge: {:yz :ε, :zzz :ε} :yz :zzz :yz :zzz :ε :ε Tret ech lel :yz s single tomic symol Use uneighted minimiztion lgorithm! : : :yz :zzz :yz :zzz :ε :ε Summry of eighted minimiztion lgorithm: 1. Compute λ(q) t ech stte q 2. Push ech λ(q) ck through stte q; this chnges rc eights 3. Merge sttes vi uneighted minimiztion Step 3 merges sttes Step 2 llos more sttes to merge t step 3 Step 1 controls ht step 2 does preferly, to give sttes the sme suffi function henever possile So define λ(q) crefully t step 1! Mohri s Algorithms (1997, 2000) Mohri treted to versions of (K, ) (K, ) = (strings, conctention) λ(q) = longest common prefi of ll pths from q Rther tricky to find : λ = : ε :z ε:ε d: Mohri s Algorithms (1997, 2000) Mohri treted to versions of (K, ) (K, ) = (strings, conctention) λ(q) = longest common prefi of ll pths from q Rther tricky to find (K, ) = (nonnegtive rels, ddition) λ(q) = minimum eight of ny pth from q Find it y Dijkstr s shortest-pth lgorithm λ = 8 :2 :7 d:2 2 d:2 e:3 :13 ε:2 d:99 10

11 Mohri s Algorithms (1997, 2000) Mohri treted to versions of (K, ) (K, ) = (strings, conctention) λ(q) = longest common prefi of ll pths from q Rther tricky to find (K, ) = (nonnegtive rels, ddition) λ(q) = minimum eight of ny pth from q Find it y Dijkstr s shortest-pth lgorithm λ = 8 :1 :2 d:0 8 0 d:0 e:3 ε:0 :13 d:95 Mohri s Algorithms (1997, 2000) Mohri treted to versions of (K, ) (K, ) = (strings, conctention) λ(q) = longest common prefi of ll pths from q Rther tricky to find (K, ) = (nonnegtive rels, ddition) λ(q) = minimum eight of ny pth from q Find it y Dijkstr s shortest-pth lgorithm λ = 8 :10 :1 d:0 0 d:0 e:11 :13 ε:0 d:95 Mohri s Algorithms (1997, 2000) Mohri treted to versions of (K, ) (K, ) = (strings, conctention) λ(q) = longest common prefi of ll pths from q Rther tricky to find (K, ) = (nonnegtive rels, ddition) λ(q) = minimum eight of ny pth from q Find it y Dijkstr s shortest-pth lgorithm In oth cses: λ(q) = sum over infinite set of pth eights must define this sum nd n lgorithm to compute it doesn t generlize utomticlly to other (K, )... Mohri s Algorithms (1997, 2000) (rel eights, multipliction)? (score vectors, ddition)? (ojective func & grdient, product-rule multipliction)? e.g., ht if e lloed negtive rels? Then minimum might not eist! 2 (K, ) = (nonnegtive rels, ddition) λ(q) = minimum eight of ny pth from q -3 Find it y Dijkstr s lgorithm In oth cses: λ(q) = sum over infinite set of pth eights must define this sum nd n lgorithm to compute it doesn t generlize utomticlly to other (K, )... Generlizing the Strtegy End of ckground mteril. No e cn sketch the ne results! Wnt to minimize DFAs in ny (K, ) Given (K, ) Just need definition of λ... then use generl lg. λ should etrct n pproprite left fctor from stte q s suffi function F q : Σ* K Rememer, F q is the function tht the utomton ould compute if stte q ere the strt stte Wht properties must λ hve to gurntee tht e get the minimum equivlent mchine? 11

12 Generlizing the Strtegy Wht properties must the λ function hve? For ll F: Σ* K, k K, Σ: Shifting: λ(k F) = k λ(f) Quotient: λ(f) is left fctor of λ( -1 F) Finl-quotient: λ(f) is left fctor of F(ε) Then pushing + merging is gurnteed to minimize the mchine. Generlizing the Strtegy Wht properties must the λ function hve? For ll F: Σ* K, k K, Σ: Shifting: λ(k F) = k λ(f) Suffi functions cn e ritten s F nd yy F: :z :yyz :z :yyz Shifting property sys: When e remove the prefies λ( F) nd λ(yy F) e ill remove nd yy respectively Generlizing the Strtegy Wht properties must the λ function hve? For ll F: Σ* K, k K, Σ: Shifting: λ(k F) = k λ(f) Suffi functions cn e ritten s F nd yy F: : z : z yy : z : z Shifting property sys: When e remove the prefies λ( F) nd λ(yy F) e ill remove nd yy respectively leving ehind common residue. Actully, remove λ(f) nd yy λ(f). Generlizing the Strtegy Wht properties must the λ function hve? For ll F: Σ* K, k K, Σ: Shifting: λ(k F) = k λ(f) Suffi functions cn e ritten s F nd yy F: : : z yyz : : Shifting property sys: When e remove the prefies λ( F) nd λ(yy F) e ill remove nd yy respectively leving ehind common residue. Actully, remove λ(f) nd yy λ(f). Generlizing the Strtegy Wht properties must the λ function hve? For ll F: Σ* K, k K, Σ: Shifting: λ(k F) = k λ(f) Quotient: λ(f) is left fctor of λ( -1 F) q :k r ecomes q : λ(f q ) -1 k λ(f r ) = λ(f q ) -1 λ(k F r ) = λ(f q ) -1 λ( -1 F q ) Quotient property sys tht this quotient eists even if λ(f q ) doesn t hve multiplictive inverse. r Generlizing the Strtegy Wht properties must the λ function hve? For ll F: Σ* K, k K, Σ: Shifting: λ(k F) = k λ(f) Quotient: λ(f) is left fctor of λ( -1 F) Finl-quotient: λ(f) is left fctor of F(ε) Gurntees e cn find finl-stte stopping eights. If e didn t hve this se cse, e couldn t prove: λ(f) is left fctor of every output in rnge(f). Then pushing + merging is gurnteed to minimize. 12

13 A Ne Specific Algorithm Mohri s lgorithms instntite this strtegy. They use prticulr definitions of λ. λ(q) = longest common string prefi of ll pths from q λ(q) = minimum numeric eight of ll pths from q interpreted s infinite sums over pth eights; ignore input symols dividing y λ mkes suffi func cnonicl: pth eights sum to 1 No for ne definition of λ! λ(q) = eight of the shortest pth from q, reking ties leicogrphiclly y input string choose just one pth, sed only on its input symols; computtion is simple, ell-defined, independent of (K, ) dividing y λ mkes suffi func cnonicl: shortest pth hs eight 1 A Ne Specific Algorithm Ne definition of λ : λ(q) = eight of the shortest pth from q, reking ties leicogrphiclly y input string Computtion is simple, ell-defined, independent of (K, ) Bredth-first serch ck from finl sttes: c c d finl sttes A Ne Specific Algorithm Ne definition of λ : λ(q) = eight of the shortest pth from q, reking ties leicogrphiclly y input string Computtion is simple, ell-defined, independent of (K, ) Bredth-first serch ck from finl sttes: A Ne Specific Algorithm Ne definition of λ : λ(q) = eight of the shortest pth from q, reking ties lpheticlly on input symols Computtion is simple, ell-defined, independent of (K, ) Bredth-first serch ck from finl sttes: c distnce 1 c d c distnce 2 q :k r c d λ(q) = k λ(r) Compute λ(q) in O(1) time s soon s e visit q. Whole lg. is liner. Fster thn finding min-eight pth àl Mohri. Requires Multiplictive Inverses Requires Multiplictive Inverses Does this definition of λ hve the necessry properties? λ(q) = eight of the shortest pth from q, reking ties lpheticlly on input symols If e regrd λ s pplying to suffi functions: λ(f) = F(min domin(f)) ith pproprite defn of min Shifting: λ(k F) = k λ(f) Trivilly true Quotient:λ(F) is left fctor of λ( -1 F) Finl-quotient: λ(f) is left fctor of F(ε) These re true provided tht (K, ) contins multiplictive inverses. i.e., oky if (K, ) is semigroup; (K,, ) is division semiring. So (K, ) must contin multiplictive inverses (under ). Consider (K, ) = (nonnegtive rels, ddition): :1 λ = 5 :5 2 13

14 Requires Multiplictive Inverses Requires Multiplictive Inverses So (K, ) must contin multiplictive inverses (under ). Consider (K, ) = (nonnegtive rels, ddition): So (K, ) must contin multiplictive inverses (under ). Consider (K, ) = (nonnegtive rels, ddition): :1 λ = 5 5 :0-3 :6 λ = 5 :0-3 Oops! -3 isn t legl eight. Need to sy (K, ) = (rels, ddition). Then sutrction lys gives n nser. Unlike Mohri, e might get negtive eights in the output DFA... But unlike Mohri, e cn hndle negtive eights in the input DFA (including negtive eight cycles!). Requires Multiplictive Inverses Requires Multiplictive Inverses Ho out trnsducers? (K, ) = (strings, conctention) Must dd multiplictive inverses, vi inverse letters. Ho out trnsducers? (K, ) = (strings, conctention) Must dd multiplictive inverses, vi inverse letters. : λ = y :y z y c z :ε : y y -1 z λ = y y c z Requires Multiplictive Inverses Rel Benefit Other Semirings! Ho out trnsducers? (K, ) = (strings, conctention) Must dd multiplictive inverses, vi inverse letters. :ε :y y y -1 z c z λ = y Cn ctully mke this ork, though no longer O(1) Still rguly simpler thn Mohri But this time e re it sloer in orst cse, not fster s efore Cn eliminte inverse letters fter e minimize Other (K, ) of current interest do hve mult inverses... So e no hve n esy minimiztion lgorithm for them. No lgorithm eisted efore. conditionl rndom fields, rtionl kernels (rel eights, multipliction)? (Lfferty/McCllum/Pereir; Cortes/Hffner/Mohri) (score vectors, ddition)? OT phonology (Ellison) (ojective func & grdient, trining the prmeters of model product-rule multipliction)? (Eisner epecttion semirings) 14

15 Bck to the Generl Strtegy Wht properties must the λ function hve? For ll F: Σ* K, k K, Σ: Shifting: λ(k F) = k λ(f) Quotient: λ(f) is left fctor of λ( -1 F) Finl-quotient: λ(f) is left fctor of F(ε) Ne lgorithm nd Mohri s lgs re specil cses Minimiztion Not Unique In previously studied cses, ll minimum-stte mchines equivlent to given DFA ere essentilly the sme. But the pper gives severl (K, ) here this is not true!? Wht if e don t hve mult. inverses? Does this strtegy ork in every (K, )? Does n pproprite λ lys eist? No! No strtegy lys orks. Minimiztion isn t lys ell-defined! Minimiztion Not Unique In previously studied cses, ll minimum-stte mchines equivlent to given DFA ere essentilly the sme. But the pper gives severl (K, ) here this is not true! Minimiztion Not Unique In previously studied cses, ll minimum-stte mchines equivlent to given DFA ere essentilly the sme. But the pper gives severl (K, ) here this is not true!? Mergeility my not e n equivlence reltion on sttes. Hving common residue my not e n equivlence reltion on suffi functions. Hs to do ith the uniqueness of prime fctoriztion in (K, ). (But hd to generlize notion so didn t ssume s commuttive.) Pper gives necessry nd sufficient conditions... Non-Unique Minimiztion Is Hrd Minimum-stte utomton isn t lys unique. But cn e find one tht hs min # of sttes? No: unfortuntely NP-complete. (reduction from Minimum Clique Prtition) Cn e get close to the minimum? No: Min Clique Prtition is inpproimle in polytime to ithin ny constnt fctor (unless P=NP). So e cn t even e sure of getting ithin fctor of 100 of the smllest possile. Summry of Results Some eight semirings re d : Don t let us minimize uniquely, efficiently, or pproimtely [ even in (it vectors, conjunction) ] Chrcteriztion of good eight semirings Generl minimiztion strtegy for good semirings Find λ... Mohri s lgorithms re specil cses Esy minimiztion lgorithm for division semirings For dditive eights, simpler & fster thn Mohri s Cn pply to trnsducers, ith inverse letters trick Applies in the other semirings of present interest fncy mchine lerning; prmeter trining; optimlity theory 15

16 FIN Ne definition of λ : λ(q) = eight of the shortest pth from q, reking ties lpheticlly on input symols Rnking of ccepting pths y input string: ε < < < < < geneologicl order on strings e pick the minimum string ccepted from stte q 16

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

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

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

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

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

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

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

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

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 CMSC 330 1 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All exmples so fr Nondeterministic

More information

Let's start with an example:

Let's start with an example: Finite Automt Let's strt with n exmple: Here you see leled circles tht re sttes, nd leled rrows tht re trnsitions. One of the sttes is mrked "strt". One of the sttes hs doule circle; this is terminl stte

More information

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1 Non-Deterministic Finite Automt Fll 2018 Costs Busch - RPI 1 Nondeterministic Finite Automton (NFA) Alphbet ={} q q2 1 q 0 q 3 Fll 2018 Costs Busch - RPI 2 Nondeterministic Finite Automton (NFA) Alphbet

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

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont.

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont. NFA DFA Exmple 3 CMSC 330: Orgniztion of Progrmming Lnguges NFA {B,D,E {A,E {C,D {E Finite Automt, con't. R = { {A,E, {B,D,E, {C,D, {E 2 Equivlence of DFAs nd NFAs Any string from {A to either {D or {CD

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

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

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2 CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt

More information

Lecture 08: Feb. 08, 2019

Lecture 08: Feb. 08, 2019 4CS4-6:Theory of Computtion(Closure on Reg. Lngs., regex to NDFA, DFA to regex) Prof. K.R. Chowdhry Lecture 08: Fe. 08, 2019 : Professor of CS Disclimer: These notes hve not een sujected to the usul scrutiny

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

Nondeterminism and Nodeterministic Automata

Nondeterminism and Nodeterministic Automata Nondeterminism nd Nodeterministic Automt 61 Nondeterminism nd Nondeterministic Automt The computtionl mchine models tht we lerned in the clss re deterministic in the sense tht the next move is uniquely

More information

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

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016 CS125 Lecture 12 Fll 2016 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

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 4 1. UsetheproceduredescriedinLemm1.55toconverttheregulrexpression(((00) (11)) 01) into n NFA. Answer: 0 0 1 1 00 0 0 11 1 1 01 0 1 (00)

More information

Chapter 2 Finite Automata

Chapter 2 Finite Automata Chpter 2 Finite Automt 28 2.1 Introduction Finite utomt: first model of the notion of effective procedure. (They lso hve mny other pplictions). The concept of finite utomton cn e derived y exmining wht

More information

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb. CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt

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

Lecture 3: Equivalence Relations

Lecture 3: Equivalence Relations Mthcmp Crsh Course Instructor: Pdric Brtlett Lecture 3: Equivlence Reltions Week 1 Mthcmp 2014 In our lst three tlks of this clss, we shift the focus of our tlks from proof techniques to proof concepts

More information

Designing finite automata II

Designing finite automata II Designing finite utomt II Prolem: Design DFA A such tht L(A) consists of ll strings of nd which re of length 3n, for n = 0, 1, 2, (1) Determine wht to rememer out the input string Assign stte to ech of

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

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

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018 CS 301 Lecture 04 Regulr Expressions Stephen Checkowy Jnury 29, 2018 1 / 35 Review from lst time NFA N = (Q, Σ, δ, q 0, F ) where δ Q Σ P (Q) mps stte nd n lphet symol (or ) to set of sttes We run n NFA

More information

8 factors of x. For our second example, let s raise a power to a power:

8 factors of x. For our second example, let s raise a power to a power: CH 5 THE FIVE LAWS OF EXPONENTS EXPONENTS WITH VARIABLES It s no time for chnge in tctics, in order to give us deeper understnding of eponents. For ech of the folloing five emples, e ill stretch nd squish,

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

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

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

Java II Finite Automata I

Java II Finite Automata I Jv II Finite Automt I Bernd Kiefer Bernd.Kiefer@dfki.de Deutsches Forschungszentrum für künstliche Intelligenz Finite Automt I p.1/13 Processing Regulr Expressions We lredy lerned out Jv s regulr expression

More information

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!)

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!) CMSC 330: Orgniztion of Progrmming Lnguges DFAs, nd NFAs, nd Regexps (Oh my!) CMSC330 Spring 2018 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All

More information

CHAPTER 1 Regular Languages. Contents

CHAPTER 1 Regular Languages. Contents Finite Automt (FA or DFA) CHAPTE 1 egulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, euivlence of NFAs nd DFAs, closure under regulr

More information

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38 Theory of Computtion Regulr Lnguges (NTU EE) Regulr Lnguges Fll 2017 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of Finite Automt A finite utomton hs finite set of control

More information

Non Deterministic Automata. Linz: Nondeterministic Finite Accepters, page 51

Non Deterministic Automata. Linz: Nondeterministic Finite Accepters, page 51 Non Deterministic Automt Linz: Nondeterministic Finite Accepters, pge 51 1 Nondeterministic Finite Accepter (NFA) Alphbet ={} q 1 q2 q 0 q 3 2 Nondeterministic Finite Accepter (NFA) Alphbet ={} Two choices

More information

State Minimization for DFAs

State Minimization for DFAs Stte Minimiztion for DFAs Red K & S 2.7 Do Homework 10. Consider: Stte Minimiztion 4 5 Is this miniml mchine? Step (1): Get rid of unrechle sttes. Stte Minimiztion 6, Stte is unrechle. Step (2): Get rid

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

Theory of Computation Regular Languages

Theory of Computation Regular Languages Theory of Computtion Regulr Lnguges Bow-Yw Wng Acdemi Sinic Spring 2012 Bow-Yw Wng (Acdemi Sinic) Regulr Lnguges Spring 2012 1 / 38 Schemtic of Finite Automt control 0 0 1 0 1 1 1 0 Figure: Schemtic of

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

CSCI 340: Computational Models. Transition Graphs. Department of Computer Science

CSCI 340: Computational Models. Transition Graphs. Department of Computer Science CSCI 340: Computtionl Models Trnsition Grphs Chpter 6 Deprtment of Computer Science Relxing Restrints on Inputs We cn uild n FA tht ccepts only the word! 5 sttes ecuse n FA cn only process one letter t

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

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

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

CSE396 Prelim I Answer Key Spring 2017

CSE396 Prelim I Answer Key Spring 2017 Nme nd St.ID#: CSE96 Prelim I Answer Key Spring 2017 (1) (24 pts.) Define A to e the lnguge of strings x {, } such tht x either egins with or ends with, ut not oth. Design DFA M such tht L(M) = A. A node-rc

More information

GNFA GNFA GNFA GNFA GNFA

GNFA GNFA GNFA GNFA GNFA DFA RE NFA DFA -NFA REX GNFA Definition GNFA A generlize noneterministic finite utomton (GNFA) is grph whose eges re lele y regulr expressions, with unique strt stte with in-egree, n unique finl stte with

More information

CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010

CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010 CS 311 Homework 3 due 16:30, Thursdy, 14 th Octoer 2010 Homework must e sumitted on pper, in clss. Question 1. [15 pts.; 5 pts. ech] Drw stte digrms for NFAs recognizing the following lnguges:. L = {w

More information

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-* Regulr Expressions (RE) Regulr Expressions (RE) Empty set F A RE denotes the empty set Opertion Nottion Lnguge UNIX Empty string A RE denotes the set {} Alterntion R +r L(r ) L(r ) r r Symol Alterntion

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

CS 330 Formal Methods and Models

CS 330 Formal Methods and Models CS 330 Forml Methods nd Models Dn Richrds, George Mson University, Spring 2017 Quiz Solutions Quiz 1, Propositionl Logic Dte: Ferury 2 1. Prove ((( p q) q) p) is tutology () (3pts) y truth tle. p q p q

More information

378 Relations Solutions for Chapter 16. Section 16.1 Exercises. 3. Let A = {0,1,2,3,4,5}. Write out the relation R that expresses on A.

378 Relations Solutions for Chapter 16. Section 16.1 Exercises. 3. Let A = {0,1,2,3,4,5}. Write out the relation R that expresses on A. 378 Reltions 16.7 Solutions for Chpter 16 Section 16.1 Exercises 1. Let A = {0,1,2,3,4,5}. Write out the reltion R tht expresses > on A. Then illustrte it with digrm. 2 1 R = { (5,4),(5,3),(5,2),(5,1),(5,0),(4,3),(4,2),(4,1),

More information

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz University of Southern Cliforni Computer Science Deprtment Compiler Design Fll Lexicl Anlysis Smple Exercises nd Solutions Prof. Pedro C. Diniz USC / Informtion Sciences Institute 4676 Admirlty Wy, Suite

More information

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3 2 The Prllel Circuit Electric Circuits: Figure 2- elow show ttery nd multiple resistors rrnged in prllel. Ech resistor receives portion of the current from the ttery sed on its resistnce. The split is

More information

CS375: Logic and Theory of Computing

CS375: Logic and Theory of Computing CS375: Logic nd Theory of Computing Fuhu (Frnk) Cheng Deprtment of Computer Science University of Kentucky 1 Tle of Contents: Week 1: Preliminries (set lger, reltions, functions) (red Chpters 1-4) Weeks

More information

2.4 Linear Inequalities and Interval Notation

2.4 Linear Inequalities and Interval Notation .4 Liner Inequlities nd Intervl Nottion We wnt to solve equtions tht hve n inequlity symol insted of n equl sign. There re four inequlity symols tht we will look t: Less thn , Less thn or

More information

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers Speech Recognition Lecture 2: Finite Automt nd Finite-Stte Trnsducers Eugene Weinstein Google, NYU Cournt Institute eugenew@cs.nyu.edu Slide Credit: Mehryr Mohri Preliminries Finite lphet, empty string.

More information

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages 5//6 Grmmr Automt nd Lnguges Regulr Grmmr Context-free Grmmr Context-sensitive Grmmr Prof. Mohmed Hmd Softwre Engineering L. The University of Aizu Jpn Regulr Lnguges Context Free Lnguges Context Sensitive

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

along the vector 5 a) Find the plane s coordinate after 1 hour. b) Find the plane s coordinate after 2 hours. c) Find the plane s coordinate

along the vector 5 a) Find the plane s coordinate after 1 hour. b) Find the plane s coordinate after 2 hours. c) Find the plane s coordinate L8 VECTOR EQUATIONS OF LINES HL Mth - Sntowski Vector eqution of line 1 A plne strts journey t the point (4,1) moves ech hour long the vector. ) Find the plne s coordinte fter 1 hour. b) Find the plne

More information

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers. Mehryar Mohri Courant Institute and Google Research

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers. Mehryar Mohri Courant Institute and Google Research Speech Recognition Lecture 2: Finite Automt nd Finite-Stte Trnsducers Mehryr Mohri Cournt Institute nd Google Reserch mohri@cims.nyu.com Preliminries Finite lphet Σ, empty string. Set of ll strings over

More information

p-adic Egyptian Fractions

p-adic Egyptian Fractions p-adic Egyptin Frctions Contents 1 Introduction 1 2 Trditionl Egyptin Frctions nd Greedy Algorithm 2 3 Set-up 3 4 p-greedy Algorithm 5 5 p-egyptin Trditionl 10 6 Conclusion 1 Introduction An Egyptin frction

More information

Deterministic Finite Automata

Deterministic Finite Automata Finite Automt Deterministic Finite Automt H. Geuvers nd J. Rot Institute for Computing nd Informtion Sciences Version: fll 2016 J. Rot Version: fll 2016 Tlen en Automten 1 / 21 Outline Finite Automt Finite

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

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA) Finite Automt (FA or DFA) CHAPTER Regulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, equivlence of NFAs DFAs, closure under regulr

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

Name Ima Sample ASU ID

Name Ima Sample ASU ID Nme Im Smple ASU ID 2468024680 CSE 355 Test 1, Fll 2016 30 Septemer 2016, 8:35-9:25.m., LSA 191 Regrding of Midterms If you elieve tht your grde hs not een dded up correctly, return the entire pper to

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

September 13 Homework Solutions

September 13 Homework Solutions College of Engineering nd Computer Science Mechnicl Engineering Deprtment Mechnicl Engineering 5A Seminr in Engineering Anlysis Fll Ticket: 5966 Instructor: Lrry Cretto Septemer Homework Solutions. Are

More information

set is not closed under matrix [ multiplication, ] and does not form a group.

set is not closed under matrix [ multiplication, ] and does not form a group. Prolem 2.3: Which of the following collections of 2 2 mtrices with rel entries form groups under [ mtrix ] multipliction? i) Those of the form for which c d 2 Answer: The set of such mtrices is not closed

More information

a,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1

a,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1 CS4 45- Determinisitic Finite Automt -: Genertors vs. Checkers Regulr expressions re one wy to specify forml lnguge String Genertor Genertes strings in the lnguge Deterministic Finite Automt (DFA) re nother

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

CISC 4090 Theory of Computation

CISC 4090 Theory of Computation 9/6/28 Stereotypicl computer CISC 49 Theory of Computtion Finite stte mchines & Regulr lnguges Professor Dniel Leeds dleeds@fordhm.edu JMH 332 Centrl processing unit (CPU) performs ll the instructions

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

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

ɛ-closure, Kleene s Theorem,

ɛ-closure, Kleene s Theorem, DEGefW5wiGH2XgYMEzUKjEmtCDUsRQ4d 1 A nice pper relevnt to this course is titled The Glory of the Pst 2 NICTA Resercher, Adjunct t the Austrlin Ntionl University nd Griffith University ɛ-closure, Kleene

More information

Bases for Vector Spaces

Bases for Vector Spaces Bses for Vector Spces 2-26-25 A set is independent if, roughly speking, there is no redundncy in the set: You cn t uild ny vector in the set s liner comintion of the others A set spns if you cn uild everything

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

Formal Languages and Automata

Formal Languages and Automata Moile Computing nd Softwre Engineering p. 1/5 Forml Lnguges nd Automt Chpter 2 Finite Automt Chun-Ming Liu cmliu@csie.ntut.edu.tw Deprtment of Computer Science nd Informtion Engineering Ntionl Tipei University

More information

Languages & Automata

Languages & Automata Lnguges & Automt Dr. Lim Nughton Lnguges A lnguge is sed on n lphet which is finite set of smols such s {, } or {, } or {,..., z}. If Σ is n lphet, string over Σ is finite sequence of letters from Σ, (strings

More information

Myhill-Nerode Theorem

Myhill-Nerode Theorem Overview Myhill-Nerode Theorem Correspondence etween DA s nd MN reltions Cnonicl DA for L Computing cnonicl DFA Myhill-Nerode Theorem Deepk D Souz Deprtment of Computer Science nd Automtion Indin Institute

More information

Improper Integrals. The First Fundamental Theorem of Calculus, as we ve discussed in class, goes as follows:

Improper Integrals. The First Fundamental Theorem of Calculus, as we ve discussed in class, goes as follows: Improper Integrls The First Fundmentl Theorem of Clculus, s we ve discussed in clss, goes s follows: If f is continuous on the intervl [, ] nd F is function for which F t = ft, then ftdt = F F. An integrl

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

Regular Language. Nonregular Languages The Pumping Lemma. The pumping lemma. Regular Language. The pumping lemma. Infinitely long words 3/17/15

Regular Language. Nonregular Languages The Pumping Lemma. The pumping lemma. Regular Language. The pumping lemma. Infinitely long words 3/17/15 Regulr Lnguge Nonregulr Lnguges The Pumping Lemm Models of Comput=on Chpter 10 Recll, tht ny lnguge tht cn e descried y regulr expression is clled regulr lnguge In this lecture we will prove tht not ll

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

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

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

Introduction to Algebra - Part 2

Introduction to Algebra - Part 2 Alger Module A Introduction to Alger - Prt Copright This puliction The Northern Alert Institute of Technolog 00. All Rights Reserved. LAST REVISED Oct., 008 Introduction to Alger - Prt Sttement of Prerequisite

More information

Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem 2/16/15

Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem 2/16/15 Models of Comput:on Lecture #8 Chpter 7 con:nued Any lnguge tht e defined y regulr expression, finite utomton, or trnsi:on grph cn e defined y ll three methods We prove this y showing tht ny lnguge defined

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

11.1 Finite Automata. CS125 Lecture 11 Fall Motivation: TMs without a tape: maybe we can at least fully understand such a simple model?

11.1 Finite Automata. CS125 Lecture 11 Fall Motivation: TMs without a tape: maybe we can at least fully understand such a simple model? CS125 Lecture 11 Fll 2016 11.1 Finite Automt Motivtion: TMs without tpe: mybe we cn t lest fully understnd such simple model? Algorithms (e.g. string mtching) Computing with very limited memory Forml verifiction

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

Interpreting Integrals and the Fundamental Theorem

Interpreting Integrals and the Fundamental Theorem Interpreting Integrls nd the Fundmentl Theorem Tody, we go further in interpreting the mening of the definite integrl. Using Units to Aid Interprettion We lredy know tht if f(t) is the rte of chnge of

More information

Formal Language and Automata Theory (CS21004)

Formal Language and Automata Theory (CS21004) Forml Lnguge nd Automt Forml Lnguge nd Automt Theory (CS21004) Khrgpur Khrgpur Khrgpur Forml Lnguge nd Automt Tle of Contents Forml Lnguge nd Automt Khrgpur 1 2 3 Khrgpur Forml Lnguge nd Automt Forml Lnguge

More information

CS375: Logic and Theory of Computing

CS375: Logic and Theory of Computing CS375: Logic nd Theory of Computing Fuhu (Frnk) Cheng Deprtment of Computer Science University of Kentucky 1 Tble of Contents: Week 1: Preliminries (set lgebr, reltions, functions) (red Chpters 1-4) Weeks

More information

CS S-12 Turing Machine Modifications 1. When we added a stack to NFA to get a PDA, we increased computational power

CS S-12 Turing Machine Modifications 1. When we added a stack to NFA to get a PDA, we increased computational power CS411-2015S-12 Turing Mchine Modifictions 1 12-0: Extending Turing Mchines When we dded stck to NFA to get PDA, we incresed computtionl power Cn we do the sme thing for Turing Mchines? Tht is, cn we dd

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