Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Deterministic finite automaton
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Example== The following example is of a DFA {{mvar|M}}, with a binary alphabet, which requires that the input contains an even number of 0s. [[File:DFAexample.svg|right|thumb|upright=1.1|The [[state diagram]] for ''M'']] {{math|1=''M'' = (''Q'', Ξ£, ''Ξ΄'', ''q''<sub>0</sub>, ''F'')}} where *{{math|1=''Q'' = {''S''<sub>1</sub>, ''S''<sub>2</sub>}<nowiki/>}} *{{math|1=Ξ£ = {0, 1}<nowiki/>}} *{{math|1=''q''<sub>0</sub> = ''S''<sub>1</sub>}} *{{math|1=''F'' = {''S''<sub>1</sub>}<nowiki/>}} and *{{mvar|Ξ΄}} is defined by the following [[state transition table]]: :{| border="1" cellpadding="1" cellspacing="0" | || {{center|'''0'''}} || {{center|'''1'''}} |- |'''''S''<sub>1</sub>''' || ''S''<sub>2</sub> || ''S''<sub>1</sub> |- |'''''S''<sub>2</sub>''' || ''S''<sub>1</sub> || ''S''<sub>2</sub> |} The state {{math|''S''<sub>1</sub>}} represents that there has been an even number of 0s in the input so far, while {{math|''S''<sub>2</sub>}} signifies an odd number. A 1 in the input does not change the state of the automaton. When the input ends, the state will show whether the input contained an even number of 0s or not. If the input did contain an even number of 0s, {{mvar|M}} will finish in state {{math|''S''<sub>1</sub>}}, an accepting state, so the input string will be accepted. The language recognized by {{mvar|M}} is the [[regular language]] given by the [[regular expression]] <code>(1*) (0 (1*) 0 (1*))*</code>, where <code>*</code> is the [[Kleene star]], e.g., <code>1*</code> denotes any number (possibly zero) of consecutive ones.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)