SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Similaire à 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
 

Similaire à 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
 

Dernier

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
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
 
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
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
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
 
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
 
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
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 

Dernier (20)

Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
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...
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.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 )
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
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
 
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
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
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
 
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
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........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