SlideShare una empresa de Scribd logo
1 de 2
Descargar para leer sin conexión
1.).Write a cfg (contextÂfree grammar) for L = {a^n b^m c^k : k n + m n, m, k 0}.
2.).Write a cfg for L = {a^n b^n c^k : n 0, k 3}.
3).Write the grammar in #2 in CNF format.
Solution
Let G be the grammar with productions:
S EcC | aAE | AU A aA | B bB | C cC |
E aEc | F
F bFc |
U aUc | V
V bVc | bB
Note: L(E) = {an bmc k : k = n + m } (from 4(a) in Linz book) Let L1 = {an bmc k : k < n + m },
L2 = {an bmc k : k > n + m }
Claim: L(G) = L = L1 L2
Proof: Consider the leftmost productions following S Æ EcC S EcC * an bmc (n+m)cC * an
bmc (n+m)cck C an bmc (n+m)cck = an bmc (n+m+k+1) (where the first * follows from 4(a),
the second from k repetitions of { C cC }) Since (n+m) < (n+m+k+1), L(EcC) L2 L Consider the
leftmost productions following S aAE S aAE * aak AE aa k E * aak a n bmc (n+m)c =
a(n+k+1)bmc (n+m) (where the first * follows from k repetitions of { A aA }, the second from
4(a)) Since (n+m+k+1) > (n+m), L(aAE) L1 L Consider the leftmost productions following S
AU S AU * ak AU a k U * ak a n Ucn a k a n Vcn * ak a n bmVcmc n a k a n bmbBcmc n * ak a
n bmbbj Bcmc n ak a n bmbbj c mc n = a(k+n)b(m+j+1)c (m+n) (where the first, second, third
and fourth * are k, n, m, and j repetitions of { A aA }, { U aUc }, { V bVc }, and { B bB },
respectively)
Since ((k+n)+(m+j+1)) > (m+n), L(AU) L1 L L(G) = L(S) = L(EcC) L(aAE) L(AU) L1 L2 = L
Consider w L1, w = an bmc (n+m+k) for some n, m, k, with k > 0 Then w has the leftmost
derivation: S EcC * an bmc (n+m)cC * an bmc (n+m)cc(k-1)C an bmc (n+m)cck(k-1) = a n bmc
(n+m+k) = w L2 L(G) Consider w L2, w = a(n+j)b(m+k)c (n+m) for some j, k, m, n, with j+k >
0 If k = 0, w has the leftmost derivation: S aAE * aa(j-1)AE aa(j-1)E * aa(j-1)a n Ecn aa(j-1)a n
Fcn * aa(j- 1)a n bmFcmc n aa(j-1)a n bmc mc n = a(j+n)b(0+m)c (m+n) = w L1 (k = 0) L(G) If
k > 0, then w has the leftmost derivation: S AU * aj AU aj U * aj a n Ucn aj a n Vcn * aj a n
bmVcmc n a j a n bmbBcmc n aj a n bmbb(k-1)Bcmc n aj a n bmbb(k-1)c mc n = a(j+n)b(m+k)c
(m+n) = w
L1 (k > 0) L(G) L1 L(G)
L = L1 L2 L(G)
L = L(G)

Más contenido relacionado

Similar a 1-)-Write a cfg (contextfree grammar) for L - {a^n b^m c^k - k n + m.docx

easy step on how to solve slope deflection
easy step on how to solve slope deflectioneasy step on how to solve slope deflection
easy step on how to solve slope deflectionAlmasdan Alih
 
Solving the energy problem of helium final report
Solving the energy problem of helium final reportSolving the energy problem of helium final report
Solving the energy problem of helium final reportJamesMa54
 
A Case History In Interactive Problem-Solving
A Case History In Interactive Problem-SolvingA Case History In Interactive Problem-Solving
A Case History In Interactive Problem-SolvingLori Moore
 
Solutions manual for fitzgerald and kingsleys electric machinery 7th edition ...
Solutions manual for fitzgerald and kingsleys electric machinery 7th edition ...Solutions manual for fitzgerald and kingsleys electric machinery 7th edition ...
Solutions manual for fitzgerald and kingsleys electric machinery 7th edition ...crush424
 
Digital logic circuits important question and answers for 5 units
Digital logic circuits important question and answers for 5 unitsDigital logic circuits important question and answers for 5 units
Digital logic circuits important question and answers for 5 unitsLekashri Subramanian
 
Higher formal homeworks unit 2
Higher formal homeworks   unit 2Higher formal homeworks   unit 2
Higher formal homeworks unit 2sjamaths
 
Graph for Coulomb damped oscillation
Graph for Coulomb damped oscillationGraph for Coulomb damped oscillation
Graph for Coulomb damped oscillationphanhung20
 
Notes and formulae mathematics
Notes and formulae mathematicsNotes and formulae mathematics
Notes and formulae mathematicsZainonie Ma'arof
 
Form 5 Additional Maths Note
Form 5 Additional Maths NoteForm 5 Additional Maths Note
Form 5 Additional Maths NoteChek Wei Tan
 
Math cad prime quadratic equation derivation
Math cad prime   quadratic equation derivationMath cad prime   quadratic equation derivation
Math cad prime quadratic equation derivationJulio Banks
 
Add math may june 2016 p1
Add math may june 2016 p1Add math may june 2016 p1
Add math may june 2016 p1Don Cunningham
 
IIT Jam math 2016 solutions BY Trajectoryeducation
IIT Jam math 2016 solutions BY TrajectoryeducationIIT Jam math 2016 solutions BY Trajectoryeducation
IIT Jam math 2016 solutions BY TrajectoryeducationDev Singh
 

Similar a 1-)-Write a cfg (contextfree grammar) for L - {a^n b^m c^k - k n + m.docx (18)

easy step on how to solve slope deflection
easy step on how to solve slope deflectioneasy step on how to solve slope deflection
easy step on how to solve slope deflection
 
Solving the energy problem of helium final report
Solving the energy problem of helium final reportSolving the energy problem of helium final report
Solving the energy problem of helium final report
 
A Case History In Interactive Problem-Solving
A Case History In Interactive Problem-SolvingA Case History In Interactive Problem-Solving
A Case History In Interactive Problem-Solving
 
Solutions manual for fitzgerald and kingsleys electric machinery 7th edition ...
Solutions manual for fitzgerald and kingsleys electric machinery 7th edition ...Solutions manual for fitzgerald and kingsleys electric machinery 7th edition ...
Solutions manual for fitzgerald and kingsleys electric machinery 7th edition ...
 
Đề Thi HK2 Toán 9 - THCS Hưng Long
Đề Thi HK2 Toán 9 - THCS  Hưng LongĐề Thi HK2 Toán 9 - THCS  Hưng Long
Đề Thi HK2 Toán 9 - THCS Hưng Long
 
Digital logic circuits important question and answers for 5 units
Digital logic circuits important question and answers for 5 unitsDigital logic circuits important question and answers for 5 units
Digital logic circuits important question and answers for 5 units
 
Higher formal homeworks unit 2
Higher formal homeworks   unit 2Higher formal homeworks   unit 2
Higher formal homeworks unit 2
 
Figures
FiguresFigures
Figures
 
3rd semester Computer Science and Information Science Engg (2013 December) Q...
3rd  semester Computer Science and Information Science Engg (2013 December) Q...3rd  semester Computer Science and Information Science Engg (2013 December) Q...
3rd semester Computer Science and Information Science Engg (2013 December) Q...
 
Graph for Coulomb damped oscillation
Graph for Coulomb damped oscillationGraph for Coulomb damped oscillation
Graph for Coulomb damped oscillation
 
Notes and formulae mathematics
Notes and formulae mathematicsNotes and formulae mathematics
Notes and formulae mathematics
 
Form 5 Additional Maths Note
Form 5 Additional Maths NoteForm 5 Additional Maths Note
Form 5 Additional Maths Note
 
Math cad prime quadratic equation derivation
Math cad prime   quadratic equation derivationMath cad prime   quadratic equation derivation
Math cad prime quadratic equation derivation
 
Electrostatics
ElectrostaticsElectrostatics
Electrostatics
 
Add math may june 2016 p1
Add math may june 2016 p1Add math may june 2016 p1
Add math may june 2016 p1
 
1st and 2and Semester Chemistry Stream (2014-December) Question Papers
1st and 2and Semester Chemistry Stream (2014-December) Question Papers1st and 2and Semester Chemistry Stream (2014-December) Question Papers
1st and 2and Semester Chemistry Stream (2014-December) Question Papers
 
IIT Jam math 2016 solutions BY Trajectoryeducation
IIT Jam math 2016 solutions BY TrajectoryeducationIIT Jam math 2016 solutions BY Trajectoryeducation
IIT Jam math 2016 solutions BY Trajectoryeducation
 
Funções 3
Funções 3Funções 3
Funções 3
 

Más de todd991

12-8 On August 3- 2014- the firm of Chapelle- Rock- and Pryor decided.docx
12-8 On August 3- 2014- the firm of Chapelle- Rock- and Pryor decided.docx12-8 On August 3- 2014- the firm of Chapelle- Rock- and Pryor decided.docx
12-8 On August 3- 2014- the firm of Chapelle- Rock- and Pryor decided.docxtodd991
 
16 Additional data obtained from an examination of the accounts in the.docx
16 Additional data obtained from an examination of the accounts in the.docx16 Additional data obtained from an examination of the accounts in the.docx
16 Additional data obtained from an examination of the accounts in the.docxtodd991
 
16- Here is a recursive method that returns the smallest character in.docx
16- Here is a recursive method that returns the smallest character in.docx16- Here is a recursive method that returns the smallest character in.docx
16- Here is a recursive method that returns the smallest character in.docxtodd991
 
14-30 (Substantive tests of accounts receivable) The following situati.docx
14-30 (Substantive tests of accounts receivable) The following situati.docx14-30 (Substantive tests of accounts receivable) The following situati.docx
14-30 (Substantive tests of accounts receivable) The following situati.docxtodd991
 
14- Consider the following pairs of frequencies- i- 200 Hz- 304 Hz ii-.docx
14- Consider the following pairs of frequencies- i- 200 Hz- 304 Hz ii-.docx14- Consider the following pairs of frequencies- i- 200 Hz- 304 Hz ii-.docx
14- Consider the following pairs of frequencies- i- 200 Hz- 304 Hz ii-.docxtodd991
 
14 Income tax is estimated at 40- of income- What factors other than e.docx
14 Income tax is estimated at 40- of income- What factors other than e.docx14 Income tax is estimated at 40- of income- What factors other than e.docx
14 Income tax is estimated at 40- of income- What factors other than e.docxtodd991
 
14- Under the direct charge-off method of dealing with uncollectible a.docx
14- Under the direct charge-off method of dealing with uncollectible a.docx14- Under the direct charge-off method of dealing with uncollectible a.docx
14- Under the direct charge-off method of dealing with uncollectible a.docxtodd991
 
13) In the table below- fl in the name and formula for the oxyanions i.docx
13) In the table below- fl in the name and formula for the oxyanions i.docx13) In the table below- fl in the name and formula for the oxyanions i.docx
13) In the table below- fl in the name and formula for the oxyanions i.docxtodd991
 
13- The molecule below shows five distinct signals on -'H-NMR- Fill in.docx
13- The molecule below shows five distinct signals on -'H-NMR- Fill in.docx13- The molecule below shows five distinct signals on -'H-NMR- Fill in.docx
13- The molecule below shows five distinct signals on -'H-NMR- Fill in.docxtodd991
 
13 Wallace Inc-- a developer of radiology equipment- has stock outstan (1).docx
13 Wallace Inc-- a developer of radiology equipment- has stock outstan (1).docx13 Wallace Inc-- a developer of radiology equipment- has stock outstan (1).docx
13 Wallace Inc-- a developer of radiology equipment- has stock outstan (1).docxtodd991
 
11-5 Accrued Product Warranty Lowe Manufacturing Co- warrants its prod (1).docx
11-5 Accrued Product Warranty Lowe Manufacturing Co- warrants its prod (1).docx11-5 Accrued Product Warranty Lowe Manufacturing Co- warrants its prod (1).docx
11-5 Accrued Product Warranty Lowe Manufacturing Co- warrants its prod (1).docxtodd991
 
11-5 Accrued Product Warranty Lowe Manufacturing Co- warrants its prod.docx
11-5 Accrued Product Warranty Lowe Manufacturing Co- warrants its prod.docx11-5 Accrued Product Warranty Lowe Manufacturing Co- warrants its prod.docx
11-5 Accrued Product Warranty Lowe Manufacturing Co- warrants its prod.docxtodd991
 
12- It is a term used in chemistry- to describe a system in which a or.docx
12- It is a term used in chemistry- to describe a system in which a or.docx12- It is a term used in chemistry- to describe a system in which a or.docx
12- It is a term used in chemistry- to describe a system in which a or.docxtodd991
 
11- Packer Company- which has only one product- has provided the follo.docx
11- Packer Company- which has only one product- has provided the follo.docx11- Packer Company- which has only one product- has provided the follo.docx
11- Packer Company- which has only one product- has provided the follo.docxtodd991
 
11-23 (Objective 11-2) During audit planning- an auditor obtained the.docx
11-23 (Objective 11-2) During audit planning- an auditor obtained the.docx11-23 (Objective 11-2) During audit planning- an auditor obtained the.docx
11-23 (Objective 11-2) During audit planning- an auditor obtained the.docxtodd991
 
10- Which of the following statements is correct- Select one- a- Metho.docx
10- Which of the following statements is correct- Select one- a- Metho.docx10- Which of the following statements is correct- Select one- a- Metho.docx
10- Which of the following statements is correct- Select one- a- Metho.docxtodd991
 
10- Consider the following data structure used for implementing a link.docx
10- Consider the following data structure used for implementing a link.docx10- Consider the following data structure used for implementing a link.docx
10- Consider the following data structure used for implementing a link.docxtodd991
 
10--17-14 pointsOBIn Phys7 5-2-003- What is the significance of absolu.docx
10--17-14 pointsOBIn Phys7 5-2-003- What is the significance of absolu.docx10--17-14 pointsOBIn Phys7 5-2-003- What is the significance of absolu.docx
10--17-14 pointsOBIn Phys7 5-2-003- What is the significance of absolu.docxtodd991
 
10- Answer the questions based on the following Iron-Carbon diagram- 1.docx
10- Answer the questions based on the following Iron-Carbon diagram- 1.docx10- Answer the questions based on the following Iron-Carbon diagram- 1.docx
10- Answer the questions based on the following Iron-Carbon diagram- 1.docxtodd991
 
10) Define heat- A) the flow of energy caused by a chemical reaction B.docx
10) Define heat- A) the flow of energy caused by a chemical reaction B.docx10) Define heat- A) the flow of energy caused by a chemical reaction B.docx
10) Define heat- A) the flow of energy caused by a chemical reaction B.docxtodd991
 

Más de todd991 (20)

12-8 On August 3- 2014- the firm of Chapelle- Rock- and Pryor decided.docx
12-8 On August 3- 2014- the firm of Chapelle- Rock- and Pryor decided.docx12-8 On August 3- 2014- the firm of Chapelle- Rock- and Pryor decided.docx
12-8 On August 3- 2014- the firm of Chapelle- Rock- and Pryor decided.docx
 
16 Additional data obtained from an examination of the accounts in the.docx
16 Additional data obtained from an examination of the accounts in the.docx16 Additional data obtained from an examination of the accounts in the.docx
16 Additional data obtained from an examination of the accounts in the.docx
 
16- Here is a recursive method that returns the smallest character in.docx
16- Here is a recursive method that returns the smallest character in.docx16- Here is a recursive method that returns the smallest character in.docx
16- Here is a recursive method that returns the smallest character in.docx
 
14-30 (Substantive tests of accounts receivable) The following situati.docx
14-30 (Substantive tests of accounts receivable) The following situati.docx14-30 (Substantive tests of accounts receivable) The following situati.docx
14-30 (Substantive tests of accounts receivable) The following situati.docx
 
14- Consider the following pairs of frequencies- i- 200 Hz- 304 Hz ii-.docx
14- Consider the following pairs of frequencies- i- 200 Hz- 304 Hz ii-.docx14- Consider the following pairs of frequencies- i- 200 Hz- 304 Hz ii-.docx
14- Consider the following pairs of frequencies- i- 200 Hz- 304 Hz ii-.docx
 
14 Income tax is estimated at 40- of income- What factors other than e.docx
14 Income tax is estimated at 40- of income- What factors other than e.docx14 Income tax is estimated at 40- of income- What factors other than e.docx
14 Income tax is estimated at 40- of income- What factors other than e.docx
 
14- Under the direct charge-off method of dealing with uncollectible a.docx
14- Under the direct charge-off method of dealing with uncollectible a.docx14- Under the direct charge-off method of dealing with uncollectible a.docx
14- Under the direct charge-off method of dealing with uncollectible a.docx
 
13) In the table below- fl in the name and formula for the oxyanions i.docx
13) In the table below- fl in the name and formula for the oxyanions i.docx13) In the table below- fl in the name and formula for the oxyanions i.docx
13) In the table below- fl in the name and formula for the oxyanions i.docx
 
13- The molecule below shows five distinct signals on -'H-NMR- Fill in.docx
13- The molecule below shows five distinct signals on -'H-NMR- Fill in.docx13- The molecule below shows five distinct signals on -'H-NMR- Fill in.docx
13- The molecule below shows five distinct signals on -'H-NMR- Fill in.docx
 
13 Wallace Inc-- a developer of radiology equipment- has stock outstan (1).docx
13 Wallace Inc-- a developer of radiology equipment- has stock outstan (1).docx13 Wallace Inc-- a developer of radiology equipment- has stock outstan (1).docx
13 Wallace Inc-- a developer of radiology equipment- has stock outstan (1).docx
 
11-5 Accrued Product Warranty Lowe Manufacturing Co- warrants its prod (1).docx
11-5 Accrued Product Warranty Lowe Manufacturing Co- warrants its prod (1).docx11-5 Accrued Product Warranty Lowe Manufacturing Co- warrants its prod (1).docx
11-5 Accrued Product Warranty Lowe Manufacturing Co- warrants its prod (1).docx
 
11-5 Accrued Product Warranty Lowe Manufacturing Co- warrants its prod.docx
11-5 Accrued Product Warranty Lowe Manufacturing Co- warrants its prod.docx11-5 Accrued Product Warranty Lowe Manufacturing Co- warrants its prod.docx
11-5 Accrued Product Warranty Lowe Manufacturing Co- warrants its prod.docx
 
12- It is a term used in chemistry- to describe a system in which a or.docx
12- It is a term used in chemistry- to describe a system in which a or.docx12- It is a term used in chemistry- to describe a system in which a or.docx
12- It is a term used in chemistry- to describe a system in which a or.docx
 
11- Packer Company- which has only one product- has provided the follo.docx
11- Packer Company- which has only one product- has provided the follo.docx11- Packer Company- which has only one product- has provided the follo.docx
11- Packer Company- which has only one product- has provided the follo.docx
 
11-23 (Objective 11-2) During audit planning- an auditor obtained the.docx
11-23 (Objective 11-2) During audit planning- an auditor obtained the.docx11-23 (Objective 11-2) During audit planning- an auditor obtained the.docx
11-23 (Objective 11-2) During audit planning- an auditor obtained the.docx
 
10- Which of the following statements is correct- Select one- a- Metho.docx
10- Which of the following statements is correct- Select one- a- Metho.docx10- Which of the following statements is correct- Select one- a- Metho.docx
10- Which of the following statements is correct- Select one- a- Metho.docx
 
10- Consider the following data structure used for implementing a link.docx
10- Consider the following data structure used for implementing a link.docx10- Consider the following data structure used for implementing a link.docx
10- Consider the following data structure used for implementing a link.docx
 
10--17-14 pointsOBIn Phys7 5-2-003- What is the significance of absolu.docx
10--17-14 pointsOBIn Phys7 5-2-003- What is the significance of absolu.docx10--17-14 pointsOBIn Phys7 5-2-003- What is the significance of absolu.docx
10--17-14 pointsOBIn Phys7 5-2-003- What is the significance of absolu.docx
 
10- Answer the questions based on the following Iron-Carbon diagram- 1.docx
10- Answer the questions based on the following Iron-Carbon diagram- 1.docx10- Answer the questions based on the following Iron-Carbon diagram- 1.docx
10- Answer the questions based on the following Iron-Carbon diagram- 1.docx
 
10) Define heat- A) the flow of energy caused by a chemical reaction B.docx
10) Define heat- A) the flow of energy caused by a chemical reaction B.docx10) Define heat- A) the flow of energy caused by a chemical reaction B.docx
10) Define heat- A) the flow of energy caused by a chemical reaction B.docx
 

Último

AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxAUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxiammrhaywood
 
Diploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfDiploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfMohonDas
 
Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.raviapr7
 
How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17Celine George
 
What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?TechSoup
 
How to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesHow to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesCeline George
 
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRADUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRATanmoy Mishra
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...raviapr7
 
How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17Celine George
 
HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfMohonDas
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxDr. Santhosh Kumar. N
 
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdfP4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdfYu Kanazawa / Osaka University
 
How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17Celine George
 
Philosophy of Education and Educational Philosophy
Philosophy of Education  and Educational PhilosophyPhilosophy of Education  and Educational Philosophy
Philosophy of Education and Educational PhilosophyShuvankar Madhu
 
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxraviapr7
 
UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024UKCGE
 
The Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsThe Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsEugene Lysak
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17Celine George
 
3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptxmary850239
 

Último (20)

AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxAUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
 
Diploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfDiploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdf
 
Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.
 
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdfPersonal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
 
How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17
 
What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?
 
How to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesHow to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 Sales
 
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRADUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...
 
How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17
 
HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdf
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptx
 
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdfP4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
 
How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17
 
Philosophy of Education and Educational Philosophy
Philosophy of Education  and Educational PhilosophyPhilosophy of Education  and Educational Philosophy
Philosophy of Education and Educational Philosophy
 
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptx
 
UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024
 
The Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsThe Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George Wells
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17
 
3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptx
 

1-)-Write a cfg (contextfree grammar) for L - {a^n b^m c^k - k n + m.docx

  • 1. 1.).Write a cfg (contextÂfree grammar) for L = {a^n b^m c^k : k n + m n, m, k 0}. 2.).Write a cfg for L = {a^n b^n c^k : n 0, k 3}. 3).Write the grammar in #2 in CNF format. Solution Let G be the grammar with productions: S EcC | aAE | AU A aA | B bB | C cC | E aEc | F F bFc | U aUc | V V bVc | bB Note: L(E) = {an bmc k : k = n + m } (from 4(a) in Linz book) Let L1 = {an bmc k : k < n + m }, L2 = {an bmc k : k > n + m } Claim: L(G) = L = L1 L2 Proof: Consider the leftmost productions following S Æ EcC S EcC * an bmc (n+m)cC * an bmc (n+m)cck C an bmc (n+m)cck = an bmc (n+m+k+1) (where the first * follows from 4(a), the second from k repetitions of { C cC }) Since (n+m) < (n+m+k+1), L(EcC) L2 L Consider the leftmost productions following S aAE S aAE * aak AE aa k E * aak a n bmc (n+m)c = a(n+k+1)bmc (n+m) (where the first * follows from k repetitions of { A aA }, the second from 4(a)) Since (n+m+k+1) > (n+m), L(aAE) L1 L Consider the leftmost productions following S AU S AU * ak AU a k U * ak a n Ucn a k a n Vcn * ak a n bmVcmc n a k a n bmbBcmc n * ak a n bmbbj Bcmc n ak a n bmbbj c mc n = a(k+n)b(m+j+1)c (m+n) (where the first, second, third and fourth * are k, n, m, and j repetitions of { A aA }, { U aUc }, { V bVc }, and { B bB }, respectively)
  • 2. Since ((k+n)+(m+j+1)) > (m+n), L(AU) L1 L L(G) = L(S) = L(EcC) L(aAE) L(AU) L1 L2 = L Consider w L1, w = an bmc (n+m+k) for some n, m, k, with k > 0 Then w has the leftmost derivation: S EcC * an bmc (n+m)cC * an bmc (n+m)cc(k-1)C an bmc (n+m)cck(k-1) = a n bmc (n+m+k) = w L2 L(G) Consider w L2, w = a(n+j)b(m+k)c (n+m) for some j, k, m, n, with j+k > 0 If k = 0, w has the leftmost derivation: S aAE * aa(j-1)AE aa(j-1)E * aa(j-1)a n Ecn aa(j-1)a n Fcn * aa(j- 1)a n bmFcmc n aa(j-1)a n bmc mc n = a(j+n)b(0+m)c (m+n) = w L1 (k = 0) L(G) If k > 0, then w has the leftmost derivation: S AU * aj AU aj U * aj a n Ucn aj a n Vcn * aj a n bmVcmc n a j a n bmbBcmc n aj a n bmbb(k-1)Bcmc n aj a n bmbb(k-1)c mc n = a(j+n)b(m+k)c (m+n) = w L1 (k > 0) L(G) L1 L(G) L = L1 L2 L(G) L = L(G)