SlideShare una empresa de 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

Más contenido relacionado

Similar a PART B.docx

RegularExpressions.pdf
RegularExpressions.pdfRegularExpressions.pdf
RegularExpressions.pdfImranBhatti58
 
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 2Srimatre K
 
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 5Dr. Maamoun Ahmed
 
Imc2020 day1&2 problems&solutions
Imc2020 day1&2 problems&solutionsImc2020 day1&2 problems&solutions
Imc2020 day1&2 problems&solutionsChristos Loizos
 
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 exMaths Tutoring
 
Lecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular LanguagesLecture: Regular Expressions and Regular Languages
Lecture: Regular Expressions and Regular LanguagesMarina Santini
 
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 LemmaRushabh2428
 
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 2Abhimanyu Mishra
 
Vectors and Matrices: basis and dimension
Vectors and Matrices: basis and dimensionVectors and Matrices: basis and dimension
Vectors and Matrices: basis and dimensionMarry Chriselle Rañola
 
Resumen material MIT
Resumen material MITResumen material MIT
Resumen material MITRawel Luciano
 

Similar 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

APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
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.pptxheathfieldcps1
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
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 ConsultingTechSoup
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 

Último (20)

APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
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
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
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
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 

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