Chapter 1 Preliminaries
Chapter 1 Preliminaries
Chapter 1 Preliminaries
Set operations
Union:
The union of two set has elements, the elements of one of the two sets and possibly both. Union is
denoted by /+
Intersection:
The intersection of two sets is the collection of all elements of the two sets which are common and is
denoted by .
Differences:
The difference of two sets A and B, denoted by A-B, is the set of all elements that are in the set A but not
in the set B.
1
A sequence of objects is a list of objects in some order. For example, the sequence 7,4,17 would be
written as (7,4,17).In set the order does not matter but in sequence it does. Also, repetition is not
permitted in a set but is allowed in a sequence. Like set, sequence may be finite or infinite.
A binary relation on two sets A and B is a subset of A×B. for example, if A={1,3,9}, B={x,y}, then
{(1,x),(3,y),(9,x)} is a binary relation on 2- sets. Binary relations on K-sets A1,A2,……..Ak can be
similarly defined.
A function is an object that setup an input- output relationship i.e. a function takes an input and produces
the required output. For a function f , with input x, the output y, we write f(x)=y. We also say that f maps
x to y.
R is transitive i..e. for every x,y, and z, (x,y) єR and (y,z) єR imples (x,z) єR.
Closures
Closures is an important relationship among sets and is a general tool for dealing with sets and
relationship of many kinds. Let R be a binary relation on a set A. Then the reflexive closure of R is a
relation R’ such that :
2. R’ R.
Method of proofs:
Mathematical Induction
i. 0єA
ii. For each natural number n, if {0,1,2,3,…….n}єA. Then A=N. In particular, induction is used
to prove assertions of the form “ for all nєN, the property is valid”. i.e.
In the basis step, one has to show that P(0) is true. i.e. the property is true for 0.
2
Another form of proof by induction over natural numbers is called strong induction. Suppose we want to
prove that P(n) is true for all n≥t. Then in the induction step, we assume that P(j) is true for all j, t≤j≤k.
Then using this, we prove P(k). in ordinary induction in the induction step, we assume P(k-1) to prove
P(k). There are some instances, where the result can be proved easily using strong induction. In some
cases, it will not be possible to use weak induction and one use strong induction.
Computation:
If it involves a computer, a program running on a computer and numbers going in and out then
computation is likely happening.
Theory of computation:
Computability Theory: -
- What can be computed?
-Are there problems that no program can solve?
Complexity Theory: -
Automata Theory: -
- Study of abstract machine and their properties, providing a mathematical notion of “computer”
- Automata are abstract mathematical models of machines that perform computations on an input by
moving through a series of states or configurations. If the computation of an automaton reaches an
accepting configuration it accepts that input.
Study of Automata
- For software designing and checking behavior of digital circuits.
- For designing software for checking large body of text as a collection of web pages, to find
occurrence of words, phrases, patterns (i.e. pattern recognition, string matching, …)
- Designing “lexical analyzer” of a compiler, that breaks input text into logical units called “tokens
Abstract Model
3
processor. E.g. an abstract machine that models a banking system can have operations like “deposit”,
“withdraw”, “transfer”, etc.
Brief History:
Before 1930’s, no any computer were there and Alen Turing introduced an abstract machine that
had all the capabilities of today’s computers. This conclusion applies to today’s real machines.
Later in 1940’s and 1950’s, simple kinds of machines called finite automata were introduced by
a number of researchers.
In late 1950’s the linguist N. Chomsky begun the study of formal grammar which are closely
related to abstract automata.
In 1969 S. Cook extended Turing’s study of what could and what couldn’t be computed and
classified the problem as:
-Decidable
-Tractable/intractable
The basic terms that pervade the theory of automata include “alphabets”, “strings”, “languages”,
etc.
Alphabet is a finite non-empty set of symbols. The symbols can be the letters such as {a, b, c},
bits {0, 1}, digits {0, 1, 2, 3… 9}. Common characters like $, #, etc.
String is a finite sequence of symbols taken from some alphabet. E.g. 0110 is a string from
binary alphabet, “automata” is a string over alphabet {a, b, c … z}.
Empty String: -
It is a string with zero occurrences of symbols. It is denoted by ‘ε’ (epsilon).
Length of String
4
have for every string s, length (s) ≥ 0.
| ε | = 0 as empty string have no symbols.
| 0110 | = 4
Power of alphabet
The set of all strings of certain length k from an alphabet is the kth power of that alphabet.
i.e. Σk = {w / |w| = k}
If Σ = {0, 1} then,
Σ0 = {ε}
Σ1 = {0, 1}
Σ2 = {00, 01, 10, 11}
Σ3 = {000, 001, 010, 011, 100, 101, 110, 111}
Kleen Closure
The set of all the strings over an alphabet Σ is called kleen closure of Σ & is denoted by
Σ*. Thus, kleen closure is set of all the strings over alphabet Σ with length 0 or more.
Σ* = Σ0 Σ1 Σ2 Σ3 ……………
E.g. A = {0}
A* = {0n/ n = 0, 1, 2, …}.
Positive Closure: -
The set of all the strings over an alphabet Σ, except the empty string is called positive closure and
is denoted by Σ+.
Σ+ = Σ1 Σ2 Σ3 ……………
Language:
A language L over an alphabet Σ is subset of all the strings that can be formed out of Σ; i.e. a
language is subset of kleen closure over an alphabet Σ; L Σ*. (Set of strings chosen from Σ*
defines language). For example;
Set of all strings over Σ = {0, 1} with equal number of 0’s & 1’s.
L = {ε, 01, 0011, 000111, ………}
φ is an empty language & is a language over any alphabet.
{ε} is a language consisting of only empty string.
Set of binary numbers whose value is a prime:
L = {10, 11, 101, 111, 1011, ……}
Concatenation of Strings
5
Let x & y be strings then xy denotes concatenation of x & y, i.e. the string formed by
making a copy of x & following it by a copy of y.
For example;
x = 000
y = 111
xy = 000111 &
yx = 111000
Suffix of a string
Prefix of a string
Substring
Problem
6
Exercises:
1. Let A be a set with n distinct elements. How many different binary relations on A are
there?
a. ∑1, ∑ 2, ∑3.
Readings: Plz, read the chapter 1 sections 1.1, 1.1.3, 1.5 of Text book. And solve some
numerical example given in Text book.