Professional Documents
Culture Documents
Page 1 of 14
Ogunbanwo A. Simbo CSC 425
Ordinary state
Some Logic
A ∧ B Conjunction A ∨ B Disjunction A ⇒ B Implication
A iff B Equivalence ¬A Negation
Set
A Set is a collection of well-defined objects. R = {1, 2} S = {4, 3, 2}
Union: The union of R and S, R ∪ S, is the set of elements occurring in R or S (or
both). (x: ∈ R or x ∈ S). e.g. {1, 2} ∪ {4, 3, 2} = {1, 2, 3, 4}
Intersection: The intersection of R and S, R n S, is the set of elements occurring
in both R and S. (x: ∈ R and x ∈ S). e.g. {1, 2} n {4, 3, 2} = {2}
Set difference: R - S is the set of elements that occur in R but not in S. Note that
S may have elements not in R. These are ignored, e. g {1, 2, 3} - {2, 4} = {1, 3}.
Cartesian product of R and S is defined as R × S = {(x, y) : x ∈ R and y ∈ S} e.g.
{1, 2} ∪ {4, 3, 2} = {1, 2, 2, 3, 4}
Definitions:
Alphabet: An alphabet is a finite non empty set of symbols or letters denoted by
Σ. The elements of the alphabet are called letters. The choice of the alphabet
depends on the application in mind. Alphabet can be represented as a
characters or digits. The most common alphabet is binary alphabet 0 and 1.
Example 1: Σ1 = (a, b … z)
Σ2 = (0, 1)
Σ3 = (#, $, & …)
String: A string is a finite sequence of symbols that are chosen from a specific
finite set or alphabet, which is usually written next to one another and not
separated by comma. Therefore, a string over an alphabet is a finite sequence
of symbols from that alphabet, which is usually written next to one another and
not separated by commas.
Page 2 of 14
Ogunbanwo A. Simbo CSC 425
Kleene Star: Given an alphabet Σ, Σ* is defined as the set of all possible strings
over the alphabet Σ. The * denotes the Kleene star operator. Σꝏ to denote the
set of all infinite sequences over the alphabet Σ.
For example 3: if Σ = {0, 1}, the set of strings ({ε, 1, 00, 01, 10, 11, 000, 001,
010, 011, 100, 101, 110, 111, 0000, …}
Page 3 of 14
Ogunbanwo A. Simbo CSC 425
AUTOMATA THEORY
Automata theory is the study of abstract machines and computational problem
that can be solved using these machines. Automata Theory deals with
definitions and properties of different types of computation models. For
example model like Finite Automata are used in text processing, compilers, and
hardware design. Context-Free Grammars are used to define programming
languages and in Artificial Intelligence while Turing Machines is a simple abstract
model of a “real” computer, such as your PC at home. Automaton is a singular
form of automata.
Automata
An automaton is an abstract model of a digital computer. As such, every
automaton includes some essential features. It has a mechanism for reading
input. It will be assumed that the input is a string over a given alphabet, written
on an input file, which the automaton can read but not change. The input file is
divided into cells, each of which can hold one symbol. The input mechanism can
read the input file from left to right, one symbol at a time. The input mechanism
can also detect the end of the input string (by sensing an end-of-file condition).
The automaton can produce output of some form. It may have a temporary
storage device, consisting of an unlimited number of cells, each capable of
holding a single symbol from an alphabet (not necessarily the same one as the
input alphabet). The automaton can read and change the contents of the
storage cells. Finally, the automaton has a control unit, which can be in any one
of a finite number of internal states, and which can change state in some
defined manner.
Page 4 of 14
Ogunbanwo A. Simbo CSC 425
∂ 0 1
q1 q1 q2
q2 q1 q2
Page 5 of 14
Ogunbanwo A. Simbo CSC 425
The figure below represents the behaviour of the machine for all possible
sequences of coins. State q5 is represented by two circles, because it is a special
state: As soon as the machine reaches this state, the gate opens.
Page 6 of 14
Ogunbanwo A. Simbo CSC 425
Observe that the machine (or computer) only has to remember which state it is
in at any given time. Thus, it needs only a very small amount of memory: It has
to be able to distinguish between any one of six possible cases and, therefore, it
only needs a memory of [log 6] = 3 bits.
Types of Automaton
Deterministic Automata
Non-deterministic Automata
Deterministic Automata:
A deterministic automaton is one in which each move (transition from one state to
another) is unequally determined by the current configuration. If the internal state,
input and contents of the storage are known, it is possible to predict the future
behaviour of the automaton. This is said to be deterministic automata otherwise it is
nondeterministic automata. An automaton whose output response is “yes” or “No” is
called an “Acceptor”.
Page 7 of 14
Ogunbanwo A. Simbo CSC 425
For example: if ∂ (q0, a) = q1. This indicated that if the DFA is in state q0 and the current
input symbol is a, the DFA will go into state q1
Example 1.
Solution
Example 2
Obtain the state table diagram and state diagram (DFA Schematic) of the finite state
automata M = (Q, ∑, ∂, q0, F)
Page 8 of 14
Ogunbanwo A. Simbo CSC 425
Example 3
Page 9 of 14
Ogunbanwo A. Simbo CSC 425
Assignment
1 Design a DFA, M which accepts the language L(M) = {w Є (a, b )* : w does not contain
Page 10 of 14
Ogunbanwo A. Simbo CSC 425
Page 11 of 14
Ogunbanwo A. Simbo CSC 425
There are three major differences between NFA definition and the definition of a DFA.
In a nondeterministic accepter, the range of transition (∂) is in the powerset 2 Q
so that its value is not a single element of Q but a subset of it.
NFA allows λ as the second argument of ∂. This means that the NFA can make
a transition without consuming an input symbol. Although we still assume that
the input mechanism can only travel to the right, it is possible that it is stationary
on some moves.
In an NFA, the set ∂ (qi,a) may be empty, meaning that there is no transition
defined for the specific situation.
Like DFA's, nondeterministic accepters can be represented by transition graphs. The
vertices are determined by Q, while an edge (qi, qj) with label a is in the graph if and
only if ∂ (qi, a) contains qj. Note that since a may be the empty string, there can be
some edges labelled λ.
A string is accepted by an nfa if there is some sequence of possible moves that will
put the machine in a final state at the end of the string. A string is rejected (that is, not
accepted) only if there is no possible sequence of moves by which a final state can be
reached.
Page 12 of 14
Ogunbanwo A. Simbo CSC 425
Example 1: Determine an NFA accepting all strings over {0, 1} which end in 1 but does
not cointain the substring 00.
Solution:
Example 2
Sketch the NFA state diagram for
Solution:
Page 13 of 14
Ogunbanwo A. Simbo CSC 425
Assignment 3
Given L is the language accepted by NFA in figure below
Page 14 of 14