SlideShare a Scribd company logo
1 of 25
Slide 1
Introduction
Slide 3
Theory of Computation
• What are the capabilities /Problems solved /
Limitations of machine?
• What are the concepts of machine?
Theory
Slide 4
Theory of Computation
• Model or devices that perform some computation.
• Any task done by any machine like calculator,
computer, etc.,
Computation
Slide 5
Computation
•Computation is a general term for any type of information
processing that can be represented as an algorithm
precisely (mathematically).
Examples:
• Adding two numbers in our brains, on a piece of paper or
using a calculator.
• Converting a decimal number to its binary presentation or
vise versa.
• Finding the greatest common divisors of two numbers.
Slide 6
Computation
• These computations are used to represent
various mathematical models.
• Finite automate
• Pushdown automate
• Turning machine
Slide 7
4/13/2023 Chapter 1 Introduction
Theory of Computation
•TOC is a subject in which we study mathematical models
(abstract machines) as well as the computational problems
that can be solved by using these models.
•TOC can be considered as the study of all kinds of
computational model in the field of computer science and it
also how efficiently the problem can be solved .
Slide 8
Branches of TOC
• Automata Theory
It deals with definitions and properties of various mathematical
models/devices
• Computability Theory
– It deals with what can and cannot be computed by the model
• Complexity Theory
– It deals with computable problem based on the hardness. To calculate the
efficiency.
Slide 13
Problem
•Now a days machines (digital, analog,
mechanical) play a very important role in
the development of human, we need
some mechanism (language) to
communicate with the machines.
Slide 14
Solution
• We need a language for communication with machines.
• Languages can be two types formal and informal languages.
• We will only study formal languages
• Dictionary defines the term informally as ‘a system suitable for
the expression of certain ideas, facts or concepts including a
set of symbols for their manipulation’.
Slide 15
Methods to define language
•In natural language we define the list of words in a
dictionary because they are finite and predefined, but
we cannot list all the sentence which can be formed
using these words as they are infinite.
•So we have a mechanism called grammar/rules using
which we can decide which sentence is valid and
which is invalid.
Slide 16
Symbols, Alphabet, strings
• Symbols – An individual part of input symbol or single character is
known as symbol (in engish we call them as letters)
– Example: Digit - 0,1,2,…. 9
Alphabets- a,b,c ….z , A, B, …….,Z
Special symbols !@#$< >….
Symbols are used to build language for machine.
• Alphabet (∑)– It is a finite non empty set of input symbols (every
language has its own alphabet). We use symbol ∑ for depicting
alphabet.
∑ = {0,1,2}
∑ = {0,1} Binary alphabet
∑ = { a,b,c}
Slide 17
String
• String - It is a sequence of input symbols from the alphabet(∑)
( in English we called them as words)
∑ = {0,1} w= 01101 ( it is a string from binary )
∑ = {a,b} w= abbab ( it is a string from the alphabet)
Slide 18
Length of the string
• Definition − It is defined as number of symbol in the string.
(Denoted by |S|).
• Examples −
• If S = ‘cabcad’, |S|= 6
• If S = ε |S|= 0, it is called an empty string
Slide 19
4/13/2023 Chapter 1 Introduction
Empty String
• The string with zero occurrence of symbols.
It is denoted by , | | =0 .
Slide 20
4/13/2023 Chapter 1 Introduction
Concatenation of string
• Let x and y be two strings, then
concatenation is defined as the string
formed by making a copy of string x followed
by a copy of string y.
• Example: w= ab x=ba wx= abba
Slide 21
4/13/2023 Chapter 1 Introduction
Substring
A string of consecutive symbols in some string ‘w’ can
be collectively said as a substring.
Example. W = abab its substrings can be ab,a, ba…etc.,
– ε is a substring of every string.
Example
– ε, comput and computation are substrings of
computation.
Slide 22
4/13/2023 Chapter 1 Introduction
Reversal
If there is a string w then reverse of a string a
denoted by wr is just the same string but
written in reverse order.
W= w1 w2 w3 …wn
Wr = wn , wn-1 , …. ..w3,w2,w1
Slide 23
4/13/2023 Chapter 1 Introduction
Example of Reversal
(automata)r
= (utomata)r a
= (tomata)r ua
= (omata)r tua
= (mata)r otua
= (ata)r motua
= (ta)r amotua
= (a)r tamotua
= ()r atamotua
= atamotua
Slide 24
Power of Alphabet
• ∑ - Alphabet – set of symbols
• ∑k = set of all strings of length k
• Example ∑ = { 0, 1}
∑0 = {ɛ }
∑1 = {0,1}
∑2 = { 00,01,10,11}
∑3 = ∑2 ∑
= {00,01,10,11} { 0,1}
= { 000,001,010,011,100,101,110,111}
Slide 25
Kleene star – (∑* )
• It is a unary operator on a set of symbols or string, ∑ that
gives the infinite set of all possible strings of all possible
lengths over ∑ including ɛ.
∑* = ∑o ꓴ ∑1 ꓴ ∑2 ꓴ ….
Example: ∑ = {a, b}
∑* = { ɛ, a,b,aa,ab,ba,bb … }
Slide 26
4/13/2023 Chapter 1 Introduction
Σ*
• The set of strings created from any number (0
or 1 or …) of symbols in an alphabet  is
denoted by *.
• That is, * = i=

0 i
– Let = {0, 1}.
– * = {, 0, 1, 00, 01, 10, 11, 000, 001, 010, 011, … }.
Slide 27
Kleene closure / Plus (∑+ )
• It is the infinite set of all possible strings of all possible length
over ∑ excluding ɛ.
• ∑+ = ∑1 ꓴ ∑2 ꓴ ∑3 ꓴ …
• ∑* = ∑* - { ɛ }
• Example:
• ∑ = {a , b}
• ∑+ = {a,b,aa,ab,ba,bb……}
Slide 28
4/13/2023 Chapter 1 Introduction
Σ+
• The set of strings created from at least one symbol
(1 or 2 or …) in an alphabet  is denoted by +.
• That is, + = i=

1 i
= i=0.. i
- 0
=  i=0.. i
- {}
• Let = {0, 1}. + = {0, 1, 00, 01, 10, 11, 000, 001, 010, 011,
… }.
* and + are infinite sets.
Slide 29
Language
• A Language is defined as a set of strings. ( in natural language
set of words(predefined) and grammar) we apply this model
from words to sentence).
• In the next level we consider programs as a string and
programming constructs/ tokens like int, floats as
letters/symbols.
Slide 30
Language
• A language is a collection of strings over ∑
• Example ∑ = {a,b}
1. L = set of all string of length 2
L= {aa, ab, ba, bb}
Here, L is a finite set
2. L = set of all string of length 3
L = {aaa,aab, aba, abb, baa,bab,bba,bbb}
Here L is also finite set
3. L = set of all strings where each string start with an ‘a’
L = {a,aa,ab, aab,aba,abb……}
Here L is an infinite set.
So, A Language which can be formed over an alphabet can be finite or infinite set.

More Related Content

Similar to Overview_of_a_computational_model_-_Languages_1.ppt

Winter 10 Undecidability.pptx
Winter 10 Undecidability.pptxWinter 10 Undecidability.pptx
Winter 10 Undecidability.pptx
HarisPrince
 

Similar to Overview_of_a_computational_model_-_Languages_1.ppt (20)

01 alphabets strings and languages
01 alphabets strings and languages01 alphabets strings and languages
01 alphabets strings and languages
 
Algorithms presentation on Path Matrix, Bell Number and Sorting
Algorithms presentation on Path Matrix, Bell Number and SortingAlgorithms presentation on Path Matrix, Bell Number and Sorting
Algorithms presentation on Path Matrix, Bell Number and Sorting
 
Theory of computation
Theory of computationTheory of computation
Theory of computation
 
Sparse autoencoder
Sparse autoencoderSparse autoencoder
Sparse autoencoder
 
Basic Foundations of Automata Theory
Basic Foundations of Automata TheoryBasic Foundations of Automata Theory
Basic Foundations of Automata Theory
 
Algorithms on Strings
Algorithms on StringsAlgorithms on Strings
Algorithms on Strings
 
Unit-1-part-1.pptx
Unit-1-part-1.pptxUnit-1-part-1.pptx
Unit-1-part-1.pptx
 
(2) collections algorithms
(2) collections algorithms(2) collections algorithms
(2) collections algorithms
 
Winter 10 Undecidability.pptx
Winter 10 Undecidability.pptxWinter 10 Undecidability.pptx
Winter 10 Undecidability.pptx
 
Mastering Python lesson 5a_lists_list_operations
Mastering Python lesson 5a_lists_list_operationsMastering Python lesson 5a_lists_list_operations
Mastering Python lesson 5a_lists_list_operations
 
Skip-gram Model Broken Down
Skip-gram Model Broken DownSkip-gram Model Broken Down
Skip-gram Model Broken Down
 
Regular expressions h1
Regular expressions h1Regular expressions h1
Regular expressions h1
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptx
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptx
 
Introduction to Matlab - Basic Functions
Introduction to Matlab - Basic FunctionsIntroduction to Matlab - Basic Functions
Introduction to Matlab - Basic Functions
 
presentation on important DAG,TRIE,Hashing.pptx
presentation on important DAG,TRIE,Hashing.pptxpresentation on important DAG,TRIE,Hashing.pptx
presentation on important DAG,TRIE,Hashing.pptx
 
Data structure and algorithm All in One
Data structure and algorithm All in OneData structure and algorithm All in One
Data structure and algorithm All in One
 
Cs6660 compiler design november december 2016 Answer key
Cs6660 compiler design november december 2016 Answer keyCs6660 compiler design november december 2016 Answer key
Cs6660 compiler design november december 2016 Answer key
 
FLAT Notes
FLAT NotesFLAT Notes
FLAT Notes
 
09_java_DataTypesand associated class.ppt
09_java_DataTypesand associated class.ppt09_java_DataTypesand associated class.ppt
09_java_DataTypesand associated class.ppt
 

Recently uploaded

Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...
Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...
Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...
HyderabadDolls
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
gajnagarg
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
gajnagarg
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
nirzagarg
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
nirzagarg
 
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
nirzagarg
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
nirzagarg
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
gajnagarg
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Klinik kandungan
 

Recently uploaded (20)

Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
 
Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...
Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...
Lake Town / Independent Kolkata Call Girls Phone No 8005736733 Elite Escort S...
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
 
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
 
Vastral Call Girls Book Now 7737669865 Top Class Escort Service Available
Vastral Call Girls Book Now 7737669865 Top Class Escort Service AvailableVastral Call Girls Book Now 7737669865 Top Class Escort Service Available
Vastral Call Girls Book Now 7737669865 Top Class Escort Service Available
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
 
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
 
👉 Bhilai Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Girl Ser...
👉 Bhilai Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Girl Ser...👉 Bhilai Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Girl Ser...
👉 Bhilai Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Girl Ser...
 
Case Study 4 Where the cry of rebellion happen?
Case Study 4 Where the cry of rebellion happen?Case Study 4 Where the cry of rebellion happen?
Case Study 4 Where the cry of rebellion happen?
 
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
 
Giridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime Giridih
Giridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime GiridihGiridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime Giridih
Giridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime Giridih
 
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 

Overview_of_a_computational_model_-_Languages_1.ppt

  • 2. Slide 3 Theory of Computation • What are the capabilities /Problems solved / Limitations of machine? • What are the concepts of machine? Theory
  • 3. Slide 4 Theory of Computation • Model or devices that perform some computation. • Any task done by any machine like calculator, computer, etc., Computation
  • 4. Slide 5 Computation •Computation is a general term for any type of information processing that can be represented as an algorithm precisely (mathematically). Examples: • Adding two numbers in our brains, on a piece of paper or using a calculator. • Converting a decimal number to its binary presentation or vise versa. • Finding the greatest common divisors of two numbers.
  • 5. Slide 6 Computation • These computations are used to represent various mathematical models. • Finite automate • Pushdown automate • Turning machine
  • 6. Slide 7 4/13/2023 Chapter 1 Introduction Theory of Computation •TOC is a subject in which we study mathematical models (abstract machines) as well as the computational problems that can be solved by using these models. •TOC can be considered as the study of all kinds of computational model in the field of computer science and it also how efficiently the problem can be solved .
  • 7. Slide 8 Branches of TOC • Automata Theory It deals with definitions and properties of various mathematical models/devices • Computability Theory – It deals with what can and cannot be computed by the model • Complexity Theory – It deals with computable problem based on the hardness. To calculate the efficiency.
  • 8. Slide 13 Problem •Now a days machines (digital, analog, mechanical) play a very important role in the development of human, we need some mechanism (language) to communicate with the machines.
  • 9. Slide 14 Solution • We need a language for communication with machines. • Languages can be two types formal and informal languages. • We will only study formal languages • Dictionary defines the term informally as ‘a system suitable for the expression of certain ideas, facts or concepts including a set of symbols for their manipulation’.
  • 10. Slide 15 Methods to define language •In natural language we define the list of words in a dictionary because they are finite and predefined, but we cannot list all the sentence which can be formed using these words as they are infinite. •So we have a mechanism called grammar/rules using which we can decide which sentence is valid and which is invalid.
  • 11. Slide 16 Symbols, Alphabet, strings • Symbols – An individual part of input symbol or single character is known as symbol (in engish we call them as letters) – Example: Digit - 0,1,2,…. 9 Alphabets- a,b,c ….z , A, B, …….,Z Special symbols !@#$< >…. Symbols are used to build language for machine. • Alphabet (∑)– It is a finite non empty set of input symbols (every language has its own alphabet). We use symbol ∑ for depicting alphabet. ∑ = {0,1,2} ∑ = {0,1} Binary alphabet ∑ = { a,b,c}
  • 12. Slide 17 String • String - It is a sequence of input symbols from the alphabet(∑) ( in English we called them as words) ∑ = {0,1} w= 01101 ( it is a string from binary ) ∑ = {a,b} w= abbab ( it is a string from the alphabet)
  • 13. Slide 18 Length of the string • Definition − It is defined as number of symbol in the string. (Denoted by |S|). • Examples − • If S = ‘cabcad’, |S|= 6 • If S = ε |S|= 0, it is called an empty string
  • 14. Slide 19 4/13/2023 Chapter 1 Introduction Empty String • The string with zero occurrence of symbols. It is denoted by , | | =0 .
  • 15. Slide 20 4/13/2023 Chapter 1 Introduction Concatenation of string • Let x and y be two strings, then concatenation is defined as the string formed by making a copy of string x followed by a copy of string y. • Example: w= ab x=ba wx= abba
  • 16. Slide 21 4/13/2023 Chapter 1 Introduction Substring A string of consecutive symbols in some string ‘w’ can be collectively said as a substring. Example. W = abab its substrings can be ab,a, ba…etc., – ε is a substring of every string. Example – ε, comput and computation are substrings of computation.
  • 17. Slide 22 4/13/2023 Chapter 1 Introduction Reversal If there is a string w then reverse of a string a denoted by wr is just the same string but written in reverse order. W= w1 w2 w3 …wn Wr = wn , wn-1 , …. ..w3,w2,w1
  • 18. Slide 23 4/13/2023 Chapter 1 Introduction Example of Reversal (automata)r = (utomata)r a = (tomata)r ua = (omata)r tua = (mata)r otua = (ata)r motua = (ta)r amotua = (a)r tamotua = ()r atamotua = atamotua
  • 19. Slide 24 Power of Alphabet • ∑ - Alphabet – set of symbols • ∑k = set of all strings of length k • Example ∑ = { 0, 1} ∑0 = {ɛ } ∑1 = {0,1} ∑2 = { 00,01,10,11} ∑3 = ∑2 ∑ = {00,01,10,11} { 0,1} = { 000,001,010,011,100,101,110,111}
  • 20. Slide 25 Kleene star – (∑* ) • It is a unary operator on a set of symbols or string, ∑ that gives the infinite set of all possible strings of all possible lengths over ∑ including ɛ. ∑* = ∑o ꓴ ∑1 ꓴ ∑2 ꓴ …. Example: ∑ = {a, b} ∑* = { ɛ, a,b,aa,ab,ba,bb … }
  • 21. Slide 26 4/13/2023 Chapter 1 Introduction Σ* • The set of strings created from any number (0 or 1 or …) of symbols in an alphabet  is denoted by *. • That is, * = i=  0 i – Let = {0, 1}. – * = {, 0, 1, 00, 01, 10, 11, 000, 001, 010, 011, … }.
  • 22. Slide 27 Kleene closure / Plus (∑+ ) • It is the infinite set of all possible strings of all possible length over ∑ excluding ɛ. • ∑+ = ∑1 ꓴ ∑2 ꓴ ∑3 ꓴ … • ∑* = ∑* - { ɛ } • Example: • ∑ = {a , b} • ∑+ = {a,b,aa,ab,ba,bb……}
  • 23. Slide 28 4/13/2023 Chapter 1 Introduction Σ+ • The set of strings created from at least one symbol (1 or 2 or …) in an alphabet  is denoted by +. • That is, + = i=  1 i = i=0.. i - 0 =  i=0.. i - {} • Let = {0, 1}. + = {0, 1, 00, 01, 10, 11, 000, 001, 010, 011, … }. * and + are infinite sets.
  • 24. Slide 29 Language • A Language is defined as a set of strings. ( in natural language set of words(predefined) and grammar) we apply this model from words to sentence). • In the next level we consider programs as a string and programming constructs/ tokens like int, floats as letters/symbols.
  • 25. Slide 30 Language • A language is a collection of strings over ∑ • Example ∑ = {a,b} 1. L = set of all string of length 2 L= {aa, ab, ba, bb} Here, L is a finite set 2. L = set of all string of length 3 L = {aaa,aab, aba, abb, baa,bab,bba,bbb} Here L is also finite set 3. L = set of all strings where each string start with an ‘a’ L = {a,aa,ab, aab,aba,abb……} Here L is an infinite set. So, A Language which can be formed over an alphabet can be finite or infinite set.