SlideShare uma empresa Scribd logo
1 de 5
58
PART B
1. Show that L = {0n2 / n is an integer, n > 1} is not regular. (or) Show that the set L
= {0i2 |i > 1} not regular.(Nov/Dec2015) (Nov/Dec2014) (May/June2014)
SOLUTION:
Let i = n2 and L = { 0i / i > 1}.
The number of states is i > n.
Take string w = 0i
The length of the string |w| = i > n.
Assume xy = 0m, y = 0j , z = 0i-m
xykz = xy(y)k-1z
= 0m. 0j(k-1). 0i-m
= 0i. 0j(k-1)
Apply i = n2 xykz = 0n2 + j(k-1)
Apply k = 0 xykz = 0n2 – j L
Apply k = 0 xykz = 0n2 + j L
Thus the Language L is not a regular Language.
2. Discuss on regular Expression.(May/June 2016) (May/June2013)
REGULAR EXPRESSION:
The Language accepted by finite automata are easily described by simple
expression called regular expression. A regular expression is a string that describes
the whole set of strings according to certain syntax rules. These expressions are used
by many text editors and utilities to search bodies of text for certain patterns etc.
Let Σ be an alphabet. The regular expression over Σ and the sets they denote
are:
i. ε is a R.E, denotes empty set and Language L(ε) = { ε}.
ii. pie is a R.E denotes the set { } and Language L(pie) = { pie}.
iii. A variable represented in upper case like L is any language.
i. For each ‘a’ in Σ , ‘a’ is a R.E and denotes the set {a}.
ii. If r and s are regular expression, then
i. If ‘r’ and ‘s’ are R.E denoting the languages R and S respectively
then (r+s),
ii. (rs) and (r*) are R.E that denote the sets RUS, RS and R*
respectively..
59
3. Write a regular expression for set of strings that consist of alternating 0’s and
1’s. (May/June 2016)
Consider the regular expression for the language consisting of a single string 01.
The star operator is used to get an expression of all strings of the form 0101…01
The basic rules for RE tells us that 0 and 1 are expressions denoting the languages
{0} and {1}, respectively. If we concatenate the two expressions, we get a regular
expression for the language {01};
RE = 01
Now, to get all strings consisting of zero or more occurrences of 01,
Regular expression (01)* and get L(01)*.
Since it only includes strings beginning with 0. To account for strings that starts with 1
and strings that end with 0 or with 1:
(01)* + (10)*+ 0 (10)*+ 1(01)*
4. Prove that the following languages are not regular (May/June2013)
(Nov/Dec2013)
1. {02n | n > 1}
SOLUTION:
Let L be a regular language. The number of states are 2n > n.
Let w = 0i, i > 1 where, i = 2n.
w = xyz
|w| = 2n > n.
Assume xy = 0m, y = 0j, z = 0i-m
xykz = xy(y)k-1z
= 0m. 0j(k-1). 0i-m
= 0i + j(k-1)
Apply i = 2n xykz = 02n + j(k-1)
Apply k = 0 xykz = 02n - j L
Apply k = 1 xykz = 02n L
Apply k = 2 xykz = 02n + j L
Thus Language L = {02n | n > 1} is not a regular.
60
5. {ambnam+n | m > 1 and n > 1} (or) L = { 0m1n0m+n | m > 1 and n > 1}
SOLUTION:
Let L be a regular language. The number of states are 2m+2n > n.
.
w = ambnam+n
|w| = 2m+2n > n.
Assume xy = am, y = aj, z = an-m. bn1. am+n1
xykz = xy(y)k-1z
= am . aj(k-1) . an-m. bn1. am+n1
xykz = an + j(k-1) . bn1. am+n1
Apply k = 0 xykz = an - j . bn1. am+n1 L
Apply k = 1 xykz = an. bn1. am+n1 L
Apply k = 2 xykz = an + j . bn1. am+n1 L
Thus Language L = {ambnam+n |m>=1 and n>=1} is not a regular.
6. Derive a regular expression from the following given FA?
Sol:
q1 +q10.............(1)
q2=q11+q21 ...........(2)
q3=q20+q30+q31.......(3)
(2) q2=q11+q21
q2=q1
11* .........(4)
(1) q1 +q10 (Apply Arden’s
theorem)q1 0*
61
q1=0*
(4) 2=0*11*
q2=0*1*
Describe the language denoted by following regular expression
1. r.e. = (b* (aaa)* b*)*
Solution:
The language can be predicted from the regular expression by finding the meaning of it. We
will first split the regular expression as:
r.e. = (any combination of b's) (aaa)* (any combination of b's)
L = {The language consists of the string in which a's appear triples, there is no restriction on
the number of b's}
Write the regular expression for the language over ∑ = {0} having even length of the string.
Solution:
The regular expression has to be built for the language:
1. L = {ε, 00, 0000, 000000, ......}
The regular expression for the above language is:
1. R = (00)*
62

Mais conteúdo relacionado

Semelhante a PART B.docx

Semelhante a PART B.docx (20)

RegularExpressions.pdf
RegularExpressions.pdfRegularExpressions.pdf
RegularExpressions.pdf
 
Sequences
SequencesSequences
Sequences
 
Formal Languages and Automata Theory unit 2
Formal Languages and Automata Theory unit 2Formal Languages and Automata Theory unit 2
Formal Languages and Automata Theory unit 2
 
Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5
 
Unit ii
Unit iiUnit ii
Unit ii
 
Lecture5
Lecture5Lecture5
Lecture5
 
Imc2020 day1&2 problems&solutions
Imc2020 day1&2 problems&solutionsImc2020 day1&2 problems&solutions
Imc2020 day1&2 problems&solutions
 
Hw2 2017-spring
Hw2 2017-springHw2 2017-spring
Hw2 2017-spring
 
Dynamical systems solved ex
Dynamical systems solved exDynamical systems solved ex
Dynamical systems solved ex
 
Imc2017 day1-solutions
Imc2017 day1-solutionsImc2017 day1-solutions
Imc2017 day1-solutions
 
Lecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular LanguagesLecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular Languages
 
LDP.pdf
LDP.pdfLDP.pdf
LDP.pdf
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
regular expression
regular expressionregular expression
regular expression
 
Theory of Computation Regular Expressions, Minimisation & Pumping Lemma
Theory of Computation Regular Expressions, Minimisation & Pumping LemmaTheory of Computation Regular Expressions, Minimisation & Pumping Lemma
Theory of Computation Regular Expressions, Minimisation & Pumping Lemma
 
UNIT_-_II.docx
UNIT_-_II.docxUNIT_-_II.docx
UNIT_-_II.docx
 
Theory of Automata and formal languages unit 2
Theory of Automata and formal languages unit 2Theory of Automata and formal languages unit 2
Theory of Automata and formal languages unit 2
 
Vectors and Matrices: basis and dimension
Vectors and Matrices: basis and dimensionVectors and Matrices: basis and dimension
Vectors and Matrices: basis and dimension
 
Excel Homework Help
Excel Homework HelpExcel Homework Help
Excel Homework Help
 
Resumen material MIT
Resumen material MITResumen material MIT
Resumen material MIT
 

Último

An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Último (20)

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 

PART B.docx

  • 1. 58 PART B 1. Show that L = {0n2 / n is an integer, n > 1} is not regular. (or) Show that the set L = {0i2 |i > 1} not regular.(Nov/Dec2015) (Nov/Dec2014) (May/June2014) SOLUTION: Let i = n2 and L = { 0i / i > 1}. The number of states is i > n. Take string w = 0i The length of the string |w| = i > n. Assume xy = 0m, y = 0j , z = 0i-m xykz = xy(y)k-1z = 0m. 0j(k-1). 0i-m = 0i. 0j(k-1) Apply i = n2 xykz = 0n2 + j(k-1) Apply k = 0 xykz = 0n2 – j L Apply k = 0 xykz = 0n2 + j L Thus the Language L is not a regular Language. 2. Discuss on regular Expression.(May/June 2016) (May/June2013) REGULAR EXPRESSION: The Language accepted by finite automata are easily described by simple expression called regular expression. A regular expression is a string that describes the whole set of strings according to certain syntax rules. These expressions are used by many text editors and utilities to search bodies of text for certain patterns etc. Let Σ be an alphabet. The regular expression over Σ and the sets they denote are: i. ε is a R.E, denotes empty set and Language L(ε) = { ε}. ii. pie is a R.E denotes the set { } and Language L(pie) = { pie}. iii. A variable represented in upper case like L is any language. i. For each ‘a’ in Σ , ‘a’ is a R.E and denotes the set {a}. ii. If r and s are regular expression, then i. If ‘r’ and ‘s’ are R.E denoting the languages R and S respectively then (r+s), ii. (rs) and (r*) are R.E that denote the sets RUS, RS and R* respectively..
  • 2. 59 3. Write a regular expression for set of strings that consist of alternating 0’s and 1’s. (May/June 2016) Consider the regular expression for the language consisting of a single string 01. The star operator is used to get an expression of all strings of the form 0101…01 The basic rules for RE tells us that 0 and 1 are expressions denoting the languages {0} and {1}, respectively. If we concatenate the two expressions, we get a regular expression for the language {01}; RE = 01 Now, to get all strings consisting of zero or more occurrences of 01, Regular expression (01)* and get L(01)*. Since it only includes strings beginning with 0. To account for strings that starts with 1 and strings that end with 0 or with 1: (01)* + (10)*+ 0 (10)*+ 1(01)* 4. Prove that the following languages are not regular (May/June2013) (Nov/Dec2013) 1. {02n | n > 1} SOLUTION: Let L be a regular language. The number of states are 2n > n. Let w = 0i, i > 1 where, i = 2n. w = xyz |w| = 2n > n. Assume xy = 0m, y = 0j, z = 0i-m xykz = xy(y)k-1z = 0m. 0j(k-1). 0i-m = 0i + j(k-1) Apply i = 2n xykz = 02n + j(k-1) Apply k = 0 xykz = 02n - j L Apply k = 1 xykz = 02n L Apply k = 2 xykz = 02n + j L Thus Language L = {02n | n > 1} is not a regular.
  • 3. 60 5. {ambnam+n | m > 1 and n > 1} (or) L = { 0m1n0m+n | m > 1 and n > 1} SOLUTION: Let L be a regular language. The number of states are 2m+2n > n. . w = ambnam+n |w| = 2m+2n > n. Assume xy = am, y = aj, z = an-m. bn1. am+n1 xykz = xy(y)k-1z = am . aj(k-1) . an-m. bn1. am+n1 xykz = an + j(k-1) . bn1. am+n1 Apply k = 0 xykz = an - j . bn1. am+n1 L Apply k = 1 xykz = an. bn1. am+n1 L Apply k = 2 xykz = an + j . bn1. am+n1 L Thus Language L = {ambnam+n |m>=1 and n>=1} is not a regular. 6. Derive a regular expression from the following given FA? Sol: q1 +q10.............(1) q2=q11+q21 ...........(2) q3=q20+q30+q31.......(3) (2) q2=q11+q21 q2=q1 11* .........(4) (1) q1 +q10 (Apply Arden’s theorem)q1 0*
  • 4. 61 q1=0* (4) 2=0*11* q2=0*1* Describe the language denoted by following regular expression 1. r.e. = (b* (aaa)* b*)* Solution: The language can be predicted from the regular expression by finding the meaning of it. We will first split the regular expression as: r.e. = (any combination of b's) (aaa)* (any combination of b's) L = {The language consists of the string in which a's appear triples, there is no restriction on the number of b's} Write the regular expression for the language over ∑ = {0} having even length of the string. Solution: The regular expression has to be built for the language: 1. L = {ε, 00, 0000, 000000, ......} The regular expression for the above language is: 1. R = (00)*
  • 5. 62