SlideShare a Scribd company logo
1 of 4
Download to read offline
MTH 401: Theory of Computation September 17, 2016
Department of Mathematics and Statistics Time: 120 minutes
Indian Institute of Technology - Kanpur Maximum Score: 30
Mid-semester Examination
1. Indicate whether following statements are true or false. Justify your answer (to justify
a claim that a statement is true, an (informal) proof is required; to justify a claim
that a statement is false, a single counterexample is sufficient.) Note that no credit
will be given to a correct guess without any explanation or followed by an
incorrect justification.
(a) The union of a context free language with a regular language is a context free
language. [1]
Solution: True. Regular languages are context free and context free languages
are closed under union.
(b) The regular sets are closed under countable unions. [1]
Solution: False. The sets Rn = {0n
1n
} are regular for all n ∈ N but n∈N Rn =
{0n
1n
: n ≥ 0} is not regular.
(c) Let L1, L2 ⊆ Σ∗
. If either L1 or L2 is not regular then L1L2 is not regular. [1]
Solution: False. L1 = L(0∗
) and L2 = {0p
| p is a prime}. Clearly, L1L2 =
L(0∗
)  { , 0, 00} is regular whereas L2 is not regular.
(d) Let L ⊆ Σ∗
. If L∗
= ∅, then L = ∅. [1]
Solution: False. An equivalent statement is: if L = ∅, then L∗
= ∅. Clearly
false, as ∈ L∗
even when L = ∅.
(e) If a and b are letters in an alphabet, then L((a∗
b∗
)∗
) = L((a + b)∗
). [1]
Solution: True. w ∈ L((a∗
b∗
)∗
) ⇐⇒ there are integers m1, . . . , mk ≥ 0, and
n1, . . . , nk ≥ 0 for some k ≥ 0 such that w = an1
bm1
. . . ank bmk ⇐⇒ w ∈ L((a +
b)∗
).
2
2. Let Σ be an alphabet.
(a) For any string w ∈ Σ∗
, define formally the reversal of a string w, denoted by
wR
. [2]
Solution: A definition using induction of the length of the string is given as
follows:
i. If w is a string of length 0, then wR
= w = ε (the empty string).
ii. If w is a string of length n + 1 > 0, then w = ua for some u ∈ Σ∗
, a ∈ Σ and
wR
= auR
.
(b) For any strings w, x ∈ Σ∗
, prove that (wx)R
= xR
wR
. [3]
Solution: Proof by induction on the length of x:
Basic Step: |x| = 0. Then x = ε, and (wx)R
= wR
= εwR
= εR
wR
= xR
wR
.
Induction Hypothesis: If |x| ≤ n, then (wx)R
= xR
wR
.
Induction Step: Let |x| = n + 1. Then w = ua for some u ∈ Σ∗
and a ∈ Σ such
that |u| = n.
(wx)R
= (w(ua))R
= ((wu)a)R
= a(wu)R
(by the definition of the reversal)
= auR
wR
(by the induction hypothesis)
= (ua)R
)wR
(by the definition of the reversal)
= xR
wR
.
3. Show that the set {w ∈ {a}∗
: |w| = p for some prime p} is not regular. [6]
Solution: Let n > 0 and w = aq
where q > n is a prime. Consider any x, y, z ∈ {a}∗
such that w = xyz with |xy| ≤ n and |y| > 0. Then, y = ak
for some 1 ≤ k ≤ n < q.
Now, for i = q − k, we have
xyi
z = xyq−k
z = a(q−k)k+(q−k)
= a(q−k)(k+1)
.
Clearly, (q − k)(k + 1) is not a prime and consequently xyq−k
y ∈ L := {w ∈ {a}∗
:
|w| = p for some prime p}. Thus, L is not regular.
4. Convert the deterministic finite state machine shown below
3
into a machine with minimal number of states. (Show all work. No partial cred-
its.) [7]
Solution: States A, E, are equivalent, states D, F are equivalent and states B, H
are equivalent. Collapsing them together and redrawing the given finite state machine
gives us the representation shown below.
5. L = {ai
bj
ck
d | i, j, k, ≥ 0, i + j ≤ k}.
(a) Write a CFG G with L(G) = L. [3]
4
Solution: By setting k = i + j + m, m ≥ 0, we see that
L = {ai
bj
cm
cj
ci
d | i, j, m, ≥ 0}.
Now it is easy to write a CFG G = ({0, 1}, {S, A, B, C, D}, S, P) with productions
in P are given by :
S −→ AD
A −→ aAc | B
B −→ bBc | C
C −→ cC |
D −→ dD |
and see that L(G) = L.
(b) Design a pushdown machine M with L(M) = L. [3]
Solution: One way to construct a pushdown machine would be to start from
scratch and design a machine that will accept L. But since we already have a
CFG for L, it is easier to use CFG-to-PDM conversion procedure to construct the
following PDM, M = ({0, 1}, {q}, {0, 1, S, A, B}, q, S, δ, {}) that accepts strings
by emptying the stack and where δ is given by :
δ(q, 0, 0) = {(q, )}
δ(q, 1, 1) = {(q, )}
δ(q, , S) = {(q, AD)}
δ(q, , A) = {(q, aAc), (q, B)}
δ(q, , B) = {(q, bBc), (q, C)}
δ(q, , C) = {(q, cC), (q, )}
δ(q, , D) = {(q, dD), (q, )}.
(c) Is the machine you designed in (b) a deterministic pushdown machine? [1]
Solution: No. There are multiple actions for δ(q, , A), and others.

More Related Content

What's hot

Electronic Payment Systems Shortened
Electronic Payment Systems ShortenedElectronic Payment Systems Shortened
Electronic Payment Systems ShortenedRitesh Verma
 
Understanding the future of payments industry in India.pptx
Understanding the future of payments industry in India.pptxUnderstanding the future of payments industry in India.pptx
Understanding the future of payments industry in India.pptxrohitkeluskar4
 
Formal language & automata theory
Formal language & automata theoryFormal language & automata theory
Formal language & automata theoryNYversity
 
Graph terminologies & special type graphs
Graph terminologies & special type graphsGraph terminologies & special type graphs
Graph terminologies & special type graphsNabeel Ahsen
 
Business plan - Mobile Payment Application
Business plan - Mobile Payment ApplicationBusiness plan - Mobile Payment Application
Business plan - Mobile Payment ApplicationPlan Writers
 
Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...
Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...
Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...Soumen Santra
 
Thevenin's theorem for ac network
Thevenin's theorem for ac network Thevenin's theorem for ac network
Thevenin's theorem for ac network Syed Saeed
 
Practical Applications of Bessel's function
Practical Applications of Bessel's functionPractical Applications of Bessel's function
Practical Applications of Bessel's functionOneirosErebus
 
Bayesian Inference : Kalman filter 에서 Optimization 까지 - 김홍배 박사님
Bayesian Inference : Kalman filter 에서 Optimization 까지 - 김홍배 박사님Bayesian Inference : Kalman filter 에서 Optimization 까지 - 김홍배 박사님
Bayesian Inference : Kalman filter 에서 Optimization 까지 - 김홍배 박사님AI Robotics KR
 
Cardless and contactless transactions
Cardless and contactless transactionsCardless and contactless transactions
Cardless and contactless transactionsMichal Voldrich, MBA
 
Turing Machine
Turing MachineTuring Machine
Turing MachineRajendran
 
Cs6503 theory of computation november december 2015 be cse anna university q...
Cs6503 theory of computation november december 2015  be cse anna university q...Cs6503 theory of computation november december 2015  be cse anna university q...
Cs6503 theory of computation november december 2015 be cse anna university q...appasami
 

What's hot (20)

Finite Automata
Finite AutomataFinite Automata
Finite Automata
 
Kruskal Algorithm
Kruskal AlgorithmKruskal Algorithm
Kruskal Algorithm
 
Theory of computation Lec7 pda
Theory of computation Lec7 pdaTheory of computation Lec7 pda
Theory of computation Lec7 pda
 
Electronic Payment Systems Shortened
Electronic Payment Systems ShortenedElectronic Payment Systems Shortened
Electronic Payment Systems Shortened
 
Understanding the future of payments industry in India.pptx
Understanding the future of payments industry in India.pptxUnderstanding the future of payments industry in India.pptx
Understanding the future of payments industry in India.pptx
 
Formal language & automata theory
Formal language & automata theoryFormal language & automata theory
Formal language & automata theory
 
weddle's rule
weddle's ruleweddle's rule
weddle's rule
 
Graph terminologies & special type graphs
Graph terminologies & special type graphsGraph terminologies & special type graphs
Graph terminologies & special type graphs
 
Business plan - Mobile Payment Application
Business plan - Mobile Payment ApplicationBusiness plan - Mobile Payment Application
Business plan - Mobile Payment Application
 
Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...
Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...
Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...
 
EEE 1
EEE 1EEE 1
EEE 1
 
Thevenin's theorem for ac network
Thevenin's theorem for ac network Thevenin's theorem for ac network
Thevenin's theorem for ac network
 
Practical Applications of Bessel's function
Practical Applications of Bessel's functionPractical Applications of Bessel's function
Practical Applications of Bessel's function
 
Ch02
Ch02Ch02
Ch02
 
Bayesian Inference : Kalman filter 에서 Optimization 까지 - 김홍배 박사님
Bayesian Inference : Kalman filter 에서 Optimization 까지 - 김홍배 박사님Bayesian Inference : Kalman filter 에서 Optimization 까지 - 김홍배 박사님
Bayesian Inference : Kalman filter 에서 Optimization 까지 - 김홍배 박사님
 
Cardless and contactless transactions
Cardless and contactless transactionsCardless and contactless transactions
Cardless and contactless transactions
 
Matlab plotting
Matlab plottingMatlab plotting
Matlab plotting
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Cs6503 theory of computation november december 2015 be cse anna university q...
Cs6503 theory of computation november december 2015  be cse anna university q...Cs6503 theory of computation november december 2015  be cse anna university q...
Cs6503 theory of computation november december 2015 be cse anna university q...
 
Mobile Wallet functions
Mobile Wallet functionsMobile Wallet functions
Mobile Wallet functions
 

Viewers also liked

Teoria del caso
Teoria del casoTeoria del caso
Teoria del casoOrendaGM
 
IPW in Hospitals_The Case of Nepal_ICHM Nepal_20.1.2016
IPW in Hospitals_The Case of  Nepal_ICHM Nepal_20.1.2016IPW in Hospitals_The Case of  Nepal_ICHM Nepal_20.1.2016
IPW in Hospitals_The Case of Nepal_ICHM Nepal_20.1.2016Bachchu Kailash Kaini
 
Come creare un blog di successo in 5 step
Come creare un blog di successo in 5 stepCome creare un blog di successo in 5 step
Come creare un blog di successo in 5 stepSimone Maestri
 
Historia de la arquitectura
Historia de la arquitecturaHistoria de la arquitectura
Historia de la arquitecturadiana pachano
 
Metodologias de control-gp02
Metodologias de control-gp02Metodologias de control-gp02
Metodologias de control-gp02Veronica Rueda
 
Enrique Olvera Portfolio 2016
Enrique Olvera Portfolio 2016Enrique Olvera Portfolio 2016
Enrique Olvera Portfolio 2016Enrique Olvera
 

Viewers also liked (8)

Teoria del caso
Teoria del casoTeoria del caso
Teoria del caso
 
IPW in Hospitals_The Case of Nepal_ICHM Nepal_20.1.2016
IPW in Hospitals_The Case of  Nepal_ICHM Nepal_20.1.2016IPW in Hospitals_The Case of  Nepal_ICHM Nepal_20.1.2016
IPW in Hospitals_The Case of Nepal_ICHM Nepal_20.1.2016
 
Come creare un blog di successo in 5 step
Come creare un blog di successo in 5 stepCome creare un blog di successo in 5 step
Come creare un blog di successo in 5 step
 
Robotino
RobotinoRobotino
Robotino
 
Historia de la arquitectura
Historia de la arquitecturaHistoria de la arquitectura
Historia de la arquitectura
 
Danielle_Toombs_Resume
Danielle_Toombs_ResumeDanielle_Toombs_Resume
Danielle_Toombs_Resume
 
Metodologias de control-gp02
Metodologias de control-gp02Metodologias de control-gp02
Metodologias de control-gp02
 
Enrique Olvera Portfolio 2016
Enrique Olvera Portfolio 2016Enrique Olvera Portfolio 2016
Enrique Olvera Portfolio 2016
 

Similar to Mid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur

End semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
End semexam | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurEnd semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
End semexam | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurVivekananda Samiti
 
Prin digcommselectedsoln
Prin digcommselectedsolnPrin digcommselectedsoln
Prin digcommselectedsolnAhmed Alshomi
 
sublabel accurate convex relaxation of vectorial multilabel energies
sublabel accurate convex relaxation of vectorial multilabel energiessublabel accurate convex relaxation of vectorial multilabel energies
sublabel accurate convex relaxation of vectorial multilabel energiesFujimoto Keisuke
 
Dynamic1
Dynamic1Dynamic1
Dynamic1MyAlome
 
Imc2020 day1&amp;2 problems&amp;solutions
Imc2020 day1&amp;2 problems&amp;solutionsImc2020 day1&amp;2 problems&amp;solutions
Imc2020 day1&amp;2 problems&amp;solutionsChristos Loizos
 
Dynamical systems solved ex
Dynamical systems solved exDynamical systems solved ex
Dynamical systems solved exMaths Tutoring
 
Chapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdfChapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdfdawod yimer
 
Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...
 Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S... Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...
Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...parmeet834
 
Solutions Manual for An Introduction To Abstract Algebra With Notes To The Fu...
Solutions Manual for An Introduction To Abstract Algebra With Notes To The Fu...Solutions Manual for An Introduction To Abstract Algebra With Notes To The Fu...
Solutions Manual for An Introduction To Abstract Algebra With Notes To The Fu...Aladdinew
 
MATH 270 TEST 3 REVIEW1. Given subspaces H and K of a vect.docx
MATH 270 TEST 3 REVIEW1. Given subspaces H and K of a vect.docxMATH 270 TEST 3 REVIEW1. Given subspaces H and K of a vect.docx
MATH 270 TEST 3 REVIEW1. Given subspaces H and K of a vect.docxwkyra78
 
Complex Analysis And ita real life problems solution
Complex Analysis And ita real life problems solutionComplex Analysis And ita real life problems solution
Complex Analysis And ita real life problems solutionNaeemAhmad289736
 

Similar to Mid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur (20)

End semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
End semexam | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurEnd semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
End semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
 
Prin digcommselectedsoln
Prin digcommselectedsolnPrin digcommselectedsoln
Prin digcommselectedsoln
 
sublabel accurate convex relaxation of vectorial multilabel energies
sublabel accurate convex relaxation of vectorial multilabel energiessublabel accurate convex relaxation of vectorial multilabel energies
sublabel accurate convex relaxation of vectorial multilabel energies
 
Imc2016 day1-solutions
Imc2016 day1-solutionsImc2016 day1-solutions
Imc2016 day1-solutions
 
Linear Algebra Assignment help
Linear Algebra Assignment helpLinear Algebra Assignment help
Linear Algebra Assignment help
 
Dynamic1
Dynamic1Dynamic1
Dynamic1
 
Imc2017 day1-solutions
Imc2017 day1-solutionsImc2017 day1-solutions
Imc2017 day1-solutions
 
Imc2020 day1&amp;2 problems&amp;solutions
Imc2020 day1&amp;2 problems&amp;solutionsImc2020 day1&amp;2 problems&amp;solutions
Imc2020 day1&amp;2 problems&amp;solutions
 
Final
Final Final
Final
 
Dynamical systems solved ex
Dynamical systems solved exDynamical systems solved ex
Dynamical systems solved ex
 
Mcs 013 solve assignment
Mcs 013 solve assignmentMcs 013 solve assignment
Mcs 013 solve assignment
 
Dfa h11
Dfa h11Dfa h11
Dfa h11
 
Teori automata lengkap
Teori automata lengkapTeori automata lengkap
Teori automata lengkap
 
Probability theory
Probability theoryProbability theory
Probability theory
 
QMC: Transition Workshop - Density Estimation by Randomized Quasi-Monte Carlo...
QMC: Transition Workshop - Density Estimation by Randomized Quasi-Monte Carlo...QMC: Transition Workshop - Density Estimation by Randomized Quasi-Monte Carlo...
QMC: Transition Workshop - Density Estimation by Randomized Quasi-Monte Carlo...
 
Chapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdfChapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdf
 
Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...
 Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S... Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...
Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...
 
Solutions Manual for An Introduction To Abstract Algebra With Notes To The Fu...
Solutions Manual for An Introduction To Abstract Algebra With Notes To The Fu...Solutions Manual for An Introduction To Abstract Algebra With Notes To The Fu...
Solutions Manual for An Introduction To Abstract Algebra With Notes To The Fu...
 
MATH 270 TEST 3 REVIEW1. Given subspaces H and K of a vect.docx
MATH 270 TEST 3 REVIEW1. Given subspaces H and K of a vect.docxMATH 270 TEST 3 REVIEW1. Given subspaces H and K of a vect.docx
MATH 270 TEST 3 REVIEW1. Given subspaces H and K of a vect.docx
 
Complex Analysis And ita real life problems solution
Complex Analysis And ita real life problems solutionComplex Analysis And ita real life problems solution
Complex Analysis And ita real life problems solution
 

More from Vivekananda Samiti

End semester examination | MTH 653A, IITK Integral Equation
End semester examination | MTH 653A, IITK Integral Equation End semester examination | MTH 653A, IITK Integral Equation
End semester examination | MTH 653A, IITK Integral Equation Vivekananda Samiti
 
Mth 653 a end sem paper | Integral Equation
Mth 653 a end sem paper | Integral Equation Mth 653 a end sem paper | Integral Equation
Mth 653 a end sem paper | Integral Equation Vivekananda Samiti
 
Regression project report | Regression analysis | MTH 426 IITK
Regression project report | Regression analysis | MTH 426 IITK Regression project report | Regression analysis | MTH 426 IITK
Regression project report | Regression analysis | MTH 426 IITK Vivekananda Samiti
 
Project co prediction Regression analysis | MTH 426 IITK
Project co prediction Regression analysis | MTH 426 IITK Project co prediction Regression analysis | MTH 426 IITK
Project co prediction Regression analysis | MTH 426 IITK Vivekananda Samiti
 
Indian eduaction system group 13 | MTH 423A IITK
Indian eduaction system group 13 | MTH 423A IITKIndian eduaction system group 13 | MTH 423A IITK
Indian eduaction system group 13 | MTH 423A IITKVivekananda Samiti
 
Final presentation | MTH426A IITK
Final presentation | MTH426A IITKFinal presentation | MTH426A IITK
Final presentation | MTH426A IITKVivekananda Samiti
 
Mth 416A, Regression Analysis - 2016 midsem, endsem and quizes
Mth 416A, Regression Analysis - 2016   midsem, endsem and quizesMth 416A, Regression Analysis - 2016   midsem, endsem and quizes
Mth 416A, Regression Analysis - 2016 midsem, endsem and quizesVivekananda Samiti
 
Mth 416A end sem paper 2017, IITK
Mth 416A end sem paper 2017, IITK Mth 416A end sem paper 2017, IITK
Mth 416A end sem paper 2017, IITK Vivekananda Samiti
 
Mth 401 IITK theory of computation 2016
Mth 401 IITK theory of computation 2016Mth 401 IITK theory of computation 2016
Mth 401 IITK theory of computation 2016Vivekananda Samiti
 
Mth 412 IITK end sem paper 2016
Mth 412 IITK end sem paper 2016Mth 412 IITK end sem paper 2016
Mth 412 IITK end sem paper 2016Vivekananda Samiti
 
Phy 301 a end sem paper | Energy, IIT Kanpur
Phy 301 a end sem paper | Energy, IIT KanpurPhy 301 a end sem paper | Energy, IIT Kanpur
Phy 301 a end sem paper | Energy, IIT KanpurVivekananda Samiti
 
Fluidendsem | Mth 523 Fluid Dynamics | B V Rathish Kumar | IIT Kanpur
Fluidendsem | Mth 523 Fluid Dynamics | B V Rathish Kumar | IIT KanpurFluidendsem | Mth 523 Fluid Dynamics | B V Rathish Kumar | IIT Kanpur
Fluidendsem | Mth 523 Fluid Dynamics | B V Rathish Kumar | IIT KanpurVivekananda Samiti
 
Quiz3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Quiz3 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurQuiz3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Quiz3 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurVivekananda Samiti
 
Problem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Problem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurProblem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Problem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurVivekananda Samiti
 
Quiz2 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Quiz2 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurQuiz2 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Quiz2 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurVivekananda Samiti
 
Quiz1 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Quiz1 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurQuiz1 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Quiz1 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurVivekananda Samiti
 

More from Vivekananda Samiti (20)

End semester examination | MTH 653A, IITK Integral Equation
End semester examination | MTH 653A, IITK Integral Equation End semester examination | MTH 653A, IITK Integral Equation
End semester examination | MTH 653A, IITK Integral Equation
 
Mth 653 a end sem paper | Integral Equation
Mth 653 a end sem paper | Integral Equation Mth 653 a end sem paper | Integral Equation
Mth 653 a end sem paper | Integral Equation
 
Regression project report | Regression analysis | MTH 426 IITK
Regression project report | Regression analysis | MTH 426 IITK Regression project report | Regression analysis | MTH 426 IITK
Regression project report | Regression analysis | MTH 426 IITK
 
Project co prediction Regression analysis | MTH 426 IITK
Project co prediction Regression analysis | MTH 426 IITK Project co prediction Regression analysis | MTH 426 IITK
Project co prediction Regression analysis | MTH 426 IITK
 
Mth426 group13 final_report
Mth426 group13 final_reportMth426 group13 final_report
Mth426 group13 final_report
 
Indian eduaction system group 13 | MTH 423A IITK
Indian eduaction system group 13 | MTH 423A IITKIndian eduaction system group 13 | MTH 423A IITK
Indian eduaction system group 13 | MTH 423A IITK
 
Final presentation | MTH426A IITK
Final presentation | MTH426A IITKFinal presentation | MTH426A IITK
Final presentation | MTH426A IITK
 
Mth 416A, Regression Analysis - 2016 midsem, endsem and quizes
Mth 416A, Regression Analysis - 2016   midsem, endsem and quizesMth 416A, Regression Analysis - 2016   midsem, endsem and quizes
Mth 416A, Regression Analysis - 2016 midsem, endsem and quizes
 
Mth 416A end sem paper 2017, IITK
Mth 416A end sem paper 2017, IITK Mth 416A end sem paper 2017, IITK
Mth 416A end sem paper 2017, IITK
 
Mth 401 IITK theory of computation 2016
Mth 401 IITK theory of computation 2016Mth 401 IITK theory of computation 2016
Mth 401 IITK theory of computation 2016
 
Mth 412 IITK end sem paper 2016
Mth 412 IITK end sem paper 2016Mth 412 IITK end sem paper 2016
Mth 412 IITK end sem paper 2016
 
Phy 301 a end sem paper | Energy, IIT Kanpur
Phy 301 a end sem paper | Energy, IIT KanpurPhy 301 a end sem paper | Energy, IIT Kanpur
Phy 301 a end sem paper | Energy, IIT Kanpur
 
Phy 301 a Presentation
Phy 301 a Presentation Phy 301 a Presentation
Phy 301 a Presentation
 
Phy 301 a | Project Report
Phy 301 a | Project ReportPhy 301 a | Project Report
Phy 301 a | Project Report
 
Mth 523 end sem paper
Mth 523 end sem paper Mth 523 end sem paper
Mth 523 end sem paper
 
Fluidendsem | Mth 523 Fluid Dynamics | B V Rathish Kumar | IIT Kanpur
Fluidendsem | Mth 523 Fluid Dynamics | B V Rathish Kumar | IIT KanpurFluidendsem | Mth 523 Fluid Dynamics | B V Rathish Kumar | IIT Kanpur
Fluidendsem | Mth 523 Fluid Dynamics | B V Rathish Kumar | IIT Kanpur
 
Quiz3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Quiz3 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurQuiz3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Quiz3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
 
Problem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Problem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurProblem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Problem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
 
Quiz2 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Quiz2 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurQuiz2 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Quiz2 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
 
Quiz1 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Quiz1 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurQuiz1 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Quiz1 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
 

Recently uploaded

Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture designssuser87fa0c1
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 

Recently uploaded (20)

Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture design
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 

Mid semexam | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur

  • 1. MTH 401: Theory of Computation September 17, 2016 Department of Mathematics and Statistics Time: 120 minutes Indian Institute of Technology - Kanpur Maximum Score: 30 Mid-semester Examination 1. Indicate whether following statements are true or false. Justify your answer (to justify a claim that a statement is true, an (informal) proof is required; to justify a claim that a statement is false, a single counterexample is sufficient.) Note that no credit will be given to a correct guess without any explanation or followed by an incorrect justification. (a) The union of a context free language with a regular language is a context free language. [1] Solution: True. Regular languages are context free and context free languages are closed under union. (b) The regular sets are closed under countable unions. [1] Solution: False. The sets Rn = {0n 1n } are regular for all n ∈ N but n∈N Rn = {0n 1n : n ≥ 0} is not regular. (c) Let L1, L2 ⊆ Σ∗ . If either L1 or L2 is not regular then L1L2 is not regular. [1] Solution: False. L1 = L(0∗ ) and L2 = {0p | p is a prime}. Clearly, L1L2 = L(0∗ ) { , 0, 00} is regular whereas L2 is not regular. (d) Let L ⊆ Σ∗ . If L∗ = ∅, then L = ∅. [1] Solution: False. An equivalent statement is: if L = ∅, then L∗ = ∅. Clearly false, as ∈ L∗ even when L = ∅. (e) If a and b are letters in an alphabet, then L((a∗ b∗ )∗ ) = L((a + b)∗ ). [1] Solution: True. w ∈ L((a∗ b∗ )∗ ) ⇐⇒ there are integers m1, . . . , mk ≥ 0, and n1, . . . , nk ≥ 0 for some k ≥ 0 such that w = an1 bm1 . . . ank bmk ⇐⇒ w ∈ L((a + b)∗ ).
  • 2. 2 2. Let Σ be an alphabet. (a) For any string w ∈ Σ∗ , define formally the reversal of a string w, denoted by wR . [2] Solution: A definition using induction of the length of the string is given as follows: i. If w is a string of length 0, then wR = w = ε (the empty string). ii. If w is a string of length n + 1 > 0, then w = ua for some u ∈ Σ∗ , a ∈ Σ and wR = auR . (b) For any strings w, x ∈ Σ∗ , prove that (wx)R = xR wR . [3] Solution: Proof by induction on the length of x: Basic Step: |x| = 0. Then x = ε, and (wx)R = wR = εwR = εR wR = xR wR . Induction Hypothesis: If |x| ≤ n, then (wx)R = xR wR . Induction Step: Let |x| = n + 1. Then w = ua for some u ∈ Σ∗ and a ∈ Σ such that |u| = n. (wx)R = (w(ua))R = ((wu)a)R = a(wu)R (by the definition of the reversal) = auR wR (by the induction hypothesis) = (ua)R )wR (by the definition of the reversal) = xR wR . 3. Show that the set {w ∈ {a}∗ : |w| = p for some prime p} is not regular. [6] Solution: Let n > 0 and w = aq where q > n is a prime. Consider any x, y, z ∈ {a}∗ such that w = xyz with |xy| ≤ n and |y| > 0. Then, y = ak for some 1 ≤ k ≤ n < q. Now, for i = q − k, we have xyi z = xyq−k z = a(q−k)k+(q−k) = a(q−k)(k+1) . Clearly, (q − k)(k + 1) is not a prime and consequently xyq−k y ∈ L := {w ∈ {a}∗ : |w| = p for some prime p}. Thus, L is not regular. 4. Convert the deterministic finite state machine shown below
  • 3. 3 into a machine with minimal number of states. (Show all work. No partial cred- its.) [7] Solution: States A, E, are equivalent, states D, F are equivalent and states B, H are equivalent. Collapsing them together and redrawing the given finite state machine gives us the representation shown below. 5. L = {ai bj ck d | i, j, k, ≥ 0, i + j ≤ k}. (a) Write a CFG G with L(G) = L. [3]
  • 4. 4 Solution: By setting k = i + j + m, m ≥ 0, we see that L = {ai bj cm cj ci d | i, j, m, ≥ 0}. Now it is easy to write a CFG G = ({0, 1}, {S, A, B, C, D}, S, P) with productions in P are given by : S −→ AD A −→ aAc | B B −→ bBc | C C −→ cC | D −→ dD | and see that L(G) = L. (b) Design a pushdown machine M with L(M) = L. [3] Solution: One way to construct a pushdown machine would be to start from scratch and design a machine that will accept L. But since we already have a CFG for L, it is easier to use CFG-to-PDM conversion procedure to construct the following PDM, M = ({0, 1}, {q}, {0, 1, S, A, B}, q, S, δ, {}) that accepts strings by emptying the stack and where δ is given by : δ(q, 0, 0) = {(q, )} δ(q, 1, 1) = {(q, )} δ(q, , S) = {(q, AD)} δ(q, , A) = {(q, aAc), (q, B)} δ(q, , B) = {(q, bBc), (q, C)} δ(q, , C) = {(q, cC), (q, )} δ(q, , D) = {(q, dD), (q, )}. (c) Is the machine you designed in (b) a deterministic pushdown machine? [1] Solution: No. There are multiple actions for δ(q, , A), and others.