0% found this document useful (0 votes)
85 views19 pages

CS3103-1 - Toc - Lesson Plan

Uploaded by

varun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views19 pages

CS3103-1 - Toc - Lesson Plan

Uploaded by

varun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Nitte(DU) established under Section 3 of UGC Act 1956 | Accredited with ‘A+’ Grade by NAAC

Department of Computer Science & Engineering

COURSE PLAN
Semester: V Year: 2024-25
Course Title: Theory of Computation Course code: CS3103-1
Teaching Hrs: 40 SEE marks: 50
Examination hrs: 03 CIE marks:50
Lesson plan prepared by Mrs.Shwetha GK Total marks:100
Verified by :

Prerequisites: The subject requires the student to know basic design of machines, the
relation between formal languages and programming languages, and their applications.
Course Objectives:
This Course will enable students to:
1. Outline the theory behind the basic design of machines, the relation between formal
languages and programming languages, and their applications.
2. Make use of regular expressions, find the equivalence between finite automata and
regular languages, and identify non-regular languages.
3. Design context-free grammars along with simplification of grammars.
4. Get the idea of designing pushdown automata, find the equivalence between context-
free languages and pushdown automata, and identify non-context-free languages.
5. Tell how Turing machines solve any computational process carried by present-day
computers, their design, and get the feeling of undecidability concept.
Course Outcomes:
Upon completion of this course, students will be able to:
1. Outline the fundamental understanding of the core concepts in automata theory and
formal languages and its applications. Discover finite automata for different language
classes. Apply the procedure to convert deterministic finite automata to non-deterministic
finite automata.
2. Find the regular expression for a given language and illustrate equivalence between
finite automata and regular languages. Show the properties of regular languages and
minimize the given finite automata.
3. Discover context-free grammars for different language classes. Demonstrate the
ambiguity and unambiguous grammars.
4. Discover Pushdown automata for different language classes.
5. Translate the context-free grammars from one form to another. Discover Turing
machines for different language classes. Explain the class of languages and their
relationship.
COURSE ARTICULATION MATRIX:

Table-1: Mapping of COs to PIs, POs


and BTL
Course Program
Performance Bloom's
Outcomes Outcomes
Indicators Taxonomy
(COs) (POs)
(PI) Level (BTL)
Addressed
CO1 1, 2, 1.1.1, 1.4.1, 2.3.2, L4
3 3.2.1

CO2 1, 2 1.1.1, 1.4.1, 2.1.2 L2

CO3 1, 2, 1.1.1, 1.4.1, 2.3.2, L4


3 3.2.1
CO4 1, 2, 1.4.1, 2.1.2, 3.2.1 L4
3
CO5 1, 2, 1.4.1, 2.1.2, 3.2.1 L4
3

Table-2: Mapping Levels of COs to POs /


PSOs
COs Program Outcomes (POs) PSOs
1 2 3 4 5 6 7 8 9 10 11 12 1 2
CO1 2 2 1 - - - - - 1 - - - 3 -
CO2 2 3 1 - - - - - - - - - 2 -
CO3 2 2 1 - - - - - 1 - - - 3 -
CO4 2 2 - - - - - - 1 - - - 3 -
CO5 2 2 - - - - - - 1 - - - 3 -
3: Substantial (High) 2: Moderate (Medium) 1: Poor (Low)
Course Content
Theory of Computation
Course Code : CS3103-1 CIE Marks : 50
Teaching Hours /Week (L:T:P:S) : 3-0-0-0 SEE Marks : 50
Total Hours : 40 Credits : 03

UNIT - I
AUTOMATA:
Why study automata theory, Central concepts of automata theory.
FINITE AUTOMATA:
Deterministic Finite automata, Nondeterministic finite automata, An application: Text search,
Finite automata with epsilon-transitions.
REGULAR EXPRESSIONS AND LANGUAGES:
Regular expressions, Finite automata and Regular expressions, Applications of regular
expressions.
PROPERTIES OF REGULAR LANGUAGES:
Proving languages not to be regular.
(Text Book-1: Chapter 1: 1.1, 1.5; Chapter 2: 2.1 to 2.5; Chapter 3: 3.1, 3.2.2, 3.2.3, 3.3;
Chapter 4: 4.1)
15 Hours
UNIT – II
PROPERTIES OF REGULAR LANGUAGES:
Closure properties of regular languages, Equivalence and minimization of automata.
CONTEXT-FREE GRAMMARS AND LANGUAGES
Context free grammars – Examples and Definitions, More Examples, Derivation Trees and
Ambiguity, Unambiguous CFG for algebraic expressions.

PUSHDOWN AUTOMATA
Definition of the Pushdown Automata, Language accepted by a PDA.
(Text Book-1: Chapter 4: 4.2, 4.4; Chapter 6: 6.1, 6.2.1, 6.2.2; Text Book-2: Chapter 6:
6.1, 6.2, 6.4, 6.5) 15 Hours

UNIT – III
PROPERTIES OF CONTEXT-FREE LANGUAGES:
Normal forms for CFGs.
TURING MACHINES:
The Turing machine, Extensions to the Basic Turing Machines.
(Text Book-1: Chapter 7: 7.1; Chapter 8: 8.2, 8.4)
RECURSIVELY ENUMERABLE LANGUAGES
Recursively enumerable languages, The Chomsky hierarchy.
(Text Book-2: Chapter 10: 10.1, 10.4)
10 Hours

TEXTBOOKS:
1. J.P. Hopcroft, Rajeev Motwani, and J.D. Ullman, “Introduction to Automata Theory,
Languages and Computation”, Third Edition, Pearson Education 2012.
2. John C Martin, “Introduction to languages and The Theory of Computation”, Third
Edition, Tata McGraw Hill, 2008.
REFERENCE BOOKS:
1. Peter Linz, “An Introduction to formal languages and Automata”, Fourth Edition,
Narosa Publishing House, 2011.
2. Michael Sipser, “Introduction to the Theory of Computation”, Third Edition, MIT
Press, 2014.

E-BOOKS / ONLINE RESOURCES:


1. https://www.eecs.wsu.edu/~ananth/CptS317/Lectures/index.htm
2. https://www.cs.virginia.edu/~robins/Sipser_2006_Second_Edition_Problems.pdf
3. http://infocat.ucpel.tche.br/disc/lfa/docs/IAT.pdf

MOOC:
1. http://nptel.ac.in/courses/106106049/
2. http://aduni.org/courses/theory/index.php?view=cw
3. https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-045j-
automata-computability-and-complexity-spring-2011/lecture-note*s/
There will be 8 questions of 20 marks each in the question paper divided into3 Units as
per the syllabi & contact hours and the student will have to answer 5 full questions,
selecting 2 full questions from Unit - I & Unit – II and 1 full question from Unit – III.
Evaluation Scheme:
CIE Scheme
Assessment Weightage in Marks

MSE – 1 20

MSE – 2 20

Tasks 10

Total 50

Scheme for Semester End Examination (SEE)


Unit 4 Questions to be set for 20 Chapter Instructions
marks each numbers
I Q.No.1 and Q.No.2 (Text Book-1: Answer any two question
Chapter 1: 1.1,
Q.No.3 and Q.No.4
1.5; Chapter 2:
2.1 to 2.5;
Chapter 3: 3.1,
3.2.2, 3.2.3, 3.3;
Chapter 4: 4.1)
II Q.No.5 and Q.No.6 (Textbook-1: Answer any two question
Chapter 4: 4.2,
Q.No.7 and Q.No.8
4.4; Chapter 6:
6.1, 6.2.1, 6.2.2;
Text Book-2:
Chapter 6:
6.1, 6.2, 6.4, 6.5)
III Q.No.9 and Q.No.10 (Text Book-2: Answer any one question
Chapter 10: 10.1,
(2 questions to be set for 20
10.4)
marks each)

Course Unitization for MSE and SEE


Unit Chapter No. of No. of Questions in No. of
hours Questions in
SEE
MSE - 1 MSE - 2
1– Why study 1 1 - 3
automata theory,
Central concepts of
automata theory.

2– Deterministic 8 2 -
I Finite automata,
Nondeterministic
finite automata,
An application:
Text search,
Finite automata
with epsilon-
transitions.

3. Regular 4 2 -
expressions,
Finite automata
and Regular
expressions,
Applications of
regular
expressions
4. Properties of regular 2 1 -
languages:
Proving languages not
to be regular.

II 1. Closure properties 3 - 2 3
of regular languages,
Equivalence and
minimization of
automata.
2. Context free 4 - 1
grammars – Examples
and Definitions
3. Derivation Trees 4 - 2
and Ambiguity,
Unambiguous CFG
for algebraic
expressions.
4. Definition of the 4 - 1
Pushdown Automata,
Language accepted by
a PDA.
III 1.Normal forms for 2 2
CFGs.
2. The Turing 4
machine, Extensions
to the Basic Turing
Machines.
3. Recursively 4
enumerable languages
and Recursive, The
Chomsky hierarchy.
Note: i) There will be MCQs for 20 marks in part -A ana in part-B there will be questions to
answer where each full question carries 16 marks and may consist of sub-questions.
ii) No mixing of questions is allowed in SEE.
iii) Questions from Unit I, II are generally are asked for MSE – 1 & 2.

Date: Head of Department

Chapter wise plan


Course code and title: 21CS501: Theory of Computation
Unit – I Chapter 1,2,3,4 Planned hours: 15
AUTOMATA, FINITE AUTOMATA,
REGULAR EXPRESSIONS AND
LANGUAGES, PROPERTIES OF
REGULAR LANGUAGES
Learning objectives:
At the end of this unit, the student will be able to –
1. Able to visualize languages and finite state machines and their equivalence.
2. Able to tell languages by the FSMs.
3. Able to differentiate Deterministic and Non-Deterministic automata.
4. Able to convert and prove equivalence between NFA and DFA and NFA without null
transitions and DFA.
5. Able to design finite automata with outputs and prove their equivalence.
6. Able to know the importance of regular sets & expressions.
7. Able to construct FAs for REs and vice versa.
8. Able to use pumping lemma for show that a language is not regular.

Lesson Schedule: Class Portion Covered per hour (estimate)


1. Why study automata theory, Central concepts of automata theory.
2. DFA
3. Design of DFA
4. Design of DFA
5. Design of DFA
6. Conversion from NFA to DFA
7. Conversion from NFA to DFA Conversion from ℇ-NFA to DFA
8. Conversion from ℇ-NFA to DFA Applications of text search.
9. Applications of text search
10. Regular expressions
11. Finite automata and Regular
12. Finite automata and Regular
13. Applications of regular expressions
14. Proving languages not to be regular.
15. Proving languages not to be regular.
Total number of hours: 15
Model questions:
1. Define: i) Alphabet ii) String iii) Power of an alphabet. Each with an Example
2. Construct DFA for the following languages
i)String of 0’s and 1’s having three consecutive 0’s
ii)L={w: |w|mod5=0}Where ∑={a}
3. Build a DFA for the following NFA.
δ a B
→ q0 { q0 , q 1 } { q0 }
q1 ɸ { q2 }
*q2 ɸ ɸ
4. Define Ɛ-closure of q. Compute Ɛ-closure of each state in the following Ɛ-NFA.
δ Ɛ A b c
→p ɸ {p} {q} {r}
Q {p} {q} {r} ɸ
*r {q} {r} ɸ {p}
5. Define Regular Expression. Construct the RE for the following.
i)String of a’s and b’s whose second symbol from the right end is a.
ii)strings of a’s and b’s starting with ‘a’ and ending with ‘b’.
6. Build an equivalent Regular expression for the following regular expressions
i)(a+b)*bb(a+b)*
ii)a*+b*+c*
7.State and Prove pumping lemma for Regular Languages.
8.Explain the Applications of RE.
Course code and title: CS3103-1: Theory of Computation
Unit – II Chapter 5,6,7,8 Planned hours: 15
PROPERTIES OF REGULAR LANGUAGES,
CONTEXT-FREE GRAMMARS AND
LANGUAGES, PUSHDOWN AUTOMATA
Learning objectives:
At the end of this unit, the student will be able to –
1. Able to minimize FSMs.
2. Define CFG.
3. Derive (L&R) of strings for given CFG.
4. Write derivation trees for the CFG.
5. Know the cause of ambiguity in CFG.
6. Define and design a PDA for a given Language.
Lesson Schedule: Class Portion Covered per hour (estimate)
1. Closure properties of regular languages,
2. Equivalence and minimization of automata
3. Equivalence and minimization of automata
4. Context free grammars Definitions
5. CFG Examples
6. CFG Examples
7. CFG Examples
8. Derivations: LMD AND RMD
9. Derivation trees. Ambiguous Grammar
10. Ambiguous Grammar.
11. Unambiguous Grammar for algebraic expressions.
12. Definition of the Pushdown Automata.
13. Language accepted by a PDA
14. PDA problems
15. PDA Problems
Total number of hours: 15
Model questions:
1. Define the following each with an example.
i.Derivation
ii.Leftmost derivation
iii.Rightmost derivation.
2. Obtain the grammar to generate the following
i)L={anbm | n≥0,m>n}
ii)L={an+2bm| n≥0 and m>n}
3. Convert the following grammar into CNF.
S->0A|1B
A->0AA|1S|1
B->1BB|0S|0
4. Obtain PDA to accept the language L={anbn|n≥1}
5. Define Ambiguous grammar. Is the following grammar ambiguous for the string ibtibtaea
S->iCtS|iCtSeS|a
C->b
6.Discuss the Closure properties of Regular Languages.
7.Define distinguishable and indistinguishable states. Minimize the following DFA using table
filling algorithm,
Course code and title: CS3103-1: Theory of Computation
Unit – II Chapter 5,6,7,8 Planned hours: 10
PROPERTIES OF CONTEXT-FREE
LANGUAGES, TURING MACHINES,
RECURSIVELY ENUMERABLE
LANGUAGES

Learning objectives:
At the end of this unit, the student will be able to –
1. Write CFG in the normal forms.
2. Define and design TM for a given language.
3. Know the hierarchy of languages and grammars
4. Recursively enumerable languages and Recursive.
Lesson Schedule: Class Portion Covered per hour (estimate)
1. Normal forms for CFGs
2. CNF and GNF
3. The Turing machine definition and design TM for the language
4. Problems
5. Problems
6. Extensions to the Basic Turing Machines.
7. Recursively enumerable languages and Recursive.
8. Recursively enumerable languages and Recursive
9. The Chomsky hierarchy
10.The Chomsky hierarchy
Total number of hours: 10
Model questions:
1. What is CNF and GNF? Obtain the following grammar in CNF:

2. Design Turing machine to accept the language.

3. Write a note on the following.


a.Chomsky Hierarchy
b.Recursively enumerable Languages
c.Multitape turing Machine.
4. Define turing machine. Explain with a diagram, general structure of multitape turing
machine.
5. Design a turing machine to accept the language L={0n1n|n>=1}. Write its transition diagram
and give instantaneous description for the input “0011”.
6.Show that language that is not recursive enumerable.
7.If L1 and L2 are recursively enumerable languages over ∑,Then L1UL2 and L1ՈL2 are also
recursively enumerable.
USN

NMAM INSTITUTE OF TECHNOLOGY, NITTE


Off-Campus Centre of Nitte (Deemed to be University)

V Sem B.Tech (CSE) Mid Semester Examinations - I, September 2024


THEORY OF COMPUTATION(CS3103-1)
Duration: 1 Hour Max. Marks: 20

Note: Answer any One full question from each Unit.

Unit – I Marks BT* CO* PO*

1. a) Define: i) Alphabet ii) String iii) Power of an alphabet. Each with an


Example. 6 L*2 1
1.3.1
b) Construct DFA for the following languages
i)String of 0’s and 1’s having three consecutive 0’s 4 L3 1
ii)L={w: |w|mod5=0}Where ∑={a} 1.4.1

2. a) Build a DFA for the following NFA.


Δ a B
->q0 {q0,q1} {q0}
q1 ϕ {q2} 6 L3 1
*q2 ϕ Φ 1.4.1
b) Define E-CLOSURE of q. Compute ℇ-CLOSURE of each state in 4 L3 1
the following ℇ-NFA. 1.4.1

Unit – II

3. a) Define Regular Expression. Construct the RE for the following.


i)String of a’s and b’s whose second symbol from the right end is a. 6 L3 2
ii)strings of a’s and b’s starting with ‘a’ and ending with ‘b’. 1.4.1
b) Build an equivalent Regular expression for the following regular
expressions
i)(a+b)*bb(a+b)* 4 L3 2
ii)a*+b*+c* 1.4.1

4. a) Develop an Equivalent Regular Expression for the following Finite


Automata by state elimination method.
δ 0 1
*->q0 q1 q2
q1 q3 q0
q2 q0 q3
6 L3 2
q3 q3 q3 1.4.1
b) Show that Regular languages are closed under Union, 4 L3 2
Concatenation and Star. 2.4.4

BT* Bloom’s Taxonomy, L* Level; CO* Course Outcome; PO* Program Outcome

*****************
USN

NMAM INSTITUTE OF TECHNOLOGY, NITTE


Off-Campus Centre of Nitte (Deemed to be University)

V Sem B.Tech (CSE) Mid Semester Examinations - II, October 2024


THEORY OF COMPUTATION(CS3103-1)
Duration: 1 Hour Max. Marks: 20

Note: Answer any One full question from each Unit.

Unit – I Marks BT* CO* PO*

1. a) Define the following each with an example.


i.Derivation
ii.Leftmost derivation
iii.Rightmost derivation. 6 L*2
3
b) Obtain the grammar to generate the following
i)L={anbm | n≥0,m>n} 4 L3
ii)L={an+2bm| n≥0 and m>n} 3

2. a) Define distinguishable and indistinguishable states. Minimize the following DFA using table
filling algorithm,

6 L3
3
b) Discuss the closure properties of Regular languages. 4 L3
3

3. a) Obtain PDA to accept the language L={a nbn|n≥1} 6 L3


4
b) Define Ambiguous grammar. Check whether the following
grammar is Ambiguous or not
S->iCtS|iCtSeS|a 4 L3
C->b 4

4. a) Eliminate ℇ-Productions from the following grammar.


S->ABCa|bD 6 L3
A->BC|b 4
B->b|ℇ
C->c| ℇ
D->d
b) Define PDA. Is the PDA to accept the language consisting of
balanced parenthesis is deterministic? 4 L3
4

BT* Bloom’s Taxonomy, L* Level; CO* Course Outcome; PO* Program Outcome
USN

NMAM INSTITUTE OF TECHNOLOGY, NITTE


Off-Campus Centre of Nitte (Deemed to be University)

Fiftth Semester B.Tech (CSE) (CBCS) Degree Examinations

Decmber 2024

CS3103-1 – THEORY OF COMPUTATION


Duration: 3 Hours Max. Marks: 100

Note:

Part – A: Multiple Choice Questions: Answer all Twenty questions in the OMR Sheet provided. Each question
carries equal marks.

Part – B: Descriptive Answer Questions: Answer Five full questions choosing Two full questions from Unit – I &
Unit – II each and One full question from Unit – III.

PART - A: MULTIPLE CHOICE QUESTIONS 20 Marks

PART - B: DESCRIPTIVE ANSWER QUESTIONS


Note : Each main question carries 16 Marks, maximum sub questions up to 4 levels.
Unit – I Marks BT* CO* PO*

1. a) Define Deterministic Finite Automata. List out the major differences


between DFA and NFA. 3 L*1 1 1
b) Construct DFA to accept strings of a's and b's except those having
substring abb on Ʃ={a,b} . Also Solve 𝛿*( q0, abab )
5 L3 1 1,3
c) Consider the following є-NFA
𝛿 0 Є
→q0 q1 q1
q1 q2 q2
q2 q3 q4
q3 q4 q1
*q4 Ф Ф
i. Show E-closure of each state.
ii. Convert the automata to DFA. 8 L2 1 1,3

2. a) Construct DFA to accept the following languages

a. String of even length and begins with 01 on Ʃ= {0,1}


b. L={w mod 3 ≠ 0 } on Ʃ={0,1} c. L= {|w| mod 3 ≠ 0 } on Ʃ={a,b}.

8 L3 1 1,3
b) Develop regular expressions for the following Languages.

i) All strings having substring 00 on Ʃ={0,1}


ii) All strings containing not more than 3 a’s on Ʃ={a,b}
iii) L(r)= {anbn:n+m is even}
iv) L(r)={wє{0,1}* : w has no pair of consecutive zeros}
8
L3 1 1,3

3. a) State and prove pumping lemma for regular languages.


pumping lemma for the following language and prove that it regular.
L={wwR ∈ Ʃ* }, and Ʃ={a,b}
8 L3 1 1,3
b) Develop an equivalent Regular Expression for the following Finite
Automata
𝛿 a b
→q1 q1 q2
q2 q1 q3
q3 q4 q3
*q4 q2 q3

8 L3 1 1,3

Unit – II

4. a) Apply table filling algorithm to minimize the following DFA.


𝛿 0 1
→A B A
B A C
C D B 8 L3 2 1,3
*D D A
E D F
F G E
G F G
H G D
b) Define Context Free Grammar. Develop CFG for the following Languages
i. L = { anbm : n ≥ m}
ii. L = { a2nbm : m ≥ 0, n≥ 0}
iii. L={ anbm : m= n+2}
iv. L={ all strings with equal number of a's and b's} 8 L3 2 1,3

5. a) Construct a PDA to accept the Language L(M)={w |w є {a,b}* and


na(w)=nb(w).} 8 L3 2 1,3
b) What are useless productions. Eliminate useless productions from the
following Grammar.
S → AB | AC
A → aA | bAa |a
B → bbA | aB |AB
C → aCa | aD
D → aD | bC 8 L2 2 1,3

6. a) What is an ambiguous grammar? Show that the grammar is ambiguous on


the string aabb.
S → aSb | SS | є 4 L2 2 1,3
b) What is Chomsky Normal form. Choosing the suitable steps, convert the
following Context Free Grammar into CNF.
S → 0A0|1B1|BB
A→C
B → S |A 1,3
C→S|є 6 L3 2
c) Consider the grammar with productions
S → AbB
A → aA | є
B → aB | bB | є
For the string aabab show i) leftmost derivation 2 2
ii) right most derivation iii) derivation tree 6 L2

Unit – III

7. a) What are the different types of grammar defined by Chomsky? Explain


8 L1 3 1
n n n
b) Build a Turing machine to recognize L={0 1 2 |n>=1}, also write its
transition diagram. 8 L3 3 1,3

8. a) Define a Turing Machine. Explain with a neat diagram general structure


of multi - tape Turing machines. 5 L1 3 1
b) Build a Turing Machine to accept the language containing strings of 0's
and 1's ending with 001.
6 L3 3 1,3
c) Show that language that is not recursive enumerable. 5 L1 3
1
BT* Bloom’s Taxonomy, L* Level; CO* Course Outcome; PO* Program Outcome
*****************

You might also like