SlideShare ist ein Scribd-Unternehmen logo
1 von 9
Downloaden Sie, um offline zu lesen
1
Chapter one
Introduction to theory of computation(ToC)
Chapter programme
ToC
Mathematical introductions
Basic ideas and terminologies of formal langue and
automata theory
automata
2
Introduction to the theory of computation
The Theory of Computation, which tries to answer the Following questions:
 What are the mathematical properties of computer hardware and software?
 What is a computation and what is an algorithm? Can we give rigorous
mathematical definitions of these notions?
 What are the limitations of computers? Can “everything” be computed?
Purpose of the Theory of Computation: Develop formal mathematical models of
computation that reflect real-world computers.
Nowadays, the Theory of Computation can be divided into the following three areas:
Complexity Theory, Computability Theory, and Automata Theory.
Mathematical preliminaries
A set is an unordered collection of different elements.
 A set of all the planets in the solar system
 A set of all the states in India
 A set of all the lowercase letters of the alphabet
 N − the set of all natural numbers = {1, 2, 3, 4, .....}
 Z − the set of all integers = {....., −3, −2, −1, 0, 1, 2, 3, .....}
 Z+ − the set of all positive integers
 Q − the set of all rational numbers
 R − the set of all real numbers
 W − the set of all whole numbers
Sets can be represented in two ways −
 Roster or Tabular Form
 Set Builder Notation
3
Set Builder Notation
The set is represented by listing all the elements comprising it. The elements are enclosed
within braces and separated by commas. Example :Set of vowels in English alphabet, A
= {a,e,i,o,u}
Roster or Tabular Form
If we are given a set A such that x is in A iff x has property P, then we write A = {x | x
has property P}A = { x : p(x)}. Example: Thus, P = {x | x is a prime number} is the
set of prime numbers. Similarly, if we want to only look at prime numbers of the form
n2
+1 we could write {x ∈ P | there exists a natural number n, such that x = n2 + 1.}
A more compact way of denoting this set is {x ∈ P | (∃n ∈ N) ∋ (x = n2 + 1)} or even
simply {x ∈ P | (∃n ∈ N)(x = n2 + 1)}.
Example − The set {a,e,i,o,u} is written as − A = { x : x is a vowel in English alphabet}.
Cardinality of a set S, denoted by |S|, is the number of elements of the set. If a set has an
infinite number of elements, its cardinality is ∞.
Example − |{1, 4, 3, 5}| = 4, |{1, 2, 3, 4, 5,…}| = ∞
Sets can be classified into many types. Some of which are finite, infinite, subset,
universal, proper, etc. A set which contains a definite number of elements is called a
finite set. Example − S = {x | x  N and 70 > x > 50}. A set which contains infinite
number of elements is called an infinite set. Example − S = {x | x  N and x > 10}
An empty set contains no elements. It is denoted by . As the n umber of elements in an
empty set is finite, empty set is a finite set. The cardinality of empty set or null set is zero.
If two sets contain the same elements they are said to be equal.
Example − If A = {1, 2, 6} and B = {6, 1, 2}, they are equal as every element of set A is
an element of set B and every element of set B is an element of set A.
If the cardinalities of two sets are same, they are called equivalent sets.
Example − If A = {1, 2, 6} and B = {16, 17, 22}, they are equivalent as cardinality of A
is equal to the cardinality of B. i.e. |A| = |B| = 3
4
If two sets C and D are disjoint sets as they do not have even one element in common.
The intersection of any two distinct sets is empty.
A relation associates elements of one set called the domain, with elements of another set
called the co domain (both sets are non-empty set) example: One set: set of students.
Another set: set of subjects.Functions are especial relations.
A graph is a pictorial representation of a set of objects where some pairs of objects are
connected by links. The interconnected objects are represented by points termed as
vertices, and the links that connect the vertices are called edges.
Formally Definition − A graph (denoted as G = (V, E)) consists of a non-empty set of
vertices or nodes V and a set of edges E.
Example − Let us consider, a Graph is G = (V, E) where V = {a, b, c, d} and E = {{a, b},
{a, c}, {b, c},{c, d}}
Take a look at the following graph –
a b
c d e
In the above graph,
V = {a, b, c, d, e}
E = {ab, ac, bd, cd, de}
Tree
Tree is a special form of graph having no loops, no circuits and no self-loops. A
connected acyclic graph is called a tree. In other words, a connected graph with no cycles
is called a tree. The edges of a tree are known as branches. Elements of trees are called
their nodes. The nodes without child nodes are called leaf nodes.
5
Basic concepts of automata and Language Theory
Formal language theory, the discipline which studies formal grammars and languages,
is a branch of applied mathematics computer science. Its applications are found in
theoretical computer science, theoretical linguistics, formal semantics, mathematical
logic, and other areas.
A formal grammar (sometimes simply called a grammar) is a set of rules for forming
strings in a formal language. The rules describe how to form strings from the language's
alphabet that are valid according to the language's syntax. A grammar does not describe
the meaning of the strings or what can be done with them in whatever context – only their
Form, i.e. their internal structural patterns.
An alphabet is any finite, non-empty set of symbols, usually denoted by the symbol ∑
(sigma) and write Σ = {a1, . . . , ak}. The ai are called the symbols of the alphabet.
Examples:
Binary: ∑ = {0,1}
All lower case letters: ∑ = {a,b,c,..z}
Alphanumeric: ∑ = {a-z, A-Z, 0-9}
A string (sometimes a word) is a finite sequence of symbols chosen from ∑. Length of a
string w, denoted by “|w|”, is equal to the number of (non- ) characters in the string(or
positions). The empty string, denoted by  (or “epsilon”), is the string having length zero.
For example, if the alphabet  is equal to {0, 1}, then 10, 1000, 0, 101, and  are strings
over, having lengths 2, 4, 1, 3, and 0, respectively.
E.g., x = 010100 |x| = 6
x = 01  0  1  00  |x| = ?
If w=„cabcad‟, |w|= 6
If |w|= 0, it is called an empty string (Denoted by λ or ε)
6
The set of all strings over Σ of length n is denoted  n
. For example, if Σ = (0, 1), then
 2
= {00, 01, 10, 11}. Note that  0
= {ε} for any alphabet Σ, power of an alphabet
Examples:
If ={0,1}, then
0
:{} regardless what the alphabet  is.
1
= {0, 1}.
2
= {00, 01, 10, 11}.
3
= {000, 001, 010, 011, 100, 101, 110, 111}.
Kleene star (or Kleene operator or Kleene closure)
The set of all strings over Σ of any length is the Kleene star of Σ and Is denoted Σ*.
Representation: Σ*= Σ0
∪Σ1
∪Σ2
∪. . .
For example, if Σ = (0, 1), Σ* = (ε, 0, 1, 00, 01, 10, 11, 000, 001, 010, 011 …).
Example − If Σ = {a, b}, Σ*= { ε, a, b, aa, ab, ba, bb,………..}
Languages: “A language is a collection of sentences (words) of finite length all
constructed from a finite alphabet of symbols”.
A language L is a possibly infinite set of strings over a finite alphabet Σ. If Σ is an
alphabet, and L ⊆ Σ *, then L is a formal language over Σ. (formal definition)
Operations on Languages
Operations that can be used to construct languages from other languages are language
operations. Since languages are sets, we can use the usual set operations, Union, L1∪L2,
Intersection, L1∩L2, Complement, Lc, Set difference, L1-L2. The intersection L1 ∩ L2
of L1 and L2 consists of all strings which are contained in both languages and the
complement ¬L of a language with respect to a given alphabet consists of all strings over
the alphabets that are not in the language.
7
We also have new operations defined especially for sets of strings:
 Concatenation, L1◦L2 or justL1L2
 Star, L*
Concatenation
L1◦L2 = { x y | x ∈L1and y ∈L2 } x and y are strings
–Pick one string from each language and concatenate them.
•Example: Σ= { 0, 1 }, L1= { 0, 00 }, L2 = { 01, 001 }
L1◦L2 = { 001, 0001, 00001 }
•Notes: | L1◦L2 | ≤| L1| ×|L2 |, not necessarily equal.
L ◦L does not mean { x x | x ∈L }, but rather, { x y | x and y are both in L}.
Example: Σ= { 0, 1 }, L1= { 0, 00 }, L2 = { 01, 001
L1◦L2 = { 001, 0001, 00001 }
L2◦L2 = { 0101, 01001, 00101, 001001 }
Example: ∅◦L= { x y | x ∈∅and y ∈L} = ∅
_____ { ε} ◦L={ x y | x ∈{ ε} and y ∈L} = L
______L1◦L2 = { x y | x ∈L1and y ∈L2 }
Write L ◦L as L2
, L ◦L ◦…◦L as Ln
, which is { x1x2…xn| all x‟s are in L }
Example: L = { 0, 11 },L3
= { 000, 0011, 0110, 01111, 1100, 11011, 11110, 111111 }
Example: L = { 0, 00 },L3
= { 000, 0000, 00000, 000000 }
Boundary cases: L1 = L
Define L
0
= { ε}, for every L__Implies that L0
Ln
={ ε} Ln
= Ln
, Special case of general
rule La
Lb
= La+b
.
The Star Operation
•L* = { x | x = y1y2…yk for some k ≥0, where every y is in L }
= L0
∪L1
∪L2
∪…
8
Note: ε is in L* for every L, since it‟s in L0
.
Example: What is ∅* ? –Apply the definition: ∅* = ∅0
∪ ∅1
∪ ∅2
∪…= { ε}.
∅0
is { ε},by the convention that L0
=
{ ε}.
The rest of these are just
∅.
Example: What is { a }* ?
–Apply the definition:
{ a }*= { a }
0
∪{ a }
1
∪{ a }
2
∪…
= { ε} ∪{ a } ∪{ a a } ∪…
= { ε, a, a a, a a a, …}
–Abbreviate this to just a*.
–Note this is not just one string, but a set of strings---any number of a‟s
Example: What is Σ*?
–We‟ve already defined this to be the set of all finite strings over Σ.
–But now it has a new formal definition: Σ*= Σ0
∪Σ1
∪Σ2
∪…
= {ε} ∪ {strings of length 1 over Σ}
∪ {strings of length 2 over Σ}
∪…
= { all finite strings over Σ}
 L is a said to be a language over alphabet ∑, only if L∑* this is because ∑* is the set
of all strings (of all possible length including 0) over the given alphabet ∑
 Examples:
1. Let L be the language of all strings consisting of n 0‟s followed by n 1‟s: L =
{,01,0011,000111,…}
2. Let L be the language of all strings of with equal number of 0‟s and 1‟s:
L{,01,10,0011,1100,0101,1010,1001,…}
 Definition: Ø denotes the Empty language
Let L = {}; Is L=Ø? NO, why?
9
Automata theory
Automata theory is the study of abstract machines (or more appropriately, abstract
„mathematical‟ machines or systems) and the computational problems that can be solved
Using these machines. These abstract machines are called automata (singular
,automaton).
Automata Theory deals with definitions and properties of different types of
“Computation models”. Examples of such models are:
 Finite Automata. These are used in text processing, compilers, and hardware
design.
 Context-Free Grammars. These are used to define programming languages and in
Artificial Intelligence.
 Turing Machines. These form a simple abstract model of a “real” computer, such
as your PC at home.
The above figure illustrates a finite state machine, which is one well-known variety of
automata. This automaton consists of states (represented in the figure by circles), and
transitions (represented by arrows). As the automaton sees a symbol of input, it makes a
transition (or jump) to another state, according to its transition function (which takes the
current state and the recent symbol as its inputs).

Weitere ähnliche Inhalte

Was ist angesagt?

MIT Math Syllabus 10-3 Lesson 1: Sets and the real number system
MIT Math Syllabus 10-3 Lesson 1: Sets and the real number systemMIT Math Syllabus 10-3 Lesson 1: Sets and the real number system
MIT Math Syllabus 10-3 Lesson 1: Sets and the real number systemLawrence De Vera
 
Digital text book sets
Digital text book   setsDigital text book   sets
Digital text book setslibinkalappila
 
Math 7 | lesson 1 Sets
Math 7 | lesson 1 SetsMath 7 | lesson 1 Sets
Math 7 | lesson 1 SetsAriel Gilbuena
 
Steiner Tree Parameterized by Treewidth
Steiner Tree Parameterized by TreewidthSteiner Tree Parameterized by Treewidth
Steiner Tree Parameterized by TreewidthASPAK2014
 
BCA_Semester-I_Mathematics-I_Set theory and function
BCA_Semester-I_Mathematics-I_Set theory and functionBCA_Semester-I_Mathematics-I_Set theory and function
BCA_Semester-I_Mathematics-I_Set theory and functionRai University
 
Lesson 1.1 basic ideas of sets part 2
Lesson 1.1   basic ideas of sets part 2Lesson 1.1   basic ideas of sets part 2
Lesson 1.1 basic ideas of sets part 2JohnnyBallecer
 
Formal language
Formal languageFormal language
Formal languageRajendran
 
Sets of numbers
Sets of numbersSets of numbers
Sets of numberspcm544330
 

Was ist angesagt? (17)

Maths
MathsMaths
Maths
 
Set concepts
Set conceptsSet concepts
Set concepts
 
MIT Math Syllabus 10-3 Lesson 1: Sets and the real number system
MIT Math Syllabus 10-3 Lesson 1: Sets and the real number systemMIT Math Syllabus 10-3 Lesson 1: Sets and the real number system
MIT Math Syllabus 10-3 Lesson 1: Sets and the real number system
 
Flat unit 1
Flat unit 1Flat unit 1
Flat unit 1
 
Module week 1 Q1
Module week 1 Q1Module week 1 Q1
Module week 1 Q1
 
Digital text book sets
Digital text book   setsDigital text book   sets
Digital text book sets
 
Set _Number System
Set _Number SystemSet _Number System
Set _Number System
 
Set and its types
Set and its typesSet and its types
Set and its types
 
Math 7 | lesson 1 Sets
Math 7 | lesson 1 SetsMath 7 | lesson 1 Sets
Math 7 | lesson 1 Sets
 
Steiner Tree Parameterized by Treewidth
Steiner Tree Parameterized by TreewidthSteiner Tree Parameterized by Treewidth
Steiner Tree Parameterized by Treewidth
 
BCA_Semester-I_Mathematics-I_Set theory and function
BCA_Semester-I_Mathematics-I_Set theory and functionBCA_Semester-I_Mathematics-I_Set theory and function
BCA_Semester-I_Mathematics-I_Set theory and function
 
Pertemuan 5_Relation Matriks_01 (17)
Pertemuan 5_Relation Matriks_01 (17)Pertemuan 5_Relation Matriks_01 (17)
Pertemuan 5_Relation Matriks_01 (17)
 
Theory of computation Lec1
Theory of computation Lec1Theory of computation Lec1
Theory of computation Lec1
 
Lesson 1.1 basic ideas of sets part 2
Lesson 1.1   basic ideas of sets part 2Lesson 1.1   basic ideas of sets part 2
Lesson 1.1 basic ideas of sets part 2
 
Formal language
Formal languageFormal language
Formal language
 
Sets of numbers
Sets of numbersSets of numbers
Sets of numbers
 
Presentation4
Presentation4Presentation4
Presentation4
 

Ähnlich wie Theory of computation

Explore the foundational concepts of sets in discrete mathematics
Explore the foundational concepts of sets in discrete mathematicsExplore the foundational concepts of sets in discrete mathematics
Explore the foundational concepts of sets in discrete mathematicsDr Chetan Bawankar
 
Sets functions-sequences-exercises
Sets functions-sequences-exercisesSets functions-sequences-exercises
Sets functions-sequences-exercisesRoshayu Mohamad
 
Discrete mathematics OR Structure
Discrete mathematics OR Structure Discrete mathematics OR Structure
Discrete mathematics OR Structure Abdullah Jan
 
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكروDiscrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكروDr. Khaled Bakro
 
basics of autometa theory for beginner .
basics of autometa theory for beginner .basics of autometa theory for beginner .
basics of autometa theory for beginner .NivaTripathy1
 
Set and Set operations, UITM KPPIM DUNGUN
Set and Set operations, UITM KPPIM DUNGUNSet and Set operations, UITM KPPIM DUNGUN
Set and Set operations, UITM KPPIM DUNGUNbaberexha
 
Set theory- Introduction, symbols with its meaning
Set theory- Introduction, symbols with its meaningSet theory- Introduction, symbols with its meaning
Set theory- Introduction, symbols with its meaningDipakMahurkar1
 
Maths Project 11 class(SETS)
Maths Project 11 class(SETS)Maths Project 11 class(SETS)
Maths Project 11 class(SETS)Sahil Mehra
 
Sets and functions daniyal khan
Sets and functions daniyal khanSets and functions daniyal khan
Sets and functions daniyal khanDaniyal Khan
 
Set theory-ppt
Set theory-pptSet theory-ppt
Set theory-pptvipulAtri
 
02 Representing Sets and Types of Sets.pptx
02 Representing Sets and Types of Sets.pptx02 Representing Sets and Types of Sets.pptx
02 Representing Sets and Types of Sets.pptxMerrykrisIgnacio
 

Ähnlich wie Theory of computation (20)

4898850.ppt
4898850.ppt4898850.ppt
4898850.ppt
 
Explore the foundational concepts of sets in discrete mathematics
Explore the foundational concepts of sets in discrete mathematicsExplore the foundational concepts of sets in discrete mathematics
Explore the foundational concepts of sets in discrete mathematics
 
Sets functions-sequences-exercises
Sets functions-sequences-exercisesSets functions-sequences-exercises
Sets functions-sequences-exercises
 
Discrete mathematics OR Structure
Discrete mathematics OR Structure Discrete mathematics OR Structure
Discrete mathematics OR Structure
 
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكروDiscrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
 
discrete maths notes.ppt
discrete maths notes.pptdiscrete maths notes.ppt
discrete maths notes.ppt
 
Algorithms on Strings
Algorithms on StringsAlgorithms on Strings
Algorithms on Strings
 
SETS PPT-XI.pptx
SETS PPT-XI.pptxSETS PPT-XI.pptx
SETS PPT-XI.pptx
 
Anubhav.pdf
Anubhav.pdfAnubhav.pdf
Anubhav.pdf
 
Set concepts
Set conceptsSet concepts
Set concepts
 
basics of autometa theory for beginner .
basics of autometa theory for beginner .basics of autometa theory for beginner .
basics of autometa theory for beginner .
 
Set and Set operations, UITM KPPIM DUNGUN
Set and Set operations, UITM KPPIM DUNGUNSet and Set operations, UITM KPPIM DUNGUN
Set and Set operations, UITM KPPIM DUNGUN
 
Set theory- Introduction, symbols with its meaning
Set theory- Introduction, symbols with its meaningSet theory- Introduction, symbols with its meaning
Set theory- Introduction, symbols with its meaning
 
Maths Project 11 class(SETS)
Maths Project 11 class(SETS)Maths Project 11 class(SETS)
Maths Project 11 class(SETS)
 
Set concepts
Set conceptsSet concepts
Set concepts
 
7-Sets-1.ppt
7-Sets-1.ppt7-Sets-1.ppt
7-Sets-1.ppt
 
Sets and functions daniyal khan
Sets and functions daniyal khanSets and functions daniyal khan
Sets and functions daniyal khan
 
Set theory-ppt
Set theory-pptSet theory-ppt
Set theory-ppt
 
02 Representing Sets and Types of Sets.pptx
02 Representing Sets and Types of Sets.pptx02 Representing Sets and Types of Sets.pptx
02 Representing Sets and Types of Sets.pptx
 
maths
mathsmaths
maths
 

Kürzlich hochgeladen

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Kürzlich hochgeladen (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

Theory of computation

  • 1. 1 Chapter one Introduction to theory of computation(ToC) Chapter programme ToC Mathematical introductions Basic ideas and terminologies of formal langue and automata theory automata
  • 2. 2 Introduction to the theory of computation The Theory of Computation, which tries to answer the Following questions:  What are the mathematical properties of computer hardware and software?  What is a computation and what is an algorithm? Can we give rigorous mathematical definitions of these notions?  What are the limitations of computers? Can “everything” be computed? Purpose of the Theory of Computation: Develop formal mathematical models of computation that reflect real-world computers. Nowadays, the Theory of Computation can be divided into the following three areas: Complexity Theory, Computability Theory, and Automata Theory. Mathematical preliminaries A set is an unordered collection of different elements.  A set of all the planets in the solar system  A set of all the states in India  A set of all the lowercase letters of the alphabet  N − the set of all natural numbers = {1, 2, 3, 4, .....}  Z − the set of all integers = {....., −3, −2, −1, 0, 1, 2, 3, .....}  Z+ − the set of all positive integers  Q − the set of all rational numbers  R − the set of all real numbers  W − the set of all whole numbers Sets can be represented in two ways −  Roster or Tabular Form  Set Builder Notation
  • 3. 3 Set Builder Notation The set is represented by listing all the elements comprising it. The elements are enclosed within braces and separated by commas. Example :Set of vowels in English alphabet, A = {a,e,i,o,u} Roster or Tabular Form If we are given a set A such that x is in A iff x has property P, then we write A = {x | x has property P}A = { x : p(x)}. Example: Thus, P = {x | x is a prime number} is the set of prime numbers. Similarly, if we want to only look at prime numbers of the form n2 +1 we could write {x ∈ P | there exists a natural number n, such that x = n2 + 1.} A more compact way of denoting this set is {x ∈ P | (∃n ∈ N) ∋ (x = n2 + 1)} or even simply {x ∈ P | (∃n ∈ N)(x = n2 + 1)}. Example − The set {a,e,i,o,u} is written as − A = { x : x is a vowel in English alphabet}. Cardinality of a set S, denoted by |S|, is the number of elements of the set. If a set has an infinite number of elements, its cardinality is ∞. Example − |{1, 4, 3, 5}| = 4, |{1, 2, 3, 4, 5,…}| = ∞ Sets can be classified into many types. Some of which are finite, infinite, subset, universal, proper, etc. A set which contains a definite number of elements is called a finite set. Example − S = {x | x  N and 70 > x > 50}. A set which contains infinite number of elements is called an infinite set. Example − S = {x | x  N and x > 10} An empty set contains no elements. It is denoted by . As the n umber of elements in an empty set is finite, empty set is a finite set. The cardinality of empty set or null set is zero. If two sets contain the same elements they are said to be equal. Example − If A = {1, 2, 6} and B = {6, 1, 2}, they are equal as every element of set A is an element of set B and every element of set B is an element of set A. If the cardinalities of two sets are same, they are called equivalent sets. Example − If A = {1, 2, 6} and B = {16, 17, 22}, they are equivalent as cardinality of A is equal to the cardinality of B. i.e. |A| = |B| = 3
  • 4. 4 If two sets C and D are disjoint sets as they do not have even one element in common. The intersection of any two distinct sets is empty. A relation associates elements of one set called the domain, with elements of another set called the co domain (both sets are non-empty set) example: One set: set of students. Another set: set of subjects.Functions are especial relations. A graph is a pictorial representation of a set of objects where some pairs of objects are connected by links. The interconnected objects are represented by points termed as vertices, and the links that connect the vertices are called edges. Formally Definition − A graph (denoted as G = (V, E)) consists of a non-empty set of vertices or nodes V and a set of edges E. Example − Let us consider, a Graph is G = (V, E) where V = {a, b, c, d} and E = {{a, b}, {a, c}, {b, c},{c, d}} Take a look at the following graph – a b c d e In the above graph, V = {a, b, c, d, e} E = {ab, ac, bd, cd, de} Tree Tree is a special form of graph having no loops, no circuits and no self-loops. A connected acyclic graph is called a tree. In other words, a connected graph with no cycles is called a tree. The edges of a tree are known as branches. Elements of trees are called their nodes. The nodes without child nodes are called leaf nodes.
  • 5. 5 Basic concepts of automata and Language Theory Formal language theory, the discipline which studies formal grammars and languages, is a branch of applied mathematics computer science. Its applications are found in theoretical computer science, theoretical linguistics, formal semantics, mathematical logic, and other areas. A formal grammar (sometimes simply called a grammar) is a set of rules for forming strings in a formal language. The rules describe how to form strings from the language's alphabet that are valid according to the language's syntax. A grammar does not describe the meaning of the strings or what can be done with them in whatever context – only their Form, i.e. their internal structural patterns. An alphabet is any finite, non-empty set of symbols, usually denoted by the symbol ∑ (sigma) and write Σ = {a1, . . . , ak}. The ai are called the symbols of the alphabet. Examples: Binary: ∑ = {0,1} All lower case letters: ∑ = {a,b,c,..z} Alphanumeric: ∑ = {a-z, A-Z, 0-9} A string (sometimes a word) is a finite sequence of symbols chosen from ∑. Length of a string w, denoted by “|w|”, is equal to the number of (non- ) characters in the string(or positions). The empty string, denoted by  (or “epsilon”), is the string having length zero. For example, if the alphabet  is equal to {0, 1}, then 10, 1000, 0, 101, and  are strings over, having lengths 2, 4, 1, 3, and 0, respectively. E.g., x = 010100 |x| = 6 x = 01  0  1  00  |x| = ? If w=„cabcad‟, |w|= 6 If |w|= 0, it is called an empty string (Denoted by λ or ε)
  • 6. 6 The set of all strings over Σ of length n is denoted  n . For example, if Σ = (0, 1), then  2 = {00, 01, 10, 11}. Note that  0 = {ε} for any alphabet Σ, power of an alphabet Examples: If ={0,1}, then 0 :{} regardless what the alphabet  is. 1 = {0, 1}. 2 = {00, 01, 10, 11}. 3 = {000, 001, 010, 011, 100, 101, 110, 111}. Kleene star (or Kleene operator or Kleene closure) The set of all strings over Σ of any length is the Kleene star of Σ and Is denoted Σ*. Representation: Σ*= Σ0 ∪Σ1 ∪Σ2 ∪. . . For example, if Σ = (0, 1), Σ* = (ε, 0, 1, 00, 01, 10, 11, 000, 001, 010, 011 …). Example − If Σ = {a, b}, Σ*= { ε, a, b, aa, ab, ba, bb,………..} Languages: “A language is a collection of sentences (words) of finite length all constructed from a finite alphabet of symbols”. A language L is a possibly infinite set of strings over a finite alphabet Σ. If Σ is an alphabet, and L ⊆ Σ *, then L is a formal language over Σ. (formal definition) Operations on Languages Operations that can be used to construct languages from other languages are language operations. Since languages are sets, we can use the usual set operations, Union, L1∪L2, Intersection, L1∩L2, Complement, Lc, Set difference, L1-L2. The intersection L1 ∩ L2 of L1 and L2 consists of all strings which are contained in both languages and the complement ¬L of a language with respect to a given alphabet consists of all strings over the alphabets that are not in the language.
  • 7. 7 We also have new operations defined especially for sets of strings:  Concatenation, L1◦L2 or justL1L2  Star, L* Concatenation L1◦L2 = { x y | x ∈L1and y ∈L2 } x and y are strings –Pick one string from each language and concatenate them. •Example: Σ= { 0, 1 }, L1= { 0, 00 }, L2 = { 01, 001 } L1◦L2 = { 001, 0001, 00001 } •Notes: | L1◦L2 | ≤| L1| ×|L2 |, not necessarily equal. L ◦L does not mean { x x | x ∈L }, but rather, { x y | x and y are both in L}. Example: Σ= { 0, 1 }, L1= { 0, 00 }, L2 = { 01, 001 L1◦L2 = { 001, 0001, 00001 } L2◦L2 = { 0101, 01001, 00101, 001001 } Example: ∅◦L= { x y | x ∈∅and y ∈L} = ∅ _____ { ε} ◦L={ x y | x ∈{ ε} and y ∈L} = L ______L1◦L2 = { x y | x ∈L1and y ∈L2 } Write L ◦L as L2 , L ◦L ◦…◦L as Ln , which is { x1x2…xn| all x‟s are in L } Example: L = { 0, 11 },L3 = { 000, 0011, 0110, 01111, 1100, 11011, 11110, 111111 } Example: L = { 0, 00 },L3 = { 000, 0000, 00000, 000000 } Boundary cases: L1 = L Define L 0 = { ε}, for every L__Implies that L0 Ln ={ ε} Ln = Ln , Special case of general rule La Lb = La+b . The Star Operation •L* = { x | x = y1y2…yk for some k ≥0, where every y is in L } = L0 ∪L1 ∪L2 ∪…
  • 8. 8 Note: ε is in L* for every L, since it‟s in L0 . Example: What is ∅* ? –Apply the definition: ∅* = ∅0 ∪ ∅1 ∪ ∅2 ∪…= { ε}. ∅0 is { ε},by the convention that L0 = { ε}. The rest of these are just ∅. Example: What is { a }* ? –Apply the definition: { a }*= { a } 0 ∪{ a } 1 ∪{ a } 2 ∪… = { ε} ∪{ a } ∪{ a a } ∪… = { ε, a, a a, a a a, …} –Abbreviate this to just a*. –Note this is not just one string, but a set of strings---any number of a‟s Example: What is Σ*? –We‟ve already defined this to be the set of all finite strings over Σ. –But now it has a new formal definition: Σ*= Σ0 ∪Σ1 ∪Σ2 ∪… = {ε} ∪ {strings of length 1 over Σ} ∪ {strings of length 2 over Σ} ∪… = { all finite strings over Σ}  L is a said to be a language over alphabet ∑, only if L∑* this is because ∑* is the set of all strings (of all possible length including 0) over the given alphabet ∑  Examples: 1. Let L be the language of all strings consisting of n 0‟s followed by n 1‟s: L = {,01,0011,000111,…} 2. Let L be the language of all strings of with equal number of 0‟s and 1‟s: L{,01,10,0011,1100,0101,1010,1001,…}  Definition: Ø denotes the Empty language Let L = {}; Is L=Ø? NO, why?
  • 9. 9 Automata theory Automata theory is the study of abstract machines (or more appropriately, abstract „mathematical‟ machines or systems) and the computational problems that can be solved Using these machines. These abstract machines are called automata (singular ,automaton). Automata Theory deals with definitions and properties of different types of “Computation models”. Examples of such models are:  Finite Automata. These are used in text processing, compilers, and hardware design.  Context-Free Grammars. These are used to define programming languages and in Artificial Intelligence.  Turing Machines. These form a simple abstract model of a “real” computer, such as your PC at home. The above figure illustrates a finite state machine, which is one well-known variety of automata. This automaton consists of states (represented in the figure by circles), and transitions (represented by arrows). As the automaton sees a symbol of input, it makes a transition (or jump) to another state, according to its transition function (which takes the current state and the recent symbol as its inputs).