Finite Automata, Regular Expressions

Support/Figures/Pasted image 20250608141556.png

Automaton

An automaton M is a directed multi-graph GM where V(GM)={q1,q2,qn} are the states, q1 is the start state, qn is the accepting state, and Adj+(qi)={qj0,qk1} 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 M1. consider feeding it a string ’0110’. 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 ’0110’ is accepted by M1
Notice that M1 only accepts strings that have two consecutive ones in them.

Language of an automaton

Let M be a automaton.The set A={wBIN:w is accepted by M} where w is a binary string, (denoted BIN). or we say that A is recognised by M. or A=L(M1)

Automaton Formal

An automaton M is a 5-tuple (Q,Σ,δ,q0,F).
Q is a finite set of states.
Σ finite set of alphabet symbols
δ:Q×ΣQ the transition function. δ(q,a)=q means that if you're in state q and read alphabet character a you go to state q
q0 is the start state, FQ 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.
M accepts string w=<wi>n if

  • r0=q0 we start at the start state
  • inductively, ri=δ(ri1,wi) for each i
  • rnF, the last state is one of the accepting states.

A language L in general might just be finite strings of some alphabet. a language L is regular iff (defined) there exists some automaton M that accepts it/recognizes it as defined above.

regular operations

let A,B be languages

Using the atomics: the set of alphabet Σ, singleton subsets (written without braces) of Σ, the empty language, e the empty string.

So Σ={0,1} suppose.

(01)=Σ which is all possible binary strings of finite length.

Σ1 are all possible binary strings that end with 1.

Σ11Σ are all possible binary strings that contain 11 which is L(M1) 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 A1,A2 are regular languages, then A1A2 is a regular language. (if they are over the same set of alphabet, but that doesn't need to be it still holds)

proof: Suppose M1=(Q,Σ,q0,δ,F) and M2=(P,Σ,p0,γ,E)
L(M1)=A1, L(M2)=A2.

Build $$M = (Q \times P, \Sigma, (q_{0} \times p_{0}), \Delta((q_{i},p_{j}),a) := (\delta(q_{i},a), \gamma(p_{j},a)), \mathbb F := (F\times P) \cup (E \times Q)$$

M is the automata that accepts a string w if and only if wA1 or wA2

Well why? our states are like a table of states from both automata.
suppose wA1 then by definition of M, our start state is in the row of q0 and is equal to (q0,p0) and by definition of our new transition function Δ, the characters of w will at least be in the same row of states, as the states that it would traverse in M1. Our new definition accepts all states whose row state is accepted by M1. so w gets accepted by M as well.

Equivalently for wA2.