0% found this document useful (0 votes)
139 views26 pages

Finite Automata Theory and Formal Languages: Lec01: Introduction

This document provides an introduction to the course "Finite Automata Theory and Formal Languages" which covers theory of automata, context-free languages, and Turing machines. It outlines the textbooks and reference books used, the grading policy, course objectives which are to understand the relationships between formal languages, grammars, and automata, and provides an overview of finite automata, pushdown automata, and Turing machines. The course aims to help students understand what can and cannot be computed with theoretical computer models.

Uploaded by

Safwan Hassan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
139 views26 pages

Finite Automata Theory and Formal Languages: Lec01: Introduction

This document provides an introduction to the course "Finite Automata Theory and Formal Languages" which covers theory of automata, context-free languages, and Turing machines. It outlines the textbooks and reference books used, the grading policy, course objectives which are to understand the relationships between formal languages, grammars, and automata, and provides an overview of finite automata, pushdown automata, and Turing machines. The course aims to help students understand what can and cannot be computed with theoretical computer models.

Uploaded by

Safwan Hassan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPSX, PDF, TXT or read online on Scribd
You are on page 1/ 26

Finite Automata Theory

and Formal Languages

Lec01: Introduction
Humera Azam | Introduction 1
Textbook:
• Introduction To Computer Theory
Daniel I. A. Cohen

 Introduction to Languages and the Theory of Computation


John C. Martin

 Read the textbook!


 Key for learning and obtaining a good grade
Reference Books

1. John.E. Hopcroft, R. Motwani, and J.D. Ullman


Introduction to Automata Theory, Language and Computation
Second Edition Pearson Education Asia, 2001.

2. K.L.P. Mishra, N. Chandrasekaran


Theory of Computer Science (Automata, Languages & Computation)
Prentice Hall of India, 1999.
Grading Policy
Quizzes 10%
Midterm Exam 25%
Final Exam 45%
Assignments 20%
Overview

Welcome to BSSE-413
I. Theory of Automata
II. Theory of Context-Free Languages
III. Theory of Turing Machines
Some Important Questions to Ask
Basic questions
What do theoretical models of a computer look like?
 What can we compute and what can’t we compute
with today’s computers as well as computers of the
future?
 Why?
 We study some precise answers.
 In particular, we formulate precise questions with
mathematical statements and rigorous proofs.
Course Objectives
 The major objective of this course is to introduce the student to the concepts of
theory of computation in computer science. The student should acquire insights
into the relationship among formal languages, formal grammars, and automata.
 Upon successful completion of this course, students will be able to:
 Apply a number of proof techniques to theorems in language design.
 Develop a clear understanding of un-decidability.
 Understand the equivalence between Nondeterministic Finite State
Automata and Deterministic Finite State Automata.
 Understand the equivalence between Context-Free Grammars and
Nondeterministic Pushdown Automata.
 Appreciate the power of the Turing Machine, as an abstract automaton, that
describes computation, effectively and efficiently .
finite automata Devices with a finite amount of memory.
Used to model “small” computers.

push-down Devices with infinite memory that can be


automata accessed in a restricted way.
Used to model parsers, etc.

Turing Machines Devices with infinite memory.


Used to model any computer.

time-bounded Infinite memory, but bounded running time.


Turing Machines Used to model any computer program that
runs in a “reasonable” amount of time.
History
• Cantor (1845-1918) theory of sets
• Hilbert (1862-1943) methodology for finding proofs
• Gödel (1906-1978) Incompleteness theorem
• Church, Kleene, Post, Markov, von Neumann, Turing Which
statements have proofs? building blocks of mathematical
algorithms
• Turing (1912-1954) Universal machine and its limitations
• McCulloch, Pitts Neural nets (similar but with different
limitations)
• Chomsky mathematical models for the description of
languages
Introduction
p.434: I. Automata II. Formal Languages III. Turing Machines

Language Corresponding Nondeter- Language What Can Be Examples of


Defined by Accepting minism= Closed Decided? Applications
Machine Determinis Under
m
I. Regular Finite Yes Union,produc Equivalence, Text editors,
expression automaton, tKleene star, emptiness, sequential
transition graph intersection, finiteness, circuits,
complement
membership verification
II. Context- Pushdown No Union, Emptiness, Parsing,
free automaton product, finiteness, compilers
grammar Kleene star membership

Type 0 Turing machine, Yes Union, Not much Computers


III.
grammar Post machine, product,
Pushdown Kleene star
automaton

10
Automata Theory :

Three Basic Concepts:


• Language,
• Grammar and
• Automata
These three concepts provide the foundation core of
the course “Automata Theory”
Mathematical models of
computers: Languages
Language

Natural Computer Mathematical


Languages Languages Languages

A general definition of languages encompass all of these various types languages

A language is a set of strings over an alphabet.


Alphabets
 A finite non empty set S of symbols is called alphabet,
denoted Σ.
 A common way to talk about words, number, pairs of words,
etc. is by representing them as strings
 To define strings, we start with an alphabet
Examples
S = {a, b, c, d, …, z}: the set of letters in English
S1 = {0, 1, …, 9}: the set of (base 10) digits
S2 = {a, b, …, z, #}: the set of letters plus the special symbol #
S3 = {(, )}: the set of open and closed brackets
Strings
From the individual symbols of an alphabet we construct
string, which are finite in nature. or
A string over alphabet S is a finite sequence of symbols in S.

 The empty string will be denoted by e |Λ


 The alphabet is always finite. The set of string/ words can be infinite.
Examples

abfbz is a string over S = {a, b, c, d, …, z}


9021 is a string over S1 = {0, 1, …, 9}
ab#bc is a string over S2 = {a, b, …, z, #}
))()(() is a string over S3 = {(, )}
Strings
• Example: Let S ={ a, b, c} be the set of
alphabet containing three symbols a ,b, and c.
Then
• aaabba and ababac are two strings on S.
Languages
Languages can be used to describe problems with
“yes/no” answers, for example:
L1 = The set of all strings over S that contain
the substring “fool”
L2 = The set of all strings over S1 that are divisible by 7
= {7, 14, 21, …}
L3 = The set of all strings over S2 of the form s#s where s is
any string over {a, b, …, z}
L4 = The set of all strings over S3where every ( can be
matched with a subsequent )
Example
• Let us consider some simple examples of languages:
S={x}
• We can define a Language:
L1: Any non empty string of alphabet character is a word.
L1 : { x, xx, xxx, xxxx, ……….}

Alternate form:
L1 : = { xn for n = 1, 2, 3, ………………}
String Operations:
Concatenation: The concatenation of two strings is the
string resulting from putting them together from left to
right.

» If u = one and v = two then u · v = onetwo


and v · u = twoone

» Dot is usually omitted; just write uv for u · v.


Laws:
u · (v · w) = (u · v) · w
u· ε=u
ε·u=u
|u · v| = |u| + |v|
Length/Size of String:
»The length of a string is the number of symbols that it contains
(repetitions allowed).
» Absolute values are used to denote length.
» The length of a string w is denoted |w|.
» For example |00100| = 5
|aab| = 3
|ᴧ|=0
length(xxxxx) = 5
length(1025)=4
length(Λ)=0
reverse

• reverse(xxx)=xxx
• reverse(157)=751

PALINDROME:
• Σ={a, b}
• PALINDROME:={Λ and x|reverse(x) = x}
The + Operation:(Positive Closure)

 : or S+ the set of all possible strings from alphabet  except 
   a, b
*    , a, b, aa, ab, ba, bb, aaa, aab,

   * 

   a, b, aa, ab, ba, bb, aaa, aab,
Even and odd numbers

Alphabet
  { 0,1,2,  ,9}
Languages:

EVEN  {x : x   and x is even}


*

EVEN  { 0,2,4,6, }

ODD  {x : x   and x is odd}


*

ODD  {1,3,5,7, }
The * Operation(Kleene Closure)
Given an alphabet S , the closure of S (or Kleene star), denoted S *, is the language
containing all words made up of finite sequences of letters from S , including the
empty string S .

 * : the set of all possible strings from alphabet


   a, b
*    , a, b, aa, ab, ba, bb, aaa, aab,
SUMMARY
Automata
 Automata is Greek letters .Automata is a word formulated from
automation, which means machine designing or replacing human
beings with machines.

 Every machine design requires some hardware part and some


software part.

 A machine could be a finite state machine ,a Turing Machine, a


pushdown automata, or any other restricted version of a Turing
machine.
EXERCISE: Due on 17th March, 2021
1. Consider the language S*, where S = {a, b}. How many words does this language
have of length 2? of length 3? Of length n?
2. Consider the language S*, where S = {aa, b}. How many words does this language
have of length 4? of length 5? Of length 6? What can be said in general?
3. Consider the language S*, where S = {ab, ba}. Write out all the words in S* that
have seven or fewer letters. Can any word in this language contain the substrings
aaa or bbb?
4. Consider the language S*, where S = {a ab bal. Is the string (abbba) a word in this
language? Write out all the words in this language with seven or fewer letters.
What is another way in which to describe the words in this language? Be careful,
this is not simply the language of all words without bbb.
5. Consider the language S*, where S = {aa aba baa}. Show that the words aabaa,
baaabaaa, and baaaaababaaaaa re all in this language. Can any word in this
language be interpreted as a string of elements from S in two different ways? Can
any word in this language have an odd total number of a's?
6. Let S = {a, bb, bab, abaab}. Is abbabaabab in S*? Is abaabbabbaabb? Does any
word in S* have an odd total number of b's?

You might also like