SlideShare uma empresa Scribd logo
1 de 27
Theory of Computation
Lecture #2
Mahmoud Ali Ahmed
Languages & Grammar
Before discussing languages & grammar let us deal
with some related issues.
Alphabet: is defined as a nonempty finite set
of symbols or letters such as {a1, a2, …, ak}.
Particularly the alphabet for theory of
computation is mostly the binary alphabet {0, 1}.
Set of alphabet represented by 
Languages & Grammar
A string (word or sentence): is defied as a
finite sequence of symbols over the set of
alphabet (∑), e.g. aaabbbabbb is string over
∑ = {a, b}. A string might be represent by w.
A string may have no symbol at all, in this
case it is called the empty string / null string
and denoted by or
Note:
Some times string (word/sentence) can be
represented as function. e.g.
A string x = x0 x1 x2 x3 … xn, which can be
viewed as function as:
x : [n] | x(k) = xk.
where n is the length of the string x, which
denoted by |x|, e.g. |aabbaab| = 7

Operations on strings
For an alphabet Σ, given any two strings u: [m] → Σ
and v: [n] → Σ, the concatenation u・v (also written
as uv) of u and v is the string uv: [m + n] → Σ,
defined such that:






nmimifmiv
miifiu
iuv
1)(
,1)(
)(
In particular uuu  
Formal Languages
Formal vs. Natural Languages
Natural Languages: used by human to communicate.
e.g. Arabic, English, …
syntax is very complicated not completely specified
Formal Languages
Formal vs. Natural Languages
Formal Language: specified by a well-defined sets
of grammatical rules
e.g. programming languages
syntax completely defined by given grammar.
Why study Formal Languages?
Programming languages are formal.
very useful for pattern matching.
Important for research in natural language
processing (NLP) with computers.
Closely tied to study of abstract machines.
Formal Languages
Let be any finite set of symbols (possibly
none), called an alphabet.

A word (string) over is any fine
sequence of letters from .


A formal language is simply a set of strings
Formal Languages
*
 defined as the set of all possible words
over , including the empty word (denoted
by ).


Example
Let , then},{ ba
},,,,,,,,,,{*
baaabaaaabbbaabaaba
A language over is defined as strings over
i.e. a subset of
 

*

Examples: ∑ = {a, b}
 aabaaa ,,,
  8,
*
 xbax
  oddisxbax 
*
,
  )()(,
*
xNxNbax ba 
Example
 ,,,,,,,,,*
aabaaabbbaabaaba
Let  ., ba Then
 aabaaaL ,,
The language
is a finite language on .
Note: Language can be infinite, and the most
interesting languages are infinite.
New language can be constructed using any of the
set operations.
As an example the union of tow languages over ,
is also a language over .


Having {as, so} and {if, soon, possible} as tow
languages over the concatenation of the tow
languages give another language over as follows.

{as, so} {if, soon, possible} =
{asif, assoon, aspossible, soif, sosoon, sopossible}.
Regular Expression & Language
Definition: A regular expression over , that
corresponding to a language, can be recursively
defined as follows:

• ε is a Regular Expression indicates the language containing an
empty string. (L (ε) = {ε})
• φ is a Regular Expression denoting an empty language. (L (φ) = { })
• a is a Regular Expression where L = {a}.
Regular Expression & Language
• If x is a Regular Expression denoting the
language L(x) and y is a Regular Expression denoting the
language L(y), then
o x + y is a Regular Expression corresponding to the
language L(x) ∪ L(y) where L(x + y) = L(x) ∪ L(y).
o x . x is a Regular Expression corresponding to the
language L(x) . L(y) where L(x. y) = L(x) . L(y).
o R* is a Regular Expression corresponding to the language
L(R*)where L(R*) = (L(R))*.
• if we apply any of the above rules several times, they are
Regular Expressions.
A language over is a regular language if there is
some regular expression over corresponding to it.


Examples of regular expression over
**
011

 1*
**
110
MeaningExpression
All words over contains
exactly a single 0.

All words over containing
at least one 1.

All words over that
containing a substring 110.

}1,0{
(00 + 01 + 10 + 11)*
All string of 0’s and 1’s of even length
can be obtained by concatenating any
combination of the strings 00, 01, 10 and
11 including ε
MeaningExpression
*
)(  All words over ∑ with an even length
*
)(  All words over ∑ of length a multiple of
three
101100  
All words over ∑ starts and ends with the
same symbol
011 

All strings containing over ∑ that begin
with 1 and ending with 01
(0|(1(01*0)*1))* All strings containing over ∑ contains
binary numbers that are multiples of 3
Formal Grammar
Formal definition
 ,,,, PSTVG 
where,
A generative grammar, which firstly proposed
by Noam Chomsky in 1950s, considered as a
grammar G that defined as a quadruple.
is a finite set of objects called variables.V
is a finite set of objects called terminal symbols.T
is a special symbol called start variable.VS 
is a finite set of productions.P
V TIt is assumed that and are nonempty and disjoint
Definition (L(G))









wSTwGL :)(
Let be a grammar. Then the set ,,,, PSTVG 
is the language generated by .G
Example
 ,,,, PSTVG 
Consider a grammar G that defined as
where,
V = {S, B} T = {a, b, c}
P consists of the following production rule
S aBSc S abc
Ba aB Bb bb
L(G) may be derived to be consisted of the
following strings:
L(G) = {abc, aabbcc, aaabbbccc, …}
Therefore L(G) can be represented as
L(G) = {an bn cn | n>0}
L(G) = {w ϵ {a, b, c}* | na(w) = nb(w) = nc(w)}
Representation of Language using Graphs
Transition Graph over is a finite directed graph in
which every arrow (edge) is labeled by some word
(possibly the empty word ( )).
There is a least one vertex , labeled by a ( ) sign
(such vertices are called initial vertices), and a
(possibly empty set) of vertices, labeled by a ( )
sign (called the final vertices). A vertex can be both
initial and final.
T 
*
w

''
''

 
ba, *


a b
 bab,,
Example
Consider the following transition graphs over
 ba,
b
a
All words over beginning with a followed by a sb'
ba,
aa
ba,
ba,
bb
All words over containing two consecutive ( )
or two consecutive ( )
 sa'
sb'
bbaa,
baab,
bbaa ,
baab,
All words over containing an even number of ( )
and even number of ( )
 sa'
sb'

b
aa
ba,
ba,
All words over either starting with ( ) or
containing ( ) .
 b
aa

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Lecture 1,2
Lecture 1,2Lecture 1,2
Lecture 1,2
 
Minimizing DFA
Minimizing DFAMinimizing DFA
Minimizing DFA
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
 
Regular Languages
Regular LanguagesRegular Languages
Regular Languages
 
Ch3 4 regular expression and grammar
Ch3 4 regular expression and grammarCh3 4 regular expression and grammar
Ch3 4 regular expression and grammar
 
Lesson 03
Lesson 03Lesson 03
Lesson 03
 
Cs419 lec4 lexical analysis using re
Cs419 lec4   lexical analysis using reCs419 lec4   lexical analysis using re
Cs419 lec4 lexical analysis using re
 
3.1 intro toautomatatheory h1
3.1 intro toautomatatheory  h13.1 intro toautomatatheory  h1
3.1 intro toautomatatheory h1
 
1.1. the central concepts of automata theory
1.1. the central concepts of automata theory1.1. the central concepts of automata theory
1.1. the central concepts of automata theory
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
 
Automata definitions
Automata definitionsAutomata definitions
Automata definitions
 
Theory of Automata Lesson 02
Theory of Automata Lesson 02Theory of Automata Lesson 02
Theory of Automata Lesson 02
 
Theory of Automata
Theory of AutomataTheory of Automata
Theory of Automata
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
Theory of Computation "Chapter 1, introduction"
Theory of Computation "Chapter 1, introduction"Theory of Computation "Chapter 1, introduction"
Theory of Computation "Chapter 1, introduction"
 
Lecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular LanguagesLecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular Languages
 
Language
LanguageLanguage
Language
 
Cs419 lec3 lexical analysis using re
Cs419 lec3   lexical analysis using reCs419 lec3   lexical analysis using re
Cs419 lec3 lexical analysis using re
 
Flat unit 1
Flat unit 1Flat unit 1
Flat unit 1
 

Destaque

Akshat Chouhan SAP FI-1
Akshat Chouhan SAP FI-1Akshat Chouhan SAP FI-1
Akshat Chouhan SAP FI-1
Akshat Chouhan
 
Curriculum 2016_Eng
Curriculum 2016_EngCurriculum 2016_Eng
Curriculum 2016_Eng
Carlo Ceresa
 

Destaque (20)

theory of computation lecture 01
theory of computation lecture 01theory of computation lecture 01
theory of computation lecture 01
 
Theory of Computation
Theory of ComputationTheory of Computation
Theory of Computation
 
Partial compute function
Partial compute functionPartial compute function
Partial compute function
 
Infos2014
Infos2014Infos2014
Infos2014
 
Kleene's theorem
Kleene's theoremKleene's theorem
Kleene's theorem
 
Theory of computing
Theory of computingTheory of computing
Theory of computing
 
Turing machines
Turing machinesTuring machines
Turing machines
 
2014 31 okt presentatie Healthwise Congres
2014 31 okt presentatie Healthwise Congres2014 31 okt presentatie Healthwise Congres
2014 31 okt presentatie Healthwise Congres
 
FM calculus
FM calculusFM calculus
FM calculus
 
SESION 3 - MAYO 21 DE 2016Tiching
SESION 3 - MAYO 21 DE 2016TichingSESION 3 - MAYO 21 DE 2016Tiching
SESION 3 - MAYO 21 DE 2016Tiching
 
Reseña Contable
Reseña ContableReseña Contable
Reseña Contable
 
Guía de como dar formato a una diapositiva y como Trabajar con Diapositivas m...
Guía de como dar formato a una diapositiva y como Trabajar con Diapositivas m...Guía de como dar formato a una diapositiva y como Trabajar con Diapositivas m...
Guía de como dar formato a una diapositiva y como Trabajar con Diapositivas m...
 
Evaluation Question 6: Technology Table
Evaluation Question 6: Technology TableEvaluation Question 6: Technology Table
Evaluation Question 6: Technology Table
 
MATTS VISUAL AID
MATTS VISUAL AIDMATTS VISUAL AID
MATTS VISUAL AID
 
Akshat Chouhan SAP FI-1
Akshat Chouhan SAP FI-1Akshat Chouhan SAP FI-1
Akshat Chouhan SAP FI-1
 
CV Robert Dixon LCGI MBIFM
CV Robert Dixon LCGI MBIFMCV Robert Dixon LCGI MBIFM
CV Robert Dixon LCGI MBIFM
 
Анель Хасенова + аренда квартир + клиенты
Анель Хасенова + аренда квартир + клиентыАнель Хасенова + аренда квартир + клиенты
Анель Хасенова + аренда квартир + клиенты
 
Types of music
Types of musicTypes of music
Types of music
 
KHALIFA
KHALIFAKHALIFA
KHALIFA
 
Curriculum 2016_Eng
Curriculum 2016_EngCurriculum 2016_Eng
Curriculum 2016_Eng
 

Semelhante a theory of computation lecture 02

Regular expression (compiler)
Regular expression (compiler)Regular expression (compiler)
Regular expression (compiler)
Jagjit Wilku
 
Lesson 01.ppt
Lesson 01.pptLesson 01.ppt
Lesson 01.ppt
ImXaib
 

Semelhante a theory of computation lecture 02 (20)

Theory of Automata ___ Basis ...........
Theory of Automata ___ Basis ...........Theory of Automata ___ Basis ...........
Theory of Automata ___ Basis ...........
 
L_2_apl.pptx
L_2_apl.pptxL_2_apl.pptx
L_2_apl.pptx
 
Ch2 automata.pptx
Ch2 automata.pptxCh2 automata.pptx
Ch2 automata.pptx
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expression
 
Chapter2CDpdf__2021_11_26_09_19_08.pdf
Chapter2CDpdf__2021_11_26_09_19_08.pdfChapter2CDpdf__2021_11_26_09_19_08.pdf
Chapter2CDpdf__2021_11_26_09_19_08.pdf
 
Lexical analyzer
Lexical analyzerLexical analyzer
Lexical analyzer
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptx
 
Theory of Automata Lesson 01
 Theory of Automata Lesson 01  Theory of Automata Lesson 01
Theory of Automata Lesson 01
 
Module 1 TOC.pptx
Module 1 TOC.pptxModule 1 TOC.pptx
Module 1 TOC.pptx
 
Lesson-01-29092022-081117pm.ppt
Lesson-01-29092022-081117pm.pptLesson-01-29092022-081117pm.ppt
Lesson-01-29092022-081117pm.ppt
 
Theory of computation
Theory of computationTheory of computation
Theory of computation
 
01-Introduction&Languages.pdf
01-Introduction&Languages.pdf01-Introduction&Languages.pdf
01-Introduction&Languages.pdf
 
10651372.ppt
10651372.ppt10651372.ppt
10651372.ppt
 
Regular expression (compiler)
Regular expression (compiler)Regular expression (compiler)
Regular expression (compiler)
 
Lesson 04
Lesson 04Lesson 04
Lesson 04
 
Алексей Чеусов - Расчёсываем своё ЧСВ
Алексей Чеусов - Расчёсываем своё ЧСВАлексей Чеусов - Расчёсываем своё ЧСВ
Алексей Чеусов - Расчёсываем своё ЧСВ
 
hghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggghghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggg
 
9781284077247_PPTx_CH01.pptx
9781284077247_PPTx_CH01.pptx9781284077247_PPTx_CH01.pptx
9781284077247_PPTx_CH01.pptx
 
Lesson 01.ppt
Lesson 01.pptLesson 01.ppt
Lesson 01.ppt
 

Último

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Último (20)

How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 

theory of computation lecture 02

  • 1. Theory of Computation Lecture #2 Mahmoud Ali Ahmed
  • 2. Languages & Grammar Before discussing languages & grammar let us deal with some related issues. Alphabet: is defined as a nonempty finite set of symbols or letters such as {a1, a2, …, ak}. Particularly the alphabet for theory of computation is mostly the binary alphabet {0, 1}. Set of alphabet represented by 
  • 3. Languages & Grammar A string (word or sentence): is defied as a finite sequence of symbols over the set of alphabet (∑), e.g. aaabbbabbb is string over ∑ = {a, b}. A string might be represent by w. A string may have no symbol at all, in this case it is called the empty string / null string and denoted by or
  • 4. Note: Some times string (word/sentence) can be represented as function. e.g. A string x = x0 x1 x2 x3 … xn, which can be viewed as function as: x : [n] | x(k) = xk. where n is the length of the string x, which denoted by |x|, e.g. |aabbaab| = 7 
  • 5. Operations on strings For an alphabet Σ, given any two strings u: [m] → Σ and v: [n] → Σ, the concatenation u・v (also written as uv) of u and v is the string uv: [m + n] → Σ, defined such that:       nmimifmiv miifiu iuv 1)( ,1)( )( In particular uuu  
  • 6. Formal Languages Formal vs. Natural Languages Natural Languages: used by human to communicate. e.g. Arabic, English, … syntax is very complicated not completely specified
  • 7. Formal Languages Formal vs. Natural Languages Formal Language: specified by a well-defined sets of grammatical rules e.g. programming languages syntax completely defined by given grammar.
  • 8. Why study Formal Languages? Programming languages are formal. very useful for pattern matching. Important for research in natural language processing (NLP) with computers. Closely tied to study of abstract machines.
  • 9. Formal Languages Let be any finite set of symbols (possibly none), called an alphabet.  A word (string) over is any fine sequence of letters from .   A formal language is simply a set of strings
  • 10. Formal Languages *  defined as the set of all possible words over , including the empty word (denoted by ).   Example Let , then},{ ba },,,,,,,,,,{* baaabaaaabbbaabaaba
  • 11. A language over is defined as strings over i.e. a subset of    *  Examples: ∑ = {a, b}  aabaaa ,,,   8, *  xbax   oddisxbax  * ,   )()(, * xNxNbax ba 
  • 12. Example  ,,,,,,,,,* aabaaabbbaabaaba Let  ., ba Then  aabaaaL ,, The language is a finite language on . Note: Language can be infinite, and the most interesting languages are infinite.
  • 13. New language can be constructed using any of the set operations. As an example the union of tow languages over , is also a language over .   Having {as, so} and {if, soon, possible} as tow languages over the concatenation of the tow languages give another language over as follows.  {as, so} {if, soon, possible} = {asif, assoon, aspossible, soif, sosoon, sopossible}.
  • 14. Regular Expression & Language Definition: A regular expression over , that corresponding to a language, can be recursively defined as follows:  • ε is a Regular Expression indicates the language containing an empty string. (L (ε) = {ε}) • φ is a Regular Expression denoting an empty language. (L (φ) = { }) • a is a Regular Expression where L = {a}.
  • 15. Regular Expression & Language • If x is a Regular Expression denoting the language L(x) and y is a Regular Expression denoting the language L(y), then o x + y is a Regular Expression corresponding to the language L(x) ∪ L(y) where L(x + y) = L(x) ∪ L(y). o x . x is a Regular Expression corresponding to the language L(x) . L(y) where L(x. y) = L(x) . L(y). o R* is a Regular Expression corresponding to the language L(R*)where L(R*) = (L(R))*. • if we apply any of the above rules several times, they are Regular Expressions.
  • 16. A language over is a regular language if there is some regular expression over corresponding to it.  
  • 17. Examples of regular expression over ** 011   1* ** 110 MeaningExpression All words over contains exactly a single 0.  All words over containing at least one 1.  All words over that containing a substring 110.  }1,0{ (00 + 01 + 10 + 11)* All string of 0’s and 1’s of even length can be obtained by concatenating any combination of the strings 00, 01, 10 and 11 including ε
  • 18. MeaningExpression * )(  All words over ∑ with an even length * )(  All words over ∑ of length a multiple of three 101100   All words over ∑ starts and ends with the same symbol 011   All strings containing over ∑ that begin with 1 and ending with 01 (0|(1(01*0)*1))* All strings containing over ∑ contains binary numbers that are multiples of 3
  • 19. Formal Grammar Formal definition  ,,,, PSTVG  where, A generative grammar, which firstly proposed by Noam Chomsky in 1950s, considered as a grammar G that defined as a quadruple.
  • 20. is a finite set of objects called variables.V is a finite set of objects called terminal symbols.T is a special symbol called start variable.VS  is a finite set of productions.P V TIt is assumed that and are nonempty and disjoint
  • 21. Definition (L(G))          wSTwGL :)( Let be a grammar. Then the set ,,,, PSTVG  is the language generated by .G
  • 22. Example  ,,,, PSTVG  Consider a grammar G that defined as where, V = {S, B} T = {a, b, c} P consists of the following production rule S aBSc S abc Ba aB Bb bb
  • 23. L(G) may be derived to be consisted of the following strings: L(G) = {abc, aabbcc, aaabbbccc, …} Therefore L(G) can be represented as L(G) = {an bn cn | n>0} L(G) = {w ϵ {a, b, c}* | na(w) = nb(w) = nc(w)}
  • 24. Representation of Language using Graphs Transition Graph over is a finite directed graph in which every arrow (edge) is labeled by some word (possibly the empty word ( )). There is a least one vertex , labeled by a ( ) sign (such vertices are called initial vertices), and a (possibly empty set) of vertices, labeled by a ( ) sign (called the final vertices). A vertex can be both initial and final. T  * w  '' ''
  • 25.    ba, *   a b  bab,, Example Consider the following transition graphs over  ba,
  • 26. b a All words over beginning with a followed by a sb' ba, aa ba, ba, bb All words over containing two consecutive ( ) or two consecutive ( )  sa' sb'
  • 27. bbaa, baab, bbaa , baab, All words over containing an even number of ( ) and even number of ( )  sa' sb'  b aa ba, ba, All words over either starting with ( ) or containing ( ) .  b aa