Finite Automata. Reading: Chapter 2
|
|
- Bryan Hancock
- 5 years ago
- Views:
Transcription
1 Fiite Automata Readig: Chapter 2
2 Fiite Automato (FA) Iformally, a state diagram that comprehesively captures all possible states ad trasitios that a machie ca take while respodig to a stream or sequece of iput symbols Recogizer for Regular Laguages Determiistic Fiite Automata (DFA) The machie ca exist i oly oe state at ay give time No-determiistic Fiite Automata (NFA) The machie ca exist i multiple states at the same time 2
3 Determiistic Fiite Automata - Defiitio A Determiistic Fiite Automato (DFA) cosists of: Q ==> a fiite set of states ==> a fiite set of iput symbols (alphabet) q 0 ==> a start state F ==> set of acceptig states δ ==> a trasitio fuctio, which is a mappig betwee Q x ==> Q A DFA is defied by the 5-tuple: {Q,, q 0,F, δ } 3
4 What does a DFA do o readig a iput strig? Iput: a word w i * Questio: Is w acceptable by the DFA? Steps: Start at the start state q 0 For every iput symbol i the sequece w do Compute the ext state from the curret state, give the curret iput symbol i w ad the trasitio fuctio If after all symbols i w are cosumed, the curret state is oe of the acceptig states (F) the accept w; Otherwise, reject w. 4
5 Regular Laguages Let L(A) be a laguage recogized by a DFA A. The L(A) is called a Regular Laguage. Locate regular laguages i the Chomsky Hierarchy 5
6 The Chomsky Hierachy A cotaimet hierarchy of classes of formal laguages Regular (DFA) Cotextfree (PDA) Cotextsesitive (LBA) Recursivelyeumerable (TM) 6
7 Example # Build a DFA for the followig laguage: L = {w w is a biary strig that cotais 0 as a substrig} Steps for buildig a DFA to recogize L: = {0,} Decide o the states: Q Desigate start state ad fial state(s) δ: Decide o the trasitios: Fial states == same as acceptig states Other states == same as o-acceptig states 7
8 Regular expressio: (0+)*0(0+)* DFA for strigs cotaiig 0 What makes this DFA determiistic? Q = {q 0,q,q 2 } start 0, 0 q 0 0 q What if the laguage allows empty strigs? q 2 Acceptig state states = {0,} start state = q 0 F = {q 2 } Trasitio table symbols 0 q 0 q *q 2 q q q 2 q 0 q 2 q 2 8
9 Example #2 Clampig Logic: A clampig circuit waits for a iput, ad turs o forever. However, to avoid clampig o spurious oise, we ll desig a DFA that waits for two cosecutive s i a row before clampig o. Build a DFA for the followig laguage: L = { w w is a bit strig which cotais the substrig } State Desig: q 0 : start state (iitially off), also meas the most recet iput was ot a q : has ever see but the most recet iput was a q 2 : has see at least oce 9
10 Example #3 Build a DFA for the followig laguage: L = { w w is a biary strig that has eve umber of s ad eve umber of 0s}? 0
11 Extesio of trasitios (δ) to Paths (δ) δ (q,w) = destiatio state from state q o iput strig w δ (q,wa) = δ (δ(q,w), a) Work out example #3 usig the iput sequece w=000, a=: δ (q 0,wa) =?
12 Laguage of a DFA A DFA A accepts strig w if there is a path from q 0 to a acceptig (or fial) state that is labeled by w i.e., L(A) = { w δ(q 0,w) F } I.e., L(A) = all strigs that lead to a acceptig state from q 0 2
13 No-determiistic Fiite Automata (NFA) A No-determiistic Fiite Automato (NFA) is of course o-determiistic Implyig that the machie ca exist i more tha oe state at the same time Trasitios could be o-determiistic q i q j q k Each trasitio fuctio therefore maps to a set of states 3
14 No-determiistic Fiite Automata (NFA) A No-determiistic Fiite Automato (NFA) cosists of: Q ==> a fiite set of states ==> a fiite set of iput symbols (alphabet) q 0 ==> a start state F ==> set of acceptig states δ ==> a trasitio fuctio, which is a mappig betwee Q x ==> subset of Q A NFA is also defied by the 5-tuple: {Q,, q 0,F, δ } 4
15 How to use a NFA? Iput: a word w i * Questio: Is w acceptable by the NFA? Steps: Start at the start state q 0 For every iput symbol i the sequece w do Determie all possible ext states from all curret states, give the curret iput symbol i w ad the trasitio fuctio If after all symbols i w are cosumed ad if at least oe of the curret states is a fial state the accept w; Otherwise, reject w. 5
16 Regular expressio: (0+)*0(0+)* NFA for strigs cotaiig 0 Why is this o-determiistic? start 0, 0, q 0 0 q What will happe if at state q a iput of 0 is received? q 2 Fial state states Q = {q 0,q,q 2 } Σ = {0,} start state = q 0 F = {q 2 } Trasitio table symbols 0 q 0 {q 0,q } {q 0 } q Φ {q 2 } *q 2 {q 2 } {q 2 } 6
17 Note: Omittig to explicitly show error states is just a matter of desig coveiece (oe that is geerally followed for NFAs), ad i.e., this feature should ot be cofused with the otio of o-determiism. What is a error state? A DFA for recogizig the key word while q 0 w q h q 2 i q 3 l q 4 e q 5 Ay other iput symbol q err Ay symbol A NFA for the same purpose: q 0 w q h q 2 i q 3 l q 4 e q 5 Trasitios ito a dead state are implicit 7
18 Example #2 Build a NFA for the followig laguage: L = { w w eds i 0}? Other examples Keyword recogizer (e.g., if, the, else, while, for, iclude, etc.) Strigs where the first symbol is preset somewhere later o at least oce 8
19 Extesio of δ to NFA Paths Basis: δ (q,ε) = {q} Iductio: Let δ (q 0,w) = {p,p 2,p k } δ (p i,a) = S i for i=,2...,k The, δ (q 0,wa) = S U S 2 U U S k 9
20 Laguage of a NFA A NFA accepts w if there exists at least oe path from the start state to a acceptig (or fial) state that is labeled by w L(N) = { w δ(q 0,w) F Φ } 20
21 Advatages & Caveats for NFA Great for modelig regular expressios Strig processig - e.g., grep, lexical aalyzer Could a o-determiistic state machie be implemeted i practice? Probabilistic models could be viewed as extesios of odetermiistic state machies (e.g., toss of a coi, a roll of dice) They are ot the same though A parallel computer could exist i multiple states at the same time 2
22 Techologies for NFAs Micro s Automata Processor (itroduced i 203) 2D array of MISD (multiple istructio sigle data) fabric w/ thousads to millios of processig elemets. iput symbol = fed to all states (i.e., cores) No-determiism usig circuits 22
23 But, DFAs ad NFAs are equivalet i their power to capture lagauges!! Differeces: DFA vs. NFA DFA. All trasitios are determiistic Each trasitio leads to exactly oe state 2. For each state, trasitio o all possible symbols (alphabet) should be defied 3. Accepts iput if the last state visited is i F 4. Sometimes harder to costruct because of the umber of states 5. Practical implemetatio is feasible NFA. Some trasitios could be o-determiistic A trasitio could lead to a subset of states 2. Not all symbol trasitios eed to be defied explicitly (if udefied will go to a error state this is just a desig coveiece, ot to be cofused with odetermiism ) 3. Accepts iput if oe of the last states is i F 4. Geerally easier tha a DFA to costruct 5. Practical implemetatios limited but emergig (e.g., Micro automata processor) 23
24 Equivalece of DFA & NFA Should be true for ay L Theorem: A laguage L is accepted by a DFA if ad oly if it is accepted by a NFA. Proof:. If part: Prove by showig every NFA ca be coverted to a equivalet DFA (i the ext few slides ) 2. Oly-if part is trivial: Every DFA is a special case of a NFA where each state has exactly oe trasitio for every iput symbol. Therefore, if L is accepted by a DFA, it is accepted by a correspodig NFA. 24
25 Proof for the if-part If-part: A laguage L is accepted by a DFA if it is accepted by a NFA rephrasig Give ay NFA N, we ca costruct a DFA D such that L(N)=L(D) How to covert a NFA ito a DFA? Observatio: I a NFA, each trasitio maps to a subset of states Idea: Represet: each subset of NFA_states è a sigle DFA_state Subset costructio 25
26 NFA to DFA by subset costructio Let N = {Q N,,δ N,q 0,F N } Goal: Build D={Q D,,δ D,{q 0 },F D } s.t. L(D)=L(N) Costructio:. Q D = all subsets of Q N (i.e., power set) 2. F D =set of subsets S of Q N s.t. S F N Φ 3. δ D : for each subset S of Q N ad for each iput symbol a i : δ D (S,a) = U δ N (p,a) p i s 26
27 Idea: To avoid eumeratig all of power set, do lazy creatio of states NFA to DFA costructio: Example NFA: 0, L = {w w eds i 0} 0 q 0 q q 2 DFA: [q 0 ] 0 0 [q 0,q ] 0 [q 0,q 2 ] δ N 0 q 0 {q 0,q } {q 0 } q Ø {q 2 } *q 2 Ø Ø δ D 0 Ø Ø Ø [q 0 ] {q 0,q } {q 0 } [q ] Ø {q 2 } *[q 2 ] Ø Ø [q 0,q ] {q 0,q } {q 0,q 2 } *[q 0,q 2 ] {q 0,q } {q 0 } *[q,q 2 ] Ø {q 2 } *[q 0,q,q 2 ] {q 0,q } {q 0,q 2 } δ D 0 [q 0 ] [q 0,q ] [q 0 ] [q 0,q ] [q 0,q ] [q 0,q 2 ] *[q 0,q 2 ] [q 0,q ] [q 0 ] 0. Eumerate all possible subsets. Determie trasitios 2. Retai oly those states reachable from {q 0 } 27
28 NFA to DFA: Repeatig the example usig LAZY CREATION NFA: 0, L = {w w eds i 0} 0 q 0 q q 2 DFA: [q 0 ] 0 0 [q 0,q ] 0 [q 0,q 2 ] δ N 0 q 0 {q 0,q } {q 0 } q Ø {q 2 } *q 2 Ø Ø δ D 0 [q 0 ] [q 0,q ] [q 0 ] [q 0,q ] [q 0,q ] [q 0,q 2 ] *[q 0,q 2 ] [q 0,q ] [q 0 ] Mai Idea: Itroduce states as you go (o a eed basis) 28
29 Correctess of subset costructio Theorem: If D is the DFA costructed from NFA N by subset costructio, the L(D)=L(N) Proof: Show that δ D ({q 0 },w) δ N (q 0,w}, for all w Usig iductio o w s legth: Let w = xa δ D ({q 0 },xa) δ D ( δ N (q 0,x}, a ) δ N (q 0,w} 29
30 A bad case where #states(dfa)>>#states(nfa) L = {w w is a biary strig s.t., the k th symbol from its ed is a } NFA has k+ states But a equivalet DFA eeds to have at least 2 k states (Pigeo hole priciple) m holes ad >m pigeos => at least oe hole has to cotai two or more pigeos 30
31 Applicatios Text idexig iverted idexig For each uique word i the database, store all locatios that cotai it usig a NFA or a DFA Fid patter P i text T Example: Google queryig Extesios of this idea: PATRICIA tree, suffix tree 3
32 A few subtle properties of DFAs ad NFAs The machie ever really termiates. It is always waitig for the ext iput symbol or makig trasitios. The machie decides whe to cosume the ext symbol from the iput ad whe to igore it. (but the machie ca ever skip a symbol) => A trasitio ca happe eve without really cosumig a iput symbol (thik of cosumig ε as a free toke) if this happes, the it becomes a ε-nfa (see ext few slides). A sigle trasitio caot cosume more tha oe (o-ε) symbol. 32
33 FA with ε-trasitios We ca allow explicit ε-trasitios i fiite automata i.e., a trasitio from oe state to aother state without cosumig ay additioal iput symbol Explicit ε-trasitios betwee differet states itroduce o-determiism. Makes it easier sometimes to costruct NFAs Defiitio: ε -NFAs are those NFAs with at least oe explicit ε-trasitio defied. ε -NFAs have oe more colum i their trasitio table 33
34 Example of a ε-nfa L = {w w is empty, or if o-empty will ed i 0} start ε q 0 0, 0 q 0 q δ E 0 ε *q 0 Ø Ø {q 0,q 0 } q 0 {q 0,q } {q 0 } {q 0 } q Ø {q 2 } {q } q 2 ECLOSE(q 0 ) ECLOSE(q 0 ) ECLOSE(q ) ε-closure of a state q, ECLOSE(q), is the set of all states (icludig itself) that ca be reached from q by repeatedly makig a arbitrary umber of ε- trasitios. *q 2 Ø Ø {q 2 } ECLOSE(q 2 ) 34
35 To simulate ay trasitio: Step ) Go to all immediate destiatio states. Step 2) From there go to all their ε-closure states as well. Example of a ε-nfa L = {w w is empty, or if o-empty will ed i 0} start ε q 0 0, 0 q 0 q q 2 Simulate for w=0: q 0 q 0 ε ε q 0 δ E 0 ε *q 0 Ø Ø {q 0,q 0 } q 0 {q 0,q } {q 0 } {q 0 } ECLOSE(q 0 ) ECLOSE(q 0 ) Ø x 0 q 0 q q Ø {q 2 } {q } q 2 *q 2 Ø Ø {q 2 } 35
36 To simulate ay trasitio: Step ) Go to all immediate destiatio states. Step 2) From there go to all their ε-closure states as well. Example of aother ε-nfa ε 0, 0 q 0 q ε q 2 Simulate for w=0:? start q 0 q 3 δ E 0 ε *q 0 Ø Ø {q 0,q 0,q 3 } q 0 {q 0,q } {q 0 } {q 0, q 3 } q Ø {q 2 } {q } *q 2 Ø Ø {q 2 } q 3 Ø {q 2 } {q 3 } 36
37 Equivalecy of DFA, NFA, ε-nfa Theorem: A laguage L is accepted by some ε-nfa if ad oly if L is accepted by some DFA Implicatio: DFA NFA ε-nfa (all accept Regular Laguages) 37
38 Elimiatig ε-trasitios Let E = {Q E,,δ E,q 0,F E } be a ε-nfa Goal: To build DFA D={Q D,,δ D,{q D },F D } s.t. L(D)=L(E) Costructio:. Q D = all reachable subsets of Q E factorig i ε-closures 2. q D = ECLOSE(q 0 ) 3. F D =subsets S i Q D s.t. S F E Φ 4. δ D : for each subset S of Q E ad for each iput symbol a : p i s Let R= U δ E (p,a) // go to destiatio states δ D (S,a) = r U i R ECLOSE(r) // from there, take a uio of all their ε- closures Readig: Sectio i book 38
39 Example: ε-nfa è DFA L = {w w is empty, or if o-empty will ed i 0} 0, ε 0 q 0 q q 2 start q 0 δ E 0 ε *q 0 Ø Ø {q 0,q 0 } q 0 {q 0,q } {q 0 } {q 0 } q Ø {q 2 } {q } *q 2 Ø Ø {q 2 } δ D 0 *{q 0,q 0 } 39
40 Example: ε-nfa è DFA start L = {w w is empty, or if o-empty will ed i 0} ε q 0 0, 0 q 0 q ECLOSE q 2 uio start 0 {q 0, q 0 } 0 {q 0,q } 0 q 0 0 {q 0,q 2 } δ E 0 ε δ D 0 *q 0 Ø Ø {q 0,q 0 } q 0 {q 0,q } {q 0 } {q 0 } q Ø {q 2 } {q } *q 2 Ø Ø {q 2 } *{q 0,q 0 } {q 0,q } {q 0 } {q 0,q } {q 0,q } {q 0,q 2 } {q 0 } {q 0,q } {q 0 } *{q 0,q 2 } {q 0,q } {q 0 } 40
41 Summary DFA Defiitio Trasitio diagrams & tables Regular laguage NFA Defiitio Trasitio diagrams & tables DFA vs. NFA NFA to DFA coversio usig subset costructio Equivalecy of DFA & NFA Removal of redudat states ad icludig dead states ε-trasitios i NFA Pigeo hole priciples Text searchig applicatios 4
Course 4 Finite Automata/Finite State Machines
Course 4 Finite Automata/Finite State Machines The structure and the content of the lecture is based on (1) http://www.eecs.wsu.edu/~ananth/cpts317/lectures/index.htm, (2) W. Schreiner Computability and
More informationIntroduction to Automata Theory. Reading: Chapter 1
Itroductio to Automata Theory Readig: Chapter 1 1 What is Automata Theory? Study of abstract computig devices, or machies Automato = a abstract computig device Note: A device eed ot eve be a physical hardware!
More informationCourse 8 Properties of Regular Languages
Course 8 Properties of Regular Laguages The structure ad the cotet of the lecture is based o http://www.eecs.wsu.edu/~aath/cpts37/lectures/idex.htm Topics ) How to prove whether a give laguage is ot regular?
More informationProperties of Regular Languages. Reading: Chapter 4
Properties of Regular Laguages Readig: Chapter 4 Topics ) How to prove whether a give laguage is regular or ot? 2) Closure properties of regular laguages 3) Miimizatio of DFAs 2 Some laguages are ot regular
More informationPRACTICE FINAL SOLUTIONS
CSE 303 PRACTICE FINAL SOLUTIONS FOR FINAL stud Practice Fial (mius PUMPING LEMMA ad Turig Machies) ad Problems from Q1 Q4, Practice Q1 Q4, ad Midterm ad Practice midterm. I will choose some of these problems
More informationComputability and computational complexity
Computability ad computatioal complexity Lecture 4: Uiversal Turig machies. Udecidability Io Petre Computer Sciece, Åbo Akademi Uiversity Fall 2015 http://users.abo.fi/ipetre/computability/ 21. toukokuu
More informationDecision, Computation and Language
Decision, Computation and Language Non-Deterministic Finite Automata (NFA) Dr. Muhammad S Khan (mskhan@liv.ac.uk) Ashton Building, Room G22 http://www.csc.liv.ac.uk/~khan/comp218 Finite State Automata
More information2017 PRACTICE MIDTERM SOLUTIONS
CSE303 2017 PRACTICE MIDTERM SOLUTIONS 1 YES/NO questios 1. For a biar relatio R A A, R exists. Justif: defiitio 2. For a biar relatio R A A, R 1 exists. Justif: The set R 1 = {(b, a) : (a, b) R} alwas
More informationLecture Overview. 2 Permutations and Combinations. n(n 1) (n (k 1)) = n(n 1) (n k + 1) =
COMPSCI 230: Discrete Mathematics for Computer Sciece April 8, 2019 Lecturer: Debmalya Paigrahi Lecture 22 Scribe: Kevi Su 1 Overview I this lecture, we begi studyig the fudametals of coutig discrete objects.
More informationFortgeschrittene Datenstrukturen Vorlesung 11
Fortgeschrittee Datestruture Vorlesug 11 Schriftführer: Marti Weider 19.01.2012 1 Succict Data Structures (ctd.) 1.1 Select-Queries A slightly differet approach, compared to ra, is used for select. B represets
More informationLecture 9: Hierarchy Theorems
IAS/PCMI Summer Sessio 2000 Clay Mathematics Udergraduate Program Basic Course o Computatioal Complexity Lecture 9: Hierarchy Theorems David Mix Barrigto ad Alexis Maciel July 27, 2000 Most of this lecture
More informationLecture 11: Pseudorandom functions
COM S 6830 Cryptography Oct 1, 2009 Istructor: Rafael Pass 1 Recap Lecture 11: Pseudoradom fuctios Scribe: Stefao Ermo Defiitio 1 (Ge, Ec, Dec) is a sigle message secure ecryptio scheme if for all uppt
More informationSequences, Mathematical Induction, and Recursion. CSE 2353 Discrete Computational Structures Spring 2018
CSE 353 Discrete Computatioal Structures Sprig 08 Sequeces, Mathematical Iductio, ad Recursio (Chapter 5, Epp) Note: some course slides adopted from publisher-provided material Overview May mathematical
More informationInfinite Sequences and Series
Chapter 6 Ifiite Sequeces ad Series 6.1 Ifiite Sequeces 6.1.1 Elemetary Cocepts Simply speakig, a sequece is a ordered list of umbers writte: {a 1, a 2, a 3,...a, a +1,...} where the elemets a i represet
More informationEE260: Digital Design, Spring n Binary Addition. n Complement forms. n Subtraction. n Multiplication. n Inputs: A 0, B 0. n Boolean equations:
EE260: Digital Desig, Sprig 2018 EE 260: Itroductio to Digital Desig Arithmetic Biary Additio Complemet forms Subtractio Multiplicatio Overview Yao Zheg Departmet of Electrical Egieerig Uiversity of Hawaiʻi
More informationSkip Lists. Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015 S 3 S S 1
Presetatio for use with the textbook, Algorithm Desig ad Applicatios, by M. T. Goodrich ad R. Tamassia, Wiley, 2015 Skip Lists S 3 15 15 23 10 15 23 36 Skip Lists 1 What is a Skip List A skip list for
More informationDiscrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 22
CS 70 Discrete Mathematics for CS Sprig 2007 Luca Trevisa Lecture 22 Aother Importat Distributio The Geometric Distributio Questio: A biased coi with Heads probability p is tossed repeatedly util the first
More informationMathematical Induction
Mathematical Iductio Itroductio Mathematical iductio, or just iductio, is a proof techique. Suppose that for every atural umber, P() is a statemet. We wish to show that all statemets P() are true. I a
More informationExercises 1 Sets and functions
Exercises 1 Sets ad fuctios HU Wei September 6, 018 1 Basics Set theory ca be made much more rigorous ad built upo a set of Axioms. But we will cover oly some heuristic ideas. For those iterested studets,
More informationResolution Proofs of Generalized Pigeonhole Principles
Resolutio Proofs of Geeralized Pigeohole Priciples Samuel R. Buss Departmet of Mathematics Uiversity of Califoria, Berkeley Győrgy Turá Departmet of Mathematics, Statistics, ad Computer Sciece Uiversity
More informationsubcaptionfont+=small,labelformat=parens,labelsep=space,skip=6pt,list=0,hypcap=0 subcaption ALGEBRAIC COMBINATORICS LECTURE 8 TUESDAY, 2/16/2016
subcaptiofot+=small,labelformat=pares,labelsep=space,skip=6pt,list=0,hypcap=0 subcaptio ALGEBRAIC COMBINATORICS LECTURE 8 TUESDAY, /6/06. Self-cojugate Partitios Recall that, give a partitio λ, we may
More informationDe Bruijn Sequences for the Binary Strings with Maximum Specified Density
De Bruij Sequeces for the Biary Strigs with Maximum Specified Desity Joe Sawada 1, Brett Steves 2, ad Aaro Williams 2 1 jsawada@uoguelph.ca School of Computer Sciece, Uiversity of Guelph, CANADA 2 brett@math.carleto.ca
More informationSquare-Congruence Modulo n
Square-Cogruece Modulo Abstract This paper is a ivestigatio of a equivalece relatio o the itegers that was itroduced as a exercise i our Discrete Math class. Part I - Itro Defiitio Two itegers are Square-Cogruet
More informationRecurrence Relations
Recurrece Relatios Aalysis of recursive algorithms, such as: it factorial (it ) { if (==0) retur ; else retur ( * factorial(-)); } Let t be the umber of multiplicatios eeded to calculate factorial(). The
More informationt distribution [34] : used to test a mean against an hypothesized value (H 0 : µ = µ 0 ) or the difference
EXST30 Backgroud material Page From the textbook The Statistical Sleuth Mea [0]: I your text the word mea deotes a populatio mea (µ) while the work average deotes a sample average ( ). Variace [0]: The
More informationDe Bruijn Sequences for the Binary Strings with Maximum Density
De Bruij Sequeces for the Biary Strigs with Maximum Desity Joe Sawada 1, Brett Steves 2, ad Aaro Williams 2 1 jsawada@uoguelph.ca School of Computer Sciece, Uiversity of Guelph, CANADA 2 brett@math.carleto.ca
More informationAdvanced Stochastic Processes.
Advaced Stochastic Processes. David Gamarik LECTURE 2 Radom variables ad measurable fuctios. Strog Law of Large Numbers (SLLN). Scary stuff cotiued... Outlie of Lecture Radom variables ad measurable fuctios.
More informationCSE 191, Class Note 05: Counting Methods Computer Sci & Eng Dept SUNY Buffalo
Coutig Methods CSE 191, Class Note 05: Coutig Methods Computer Sci & Eg Dept SUNY Buffalo c Xi He (Uiversity at Buffalo CSE 191 Discrete Structures 1 / 48 Need for Coutig The problem of coutig the umber
More informationHashing and Amortization
Lecture Hashig ad Amortizatio Supplemetal readig i CLRS: Chapter ; Chapter 7 itro; Sectio 7.. Arrays ad Hashig Arrays are very useful. The items i a array are statically addressed, so that isertig, deletig,
More informationInjections, Surjections, and the Pigeonhole Principle
Ijectios, Surjectios, ad the Pigeohole Priciple 1 (10 poits Here we will come up with a sloppy boud o the umber of parethesisestigs (a (5 poits Describe a ijectio from the set of possible ways to est pairs
More informationNumber Representation
Number Represetatio 1 Number System :: The Basics We are accustomed to usig the so-called decimal umber system Te digits :: 0,1,2,3,4,5,6,7,8,9 Every digit positio has a weight which is a power of 10 Base
More information1 Hash tables. 1.1 Implementation
Lecture 8 Hash Tables, Uiversal Hash Fuctios, Balls ad Bis Scribes: Luke Johsto, Moses Charikar, G. Valiat Date: Oct 18, 2017 Adapted From Virgiia Williams lecture otes 1 Hash tables A hash table is a
More informationCALCULATION OF FIBONACCI VECTORS
CALCULATION OF FIBONACCI VECTORS Stuart D. Aderso Departmet of Physics, Ithaca College 953 Daby Road, Ithaca NY 14850, USA email: saderso@ithaca.edu ad Dai Novak Departmet of Mathematics, Ithaca College
More informationThe Borel hierarchy classifies subsets of the reals by their topological complexity. Another approach is to classify them by size.
Lecture 7: Measure ad Category The Borel hierarchy classifies subsets of the reals by their topological complexity. Aother approach is to classify them by size. Filters ad Ideals The most commo measure
More information4 The Sperner property.
4 The Sperer property. I this sectio we cosider a surprisig applicatio of certai adjacecy matrices to some problems i extremal set theory. A importat role will also be played by fiite groups. I geeral,
More information62. Power series Definition 16. (Power series) Given a sequence {c n }, the series. c n x n = c 0 + c 1 x + c 2 x 2 + c 3 x 3 +
62. Power series Defiitio 16. (Power series) Give a sequece {c }, the series c x = c 0 + c 1 x + c 2 x 2 + c 3 x 3 + is called a power series i the variable x. The umbers c are called the coefficiets of
More informationIf a subset E of R contains no open interval, is it of zero measure? For instance, is the set of irrationals in [0, 1] is of measure zero?
2 Lebesgue Measure I Chapter 1 we defied the cocept of a set of measure zero, ad we have observed that every coutable set is of measure zero. Here are some atural questios: If a subset E of R cotais a
More informationA Turing Machine. The Tape. Languages accepted by Turing Machines. Tape... Read-Write head. Context-Free n Languages. Control Unit.
CS 30 - ecture 9 Turig Machies Fall 2008 eview aguages ad Grammars Alphaets, strigs, laguages egular aguages Determiistic Fiite ad Nodetermiistic Automata Equivalece of NFA ad DFA ad Miimizig a DFA egular
More informationCHAPTER XI DATAPATH ELEMENTS
CHAPTER XI- CHAPTER XI CHAPTER XI READ REE-DOC ON COURSE WEBPAGE CHAPTER XI-2 INTRODUCTION -INTRODUCTION So far we have discussed may small compoets ad buildig blocks. Oe fial step i our buildig blocks
More informationSome Explicit Formulae of NAF and its Left-to-Right. Analogue Based on Booth Encoding
Vol.7, No.6 (01, pp.69-74 http://dx.doi.org/10.1457/ijsia.01.7.6.7 Some Explicit Formulae of NAF ad its Left-to-Right Aalogue Based o Booth Ecodig Dog-Guk Ha, Okyeo Yi, ad Tsuyoshi Takagi Kookmi Uiversity,
More informationLecture 2.5: Sequences
Lecture.5: Sequeces CS 50, Discrete Structures, Fall 015 Nitesh Saxea Adopted from previous lectures by Zeph Gruschlag Course Admi HW posted Covers Chapter Due Oct 0 (Tue) Mid Term 1: Oct 15 (Thursday)
More informationLesson 10: Limits and Continuity
www.scimsacademy.com Lesso 10: Limits ad Cotiuity SCIMS Academy 1 Limit of a fuctio The cocept of limit of a fuctio is cetral to all other cocepts i calculus (like cotiuity, derivative, defiite itegrals
More informationLecture Notes for Analysis Class
Lecture Notes for Aalysis Class Topological Spaces A topology for a set X is a collectio T of subsets of X such that: (a) X ad the empty set are i T (b) Uios of elemets of T are i T (c) Fiite itersectios
More informationLecture 1: Basic problems of coding theory
Lecture 1: Basic problems of codig theory Error-Correctig Codes (Sprig 016) Rutgers Uiversity Swastik Kopparty Scribes: Abhishek Bhrushudi & Aditya Potukuchi Admiistrivia was discussed at the begiig of
More informationHardness Results for Intersection Non-Emptiness
Hardess Results for Itersectio No-Emptiess Michael Wehar Uiversity at Buffalo mwehar@buffalo.edu Jauary 16, 2015 Abstract We carefully reexamie a costructio of Karakostas, Lipto, ad Viglas (2003) to show
More informationSection 5.1 The Basics of Counting
1 Sectio 5.1 The Basics of Coutig Combiatorics, the study of arragemets of objects, is a importat part of discrete mathematics. I this chapter, we will lear basic techiques of coutig which has a lot of
More informationCS / MCS 401 Homework 3 grader solutions
CS / MCS 401 Homework 3 grader solutios assigmet due July 6, 016 writte by Jāis Lazovskis maximum poits: 33 Some questios from CLRS. Questios marked with a asterisk were ot graded. 1 Use the defiitio of
More informationw (1) ˆx w (1) x (1) /ρ and w (2) ˆx w (2) x (2) /ρ.
2 5. Weighted umber of late jobs 5.1. Release dates ad due dates: maximimizig the weight of o-time jobs Oce we add release dates, miimizig the umber of late jobs becomes a sigificatly harder problem. For
More informationBertrand s Postulate
Bertrad s Postulate Lola Thompso Ross Program July 3, 2009 Lola Thompso (Ross Program Bertrad s Postulate July 3, 2009 1 / 33 Bertrad s Postulate I ve said it oce ad I ll say it agai: There s always a
More information6.003 Homework #3 Solutions
6.00 Homework # Solutios Problems. Complex umbers a. Evaluate the real ad imagiary parts of j j. π/ Real part = Imagiary part = 0 e Euler s formula says that j = e jπ/, so jπ/ j π/ j j = e = e. Thus the
More informationCALCULATING FIBONACCI VECTORS
THE GENERALIZED BINET FORMULA FOR CALCULATING FIBONACCI VECTORS Stuart D Aderso Departmet of Physics, Ithaca College 953 Daby Road, Ithaca NY 14850, USA email: saderso@ithacaedu ad Dai Novak Departmet
More information7 Sequences of real numbers
40 7 Sequeces of real umbers 7. Defiitios ad examples Defiitio 7... A sequece of real umbers is a real fuctio whose domai is the set N of atural umbers. Let s : N R be a sequece. The the values of s are
More informationRecursive Algorithm for Generating Partitions of an Integer. 1 Preliminary
Recursive Algorithm for Geeratig Partitios of a Iteger Sug-Hyuk Cha Computer Sciece Departmet, Pace Uiversity 1 Pace Plaza, New York, NY 10038 USA scha@pace.edu Abstract. This article first reviews the
More informationA sequence of numbers is a function whose domain is the positive integers. We can see that the sequence
Sequeces A sequece of umbers is a fuctio whose domai is the positive itegers. We ca see that the sequece,, 2, 2, 3, 3,... is a fuctio from the positive itegers whe we write the first sequece elemet as
More informationCS284A: Representations and Algorithms in Molecular Biology
CS284A: Represetatios ad Algorithms i Molecular Biology Scribe Notes o Lectures 3 & 4: Motif Discovery via Eumeratio & Motif Represetatio Usig Positio Weight Matrix Joshua Gervi Based o presetatios by
More informationLecture Notes for CS 313H, Fall 2011
Lecture Notes for CS 313H, Fall 011 August 5. We start by examiig triagular umbers: T () = 1 + + + ( = 0, 1,,...). Triagular umbers ca be also defied recursively: T (0) = 0, T ( + 1) = T () + + 1, or usig
More informationClassification of problem & problem solving strategies. classification of time complexities (linear, logarithmic etc)
Classificatio of problem & problem solvig strategies classificatio of time complexities (liear, arithmic etc) Problem subdivisio Divide ad Coquer strategy. Asymptotic otatios, lower boud ad upper boud:
More informationHOMEWORK 2 SOLUTIONS
HOMEWORK SOLUTIONS CSE 55 RANDOMIZED AND APPROXIMATION ALGORITHMS 1. Questio 1. a) The larger the value of k is, the smaller the expected umber of days util we get all the coupos we eed. I fact if = k
More informationNICK DUFRESNE. 1 1 p(x). To determine some formulas for the generating function of the Schröder numbers, r(x) = a(x) =
AN INTRODUCTION TO SCHRÖDER AND UNKNOWN NUMBERS NICK DUFRESNE Abstract. I this article we will itroduce two types of lattice paths, Schröder paths ad Ukow paths. We will examie differet properties of each,
More informationDesign and Analysis of Algorithms
Desig ad Aalysis of Algorithms Probabilistic aalysis ad Radomized algorithms Referece: CLRS Chapter 5 Topics: Hirig problem Idicatio radom variables Radomized algorithms Huo Hogwei 1 The hirig problem
More informationRelations Among Algebras
Itroductio to leee Algebra Lecture 6 CS786 Sprig 2004 February 9, 2004 Relatios Amog Algebras The otio of free algebra described i the previous lecture is a example of a more geeral pheomeo called adjuctio.
More informationEnd-of-Year Contest. ERHS Math Club. May 5, 2009
Ed-of-Year Cotest ERHS Math Club May 5, 009 Problem 1: There are 9 cois. Oe is fake ad weighs a little less tha the others. Fid the fake coi by weighigs. Solutio: Separate the 9 cois ito 3 groups (A, B,
More informationMachine Learning Theory Tübingen University, WS 2016/2017 Lecture 11
Machie Learig Theory Tübige Uiversity, WS 06/07 Lecture Tolstikhi Ilya Abstract We will itroduce the otio of reproducig kerels ad associated Reproducig Kerel Hilbert Spaces (RKHS). We will cosider couple
More informationAxioms of Measure Theory
MATH 532 Axioms of Measure Theory Dr. Neal, WKU I. The Space Throughout the course, we shall let X deote a geeric o-empty set. I geeral, we shall ot assume that ay algebraic structure exists o X so that
More informationEE / EEE SAMPLE STUDY MATERIAL. GATE, IES & PSUs Signal System. Electrical Engineering. Postal Correspondence Course
Sigal-EE Postal Correspodece Course 1 SAMPLE STUDY MATERIAL Electrical Egieerig EE / EEE Postal Correspodece Course GATE, IES & PSUs Sigal System Sigal-EE Postal Correspodece Course CONTENTS 1. SIGNAL
More information18th Bay Area Mathematical Olympiad. Problems and Solutions. February 23, 2016
18th Bay Area Mathematical Olympiad February 3, 016 Problems ad Solutios BAMO-8 ad BAMO-1 are each 5-questio essay-proof exams, for middle- ad high-school studets, respectively. The problems i each exam
More informationMatrices and vectors
Oe Matrices ad vectors This book takes for grated that readers have some previous kowledge of the calculus of real fuctios of oe real variable It would be helpful to also have some kowledge of liear algebra
More informationContext-free grammars and. Basics of string generation methods
Cotext-free grammars ad laguages Basics of strig geeratio methods What s so great about regular expressios? A regular expressio is a strig represetatio of a regular laguage This allows the storig a whole
More informationCSE 1400 Applied Discrete Mathematics Number Theory and Proofs
CSE 1400 Applied Discrete Mathematics Number Theory ad Proofs Departmet of Computer Scieces College of Egieerig Florida Tech Sprig 01 Problems for Number Theory Backgroud Number theory is the brach of
More informationSECTION 1.5 : SUMMATION NOTATION + WORK WITH SEQUENCES
SECTION 1.5 : SUMMATION NOTATION + WORK WITH SEQUENCES Read Sectio 1.5 (pages 5 9) Overview I Sectio 1.5 we lear to work with summatio otatio ad formulas. We will also itroduce a brief overview of sequeces,
More informationis also known as the general term of the sequence
Lesso : Sequeces ad Series Outlie Objectives: I ca determie whether a sequece has a patter. I ca determie whether a sequece ca be geeralized to fid a formula for the geeral term i the sequece. I ca determie
More informationChapter 0. Review of set theory. 0.1 Sets
Chapter 0 Review of set theory Set theory plays a cetral role i the theory of probability. Thus, we will ope this course with a quick review of those otios of set theory which will be used repeatedly.
More informationSequences A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence
Sequeces A sequece of umbers is a fuctio whose domai is the positive itegers. We ca see that the sequece 1, 1, 2, 2, 3, 3,... is a fuctio from the positive itegers whe we write the first sequece elemet
More informationMath F215: Induction April 7, 2013
Math F25: Iductio April 7, 203 Iductio is used to prove that a collectio of statemets P(k) depedig o k N are all true. A statemet is simply a mathematical phrase that must be either true or false. Here
More informationEssential Question How can you recognize an arithmetic sequence from its graph?
. Aalyzig Arithmetic Sequeces ad Series COMMON CORE Learig Stadards HSF-IF.A.3 HSF-BF.A. HSF-LE.A. Essetial Questio How ca you recogize a arithmetic sequece from its graph? I a arithmetic sequece, the
More informationLecture 14: Graph Entropy
15-859: Iformatio Theory ad Applicatios i TCS Sprig 2013 Lecture 14: Graph Etropy March 19, 2013 Lecturer: Mahdi Cheraghchi Scribe: Euiwoog Lee 1 Recap Bergma s boud o the permaet Shearer s Lemma Number
More informationComputability and computational complexity
Computability ad computatioal complexity Lecture 6: Relatios betwee complexity classes Io Petre Computer Sciece, Åbo Akademi Uiversity Fall 2015 http://users.abo.fi/ipetre/computability/ 21 May 2018 http://users.abo.fi/ipetre/computability/
More informationUC Berkeley CS 170: Efficient Algorithms and Intractable Problems Handout 17 Lecturer: David Wagner April 3, Notes 17 for CS 170
UC Berkeley CS 170: Efficiet Algorithms ad Itractable Problems Hadout 17 Lecturer: David Wager April 3, 2003 Notes 17 for CS 170 1 The Lempel-Ziv algorithm There is a sese i which the Huffma codig was
More informationStatistics 511 Additional Materials
Cofidece Itervals o mu Statistics 511 Additioal Materials This topic officially moves us from probability to statistics. We begi to discuss makig ifereces about the populatio. Oe way to differetiate probability
More informationDiscrete Mathematics for CS Spring 2005 Clancy/Wagner Notes 21. Some Important Distributions
CS 70 Discrete Mathematics for CS Sprig 2005 Clacy/Wager Notes 21 Some Importat Distributios Questio: A biased coi with Heads probability p is tossed repeatedly util the first Head appears. What is the
More informationMath 155 (Lecture 3)
Math 55 (Lecture 3) September 8, I this lecture, we ll cosider the aswer to oe of the most basic coutig problems i combiatorics Questio How may ways are there to choose a -elemet subset of the set {,,,
More informationLecture 2. The Lovász Local Lemma
Staford Uiversity Sprig 208 Math 233A: No-costructive methods i combiatorics Istructor: Ja Vodrák Lecture date: Jauary 0, 208 Origial scribe: Apoorva Khare Lecture 2. The Lovász Local Lemma 2. Itroductio
More informationThe Growth of Functions. Theoretical Supplement
The Growth of Fuctios Theoretical Supplemet The Triagle Iequality The triagle iequality is a algebraic tool that is ofte useful i maipulatig absolute values of fuctios. The triagle iequality says that
More informationRecursive Algorithms. Recurrences. Recursive Algorithms Analysis
Recursive Algorithms Recurreces Computer Sciece & Egieerig 35: Discrete Mathematics Christopher M Bourke cbourke@cseuledu A recursive algorithm is oe i which objects are defied i terms of other objects
More informationChapter 6 Infinite Series
Chapter 6 Ifiite Series I the previous chapter we cosidered itegrals which were improper i the sese that the iterval of itegratio was ubouded. I this chapter we are goig to discuss a topic which is somewhat
More informationChapter Vectors
Chapter 4. Vectors fter readig this chapter you should be able to:. defie a vector. add ad subtract vectors. fid liear combiatios of vectors ad their relatioship to a set of equatios 4. explai what it
More informationRoberto s Notes on Infinite Series Chapter 1: Sequences and series Section 3. Geometric series
Roberto s Notes o Ifiite Series Chapter 1: Sequeces ad series Sectio Geometric series What you eed to kow already: What a ifiite series is. The divergece test. What you ca le here: Everythig there is to
More informationUnit 6: Sequences and Series
AMHS Hoors Algebra 2 - Uit 6 Uit 6: Sequeces ad Series 26 Sequeces Defiitio: A sequece is a ordered list of umbers ad is formally defied as a fuctio whose domai is the set of positive itegers. It is commo
More informationFast Searching in Packed Strings. Philip Bille July 17, 2009
Fast Searchig i Packed Strigs Philip Bille phbi@imm.dtu.dk July 17, 2009 arxiv:0907.3135v1 [cs.ds] 17 Jul 2009 Abstract Give strigs P ad Q the (exact) strig matchig problem is to fid all positios of substrigs
More informationHere are some examples of algebras: F α = A(G). Also, if A, B A(G) then A, B F α. F α = A(G). In other words, A(G)
MATH 529 Probability Axioms Here we shall use the geeral axioms of a probability measure to derive several importat results ivolvig probabilities of uios ad itersectios. Some more advaced results will
More informationDiscrete-Time Systems, LTI Systems, and Discrete-Time Convolution
EEL5: Discrete-Time Sigals ad Systems. Itroductio I this set of otes, we begi our mathematical treatmet of discrete-time s. As show i Figure, a discrete-time operates or trasforms some iput sequece x [
More informationIn number theory we will generally be working with integers, though occasionally fractions and irrationals will come into play.
Number Theory Math 5840 otes. Sectio 1: Axioms. I umber theory we will geerally be workig with itegers, though occasioally fractios ad irratioals will come ito play. Notatio: Z deotes the set of all itegers
More informationThe Quark Puzzle A 3D printable model and/or paper printable puzzle that allows students to learn the laws of colour charge through inquiry.
The Quark Puzzle A 3D pritable model ad/or paper pritable puzzle that allows studets to lear the laws of colour charge through iquiry. It is available at this lik: https://zeodo.org/record/1252868#.w3ft-gzauk
More information2.4 Sequences, Sequences of Sets
72 CHAPTER 2. IMPORTANT PROPERTIES OF R 2.4 Sequeces, Sequeces of Sets 2.4.1 Sequeces Defiitio 2.4.1 (sequece Let S R. 1. A sequece i S is a fuctio f : K S where K = { N : 0 for some 0 N}. 2. For each
More informationPermutations & Combinations. Dr Patrick Chan. Multiplication / Addition Principle Inclusion-Exclusion Principle Permutation / Combination
Discrete Mathematic Chapter 3: C outig 3. The Basics of Coutig 3.3 Permutatios & Combiatios 3.5 Geeralized Permutatios & Combiatios 3.6 Geeratig Permutatios & Combiatios Dr Patrick Cha School of Computer
More informationProduct measures, Tonelli s and Fubini s theorems For use in MAT3400/4400, autumn 2014 Nadia S. Larsen. Version of 13 October 2014.
Product measures, Toelli s ad Fubii s theorems For use i MAT3400/4400, autum 2014 Nadia S. Larse Versio of 13 October 2014. 1. Costructio of the product measure The purpose of these otes is to preset the
More informationComputability and computational complexity
Computability ad computatioal complexity Lecture 12: O P vs NP Io Petre Computer Sciece, Åbo Akademi Uiversity Fall 2015 http://users.abo.fi/ipetre/computability/ December 9, 2015 http://users.abo.fi/ipetre/computability/
More informationChapter 9 - CD companion 1. A Generic Implementation; The Common-Merge Amplifier. 1 τ is. ω ch. τ io
Chapter 9 - CD compaio CHAPTER NINE CD-9.2 CD-9.2. Stages With Voltage ad Curret Gai A Geeric Implemetatio; The Commo-Merge Amplifier The advaced method preseted i the text for approximatig cutoff frequecies
More informationIt is always the case that unions, intersections, complements, and set differences are preserved by the inverse image of a function.
MATH 532 Measurable Fuctios Dr. Neal, WKU Throughout, let ( X, F, µ) be a measure space ad let (!, F, P ) deote the special case of a probability space. We shall ow begi to study real-valued fuctios defied
More information4.3 Growth Rates of Solutions to Recurrences
4.3. GROWTH RATES OF SOLUTIONS TO RECURRENCES 81 4.3 Growth Rates of Solutios to Recurreces 4.3.1 Divide ad Coquer Algorithms Oe of the most basic ad powerful algorithmic techiques is divide ad coquer.
More information