An automaton is a directed multi-graph where are the states, is the start state, is the accepting state, and that is, every node has exactly two outgoing edges, one labelled 0 and one labelled 1. The edges are also called transitions.
Consider the above picture of an automaton . consider feeding it a string . Now, read the string left to right, and follow the labelled transitions starting at q1.
q1, 0 we stay at q1
q1, 1 we go to q2
q2, 1 we go to q3
q3 is accepting state so we are done. the string is accepted by
Notice that only accepts strings that have two consecutive ones in them.
Language of an automaton
Let be a automaton.The set where is a binary string, (denoted ). or we say that is recognised by . or
Automaton Formal
An automaton is a 5-tuple . is a finite set of states. finite set of alphabet symbols the transition function. means that if you're in state and read alphabet character you go to state is the start state, is a finite (possible empty) set of accepting states.
A string is a finite sequence in . A language is a set of strings the automaton accepts. accepts string if
we start at the start state
inductively, for each
, the last state is one of the accepting states.
A language in general might just be finite strings of some alphabet. a language is regular iff (defined) there exists some automaton that accepts it/recognizes it as defined above.
regular operations
let be languages
union , concat , star so star is concatinating all possible sequences of strings in A of finite lengths. is countable infinite and contains the empty string, given that isn't the empty language or
Using the atomics: the set of alphabet , singleton subsets (written without braces) of , the empty language, the empty string.
So suppose.
which is all possible binary strings of finite length.
are all possible binary strings that end with 1.
are all possible binary strings that contain 11 which is from the picture at the top.
Finite automaton are equivalent to regular expressions!
if you build a regular expression out of the atomics and the three oprations : union, concat and star, The set that the regular expression is, is a set of strings, and there will be an automaton that accepts EXACTLY those set of strings!
Closure properties of regular languages
If are regular languages, then is a regular language. (if they are over the same set of alphabet, but that doesn't need to be it still holds)
is the automata that accepts a string if and only if or
Well why? our states are like a table of states from both automata.
suppose then by definition of , our start state is in the row of and is equal to and by definition of our new transition function , the characters of will at least be in the same row of states, as the states that it would traverse in . Our new definition accepts all states whose row state is accepted by . so gets accepted by as well.