0% found this document useful (0 votes)
77 views34 pages

Introduction To Theory of Computation: Md. Rafsan Jani Assistant Professor Department of CSE Jahangirnagar University

This document provides an overview of the CSE-309 Theory of Computation course. It introduces fundamental concepts like computational models, alphabets and strings, languages, and string operations. The course will cover three principal models of computation - finite automata, stack automata, and Turing machines - to understand what can and cannot be computed. Key concepts like regular languages, context-free languages, and computable languages will be explored.

Uploaded by

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

Introduction To Theory of Computation: Md. Rafsan Jani Assistant Professor Department of CSE Jahangirnagar University

This document provides an overview of the CSE-309 Theory of Computation course. It introduces fundamental concepts like computational models, alphabets and strings, languages, and string operations. The course will cover three principal models of computation - finite automata, stack automata, and Turing machines - to understand what can and cannot be computed. Key concepts like regular languages, context-free languages, and computable languages will be explored.

Uploaded by

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

CSE-309

Theory of Computation

Lecture 01

Introduction to Theory of Computation

Md. Rafsan Jani


Assistant Professor
Department of CSE
Jahangirnagar University
Course Overview
Objective : To learn about to how to solve computational
problems using necessary theories and models.

Readings : Lecture materials and reference book.


• Marks Distribution(20+30)
o Tutorials-15
o Attadance-5
o Final-30
• Tutorials: There will be 3 tutorials
• Final : Comprehensive closed-book
Reference Books

1. Introduction to the Theory of Computation


- By Michael Sipser

2. Introduction to Automata Theory, Languages, and


Computation
- By Jeffrey Ullman and John Hopcroft
Introduction to Theory of Computation
In theoretical computer science and mathematics, the theory of
computation is the branch that deals with how efficiently problems
can be solved on a model of computation, using an algorithm.

The field is divided into three major branches:


• automata theory and languages,
• computability theory, and
• computational complexity theory,

The question we will try to answer in this course is:


• “What can be computed?
• What Cannot be computed?
• and where is the line between the two?”
Computational Model
A Computational Model is a mathematical object (Defined
on paper) that enables us to reason about computation and
to study the properties and limitations of computing.

We will deal with Three principal computational models in


increasing order of Computational Power.
Computational Model
We will deal with three principal models of computations:

1. Finite Automaton (in short FA).


recognizes Regular Languages .

2. Stack Automaton.
recognizes Context Free Languages .

3. Turing Machines (in short TM).


recognizes Computable Languages .
Alphabets and Strings
An alphabet is a set of symbols
Example Alphabet:    a, b

A string is a sequence of symbols from the alphabet

Example Strings a u  ab
ab v  bbbaaa
abba w  abba

aaabbbaaba b
Decimal numbers alphabet   { 0,1,2,  ,9}

102345 567463386

Binary numbers alphabet   { 0,1}


100010001 101101111
Unary numbers alphabet   {1}

Unary number: 1 11 111 1111 11111


Decimal number: 1 2 3 4 5
String Operations

w  a1a2  an abba
v  b1b2 bm bbbaaa

Concatenation

wv  a1a2  anb1b2 bm abbabbbaaa


String Operations

w  a1a2  an ababaaabbb

Reverse

R
w  an  a2a1 bbbaaababa
String Length
w  a1a2  an
Length: w n

Examples: abba  4
aa  2
a 1
Length of Concatenation

uv  u  v

Example: u  aab, u  3
v  abaab, v  5

uv  aababaab  8
uv  u  v  3  5  8
Empty String
A string with no letters is denoted:  or 

Observations:  0

w  w  w

abba  abba  abba  abba


Substring
Substring of string:
a subsequence of consecutive characters

String Substring

abbab ab
abbab abba
abbab b
abbab bbab
Prefix and Suffix
abbab
Prefixes Suffixes
 abbab w  uv
a bbab
prefix
ab bab
suffix
abb ab
abba b
abbab 
Another Operation
n
w  ww w
 
n

Example:  abba  2
 abbaabba

Definition:
w 
0

 abba  0

The * Operation
 * : the set of all possible strings from alphabet 

   a, b
*   , a, b, aa, ab, ba, bb, aaa, aab,
The + Operation
 : 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,
Language: a set of strings

String: a sequence of symbols from some alphabet

Example:
Strings: cat, dog, house
Language: {cat, dog, house}

Alphabet:    a , b, c , , z 
Languages are used to describe computation problems:

PRIMES  {2,3,5,7,11,13,17, }

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

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


Languages
A language over alphabet  is any subset of  *

Examples:
   a, b
*    , a, b, aa, ab, ba, bb, aaa, 

Language:  
Language:  a, aa, aab
Language: { , abba, baba, aa, ab, aaaaaa}
More Language Examples

Alphabet   {a , b }
n n
An infinite language L  {a b : n  0}


ab
L abb  L
aabb
aaaaabbbbb
Prime numbers

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

Language:

PRIMES  {x : x   and x is prime}


*

PRIMES  {2,3,5,7,11,13,17, }
Even and odd numbers

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

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


*

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

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


*

ODD  {1,3,5,7, }
Unary Addition

Alphabet:   {1,,  }
Language:

ADDITION  {x  y  z : x  1n , y  1m , z  1k ,
nm k}

11  111  11111  ADDITION


111  111  111  ADDITION
Squares

Alphabet:   {1, # }
Language:

SQUARES  {x # y : x  1 , y  1 , m  n }
n m 2

11#1111  SQUARES
111 #1111  SQUARES
Note that:

Sets   { }  { }
Set size {}    0

Set size { }  1

String length  0
Operations on Languages
The usual set operations

 a, ab, aaaa  bb, ab  {a, ab, bb, aaaa}


 a, ab, aaaa  bb, ab  {ab}
 a, ab, aaaa   bb, ab   a, aaaa
Complement: L   * L
 a, ba   , b, aa, ab, bb, aaa,
Reverse

R R
Definition: L  {w : w  L}

Examples:  ab, aab, baba   ba, baa, abab


R

n n
L  {a b : n  0}

R n n
L  {b a : n  0}
Concatenation

Definition: L1L2   xy : x  L1, y  L2 

Example:  a, ab, ba b, aa

  ab, aaa, abb, abaa, bab, baaa


Another Operation
Definition: n
L  LL L
n

 a, b   a, b a, b a, b 
3

 aaa, aab, aba, abb, baa, bab, bba, bbb


Special case:
L0    
 a, bba, aaa 0
  
Star-Closure (Kleene *)
All strings that can be constructed from L

Definition: 0 1 2
L*  L  L  L 
Example:
 , 
a, bb, 
 
 a, bb *   
 aa , abb, bba , bbbb, 
aaa, aabb, abba, abbbb,
Positive Closure(Kleene +)

Definition: L  L  L 
 1 2

Same with L* but without the 

a, bb, 
  
 a, bb  aa, abb, bba, bbbb, 
aaa, aabb, abba, abbbb,
 

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy