1 / 8

MATH 224 – Discrete Mathematics

MATH 224 – Discrete Mathematics. Deterministic Finite Automata Finite State Machines. Set of States Q Start State q0  Q Accepting States qf  Q Alphabet  e.g, {0, 1} Transitions  (, qi)  qj. q1. q2. q3. q0. qf1. qf2. . qi. qj. MATH 224 – Discrete Mathematics.

keelty
Download Presentation

MATH 224 – Discrete Mathematics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MATH 224 – Discrete Mathematics Deterministic Finite AutomataFinite State Machines Set of StatesQ Start Stateq0  Q Accepting Statesqf Q Alphabet e.g, {0, 1} Transitions  (, qi)  qj q1 q2 q3 q0 qf1 qf2  qi qj

  2. MATH 224 – Discrete Mathematics DFA Represented by a Directed Graph Multitasking in an operating System Time slice expired Start Ready Queue Running Dequeued Finished with resource and ready to run Blocked waiting for a resource, e.g. data from a disk Blocked Waiting

  3. MATH 224 – Discrete Mathematics DFA for Multiples of 3 in binary 0 Start 0 q0 Example 1 46 remainder 1 string 1 0 1 1 1 0 States0 1 2 2 2 2 1 Example 2 51 remainder 0 string1 1 0 0 1 1 States 0 1 3 3 3 1 3 qf-3 1 1 1 1 q1 0 q2 0

  4. MATH 224 – Discrete Mathematics DFA to Recognize Floating Point 0 - 9 Start 0 - 9 . q0 q2 qf-0 +, – 0 - 9 0 - 9 e, E q5 q1 q3 +, – 0 - 9 q4 0 - 9 Qf-1 0 - 9

  5. MATH 224 – Discrete Mathematics Crossing the Bridge in Minimum Time1, 2, 5 and 10 minutes q6 5 &10 Start Only 2 of the final states are shown here, one of the two shortest and one of the next shortest. q0 2 &10 q5 1 & 2 2 & 5 1&10 What would the longest time be? 1 & 5 2 minutes q1 q4 q3 1 q2 2 5 minutes 3 minutes 1 19 minutes q8 q7 5 6 minutes q10 5 &10 qf17 q9 1 &10 q15 q11 q12 16 minutes 13 minutes 1 & 2 1 2 q16 17 minutes 1 & 2 q13 qf14 17 minutes 15 minutes

  6. MATH 224 – Discrete Mathematics Other DFAs Construct a DFA that recognizes legal identifier names in C++ using α to represent letters and δ to represent the digits 0 through 9. Construct a DFA to recognize even numbers in binary. Construct a DFA to recognize multiples of four in binary. Construct a DFA to recognize multiples of 5 in binary. Construct a DFA to recognize multiples of 5 in decimal.

  7. MATH 224 – Discrete Mathematics Representing a DFA in a Computer Program Probably the simplest way to represent a DFA in a program is to use a 2-dimensional array, where each column corresponds to a character in the alphabet and each row corresponds to a state. So for example here is the DFA that recognizes multiples of 3 in binary. qf-3

  8. MATH 224 – Discrete Mathematics 0 DFA for Multiples of 3 in binary Start 0 q0 0 qf-6 q3 1 1 1 1 1 q1 0 q2 0

More Related