0% found this document useful (0 votes)
59 views3 pages

ToC Assignment For Remedial Exam

Uploaded by

badlyautotuned
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)
59 views3 pages

ToC Assignment For Remedial Exam

Uploaded by

badlyautotuned
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/ 3

Assignment of Theory of Computation for Remedial Exam

Q. 1 Choose the most appropriate option from the alternatives given below.

1. Let 𝐴 = {𝑎, 𝑏} and 𝐵 = {𝑎, 𝑟, 𝑡}. Then 𝐴 − 𝐵 = ______.


(A) {𝑎, 𝑏, 𝑟, 𝑡} (B) {𝑎} (C) {𝑏} (D) {𝑟, 𝑡}
2. If 𝐴 = {𝑎, 𝑏, 𝑔} and 𝑅 = {𝑒, 𝑎, 𝑔}, then 𝐴 ∪ 𝐵 = ______.
(A) {𝑎, 𝑏, 𝑔} (B) {𝑒, 𝑎, 𝑔} (C) {𝑎, 𝑏, 𝑔, 𝑒} (D) {𝑎, 𝑔}
+
3. The function 𝑓: ℝ → ℝ ∪ {0}, 𝑓(𝑥) = |𝑥| is
(A) one-one but not onto (B) onto but not one-one
(C) both one-one and onto (D) neither one-one nor onto
4. ~(𝑝 ∧ 𝑞) = _____.
(A) ~𝑝 ∨ 𝑞 (B) ~𝑝 ∧ 𝑞 (C) (~𝑝) ∧ (~𝑞) (D) (~𝑝) ∨ (~𝑞)
5. Which of the following is a simple language?
(A) 𝐿 = {𝑎, 𝑏}∗ (B) 𝐿 = {𝑎}∗ (C) 𝐿 = {𝑎} (D) {𝑎, 𝑏}
6. A finite automaton is a _____ touple.
(A) 4 (B) 5 (C) 6 (D) 7
7. Let 𝑓: ℝ → ℝ, 𝑓(𝑥) = 0. Then domain of 𝑓 is
(A) 0 (B) ℝ (C) Not defined (D) Both (A) and (B)
8. Let 𝐴 = {1, 2}. Then which of the following is an equivalence relation on 𝐴?
(A) 𝑅 = {(1, 1), (2,2)} (B) {(1,2), (2, 1)} (C) {(1,1), (1,2)} (D) {1, 2}
9. A CFG is a _____ tuple.
(A) 4 (B) 5 (C) 6 (D) 7
10. In a Moore machine, the output depends on _____.
(A) current state only (B) current state and current input both
(C) current input (D) None of these
11. Which of the following accepts the null string as an input?
(A) DFA (B) NFA (C) NFA-Λ (D) All these
12. In a Mealy machine, the output is associated with _____.
(A) input (B) state (C) both (A) and (B) (D) none of these
13. Let 𝐺 = ({𝑆, 𝐴, 𝐵}, {𝑎, 𝑏}, 𝑆, 𝑃), where productions 𝑃 are 𝑆 → 𝐴𝐵|𝑎, 𝐵 →
𝐴𝑆|𝐵|𝑏, 𝐴 → 𝑎. Then 𝐺 is a _____.
(A) regular grammar (B) context free grammar
(C) Chomsky Normal Form (D) None of these
14. Let 𝐺 = ({𝑆, 𝐴, 𝐵}, {𝑎, 𝑏}, 𝑆, 𝑃) where productions are given by:
𝑆 → 𝐴𝐵, 𝐴 → 𝑎, 𝐵 → 𝑏. Then 𝐺 is a _____.
(A) regular grammar (B) context free grammar
(C) Chomsky Normal Form (D) None of these
15. Let 𝐺 = ({𝑆}, {𝑎, 𝑏, Λ}, 𝑆, 𝑃), where production is given by 𝑆 → 𝑆|𝑎|𝑏. Then 𝐺 is __
(A) unambiguous (B) None of these (C) Chomsky Normal Form (D) regular grammar
Q.2 Do as directed.
1. Find 𝑓 ∘ 𝑔 and 𝑔 ∘ 𝑓 where 𝑓: ℝ → ℝ+ ∪ {0}, 𝑓(𝑥) = 𝑥 2 , 𝑔: ℝ+ ∪ {0} → ℝ, 𝑔(𝑥) = √𝑥.
2. Let 𝐴 = {1, 2, 3}. Determine whether 𝑅 = {(1,1), (2,2), (3,3), (1,2), (2,1)} is an equivalence
relation on 𝐴 or not.
3. Convert the ambiguous grammar to unambiguous grammar whose productions are
given by: 𝑆 → 𝑆 − 𝑆|𝑆 + 𝑆|𝑏.
4. Let 𝐿 be the set of all strings ending with 10. Let 𝑥 = 1010 and 𝑦 = 110. Are 𝑥 and 𝑦
distinguishable with respect to 𝐿? Justify your answer.
Draw a finite automaton that recognizes the language of all strings containing even
number of zeros and even number of ones over Σ = {0, 1}.
5. Let 𝐿1 ⊆ {0, 1}∗ be the language containing the strings ending with 01 and 𝐿2 ⊆ {0, 1}∗ be
the set of strings which do not contain the substring 11. Find finite automata for
𝐿1 ∪ 𝐿2 , 𝐿1 ∩ 𝐿2 and 𝐿1 − 𝐿2.
6. Construct a Mealy machine that produces 1’s complement of any input string. Write
𝑄, Σ, Δ, transition function and output function for it.
7. Let 𝐿1 ⊆ {0, 1}∗ be the language containing the strings ending with 10 and 𝐿2 ⊆ {0, 1}∗ be
the set of strings which do not contain the substring 00. Find finite automata for
𝐿1 ∪ 𝐿2 , 𝐿1 ∩ 𝐿2 and 𝐿1 − 𝐿2.
8. Determine whether the grammar 𝐺 whose grammar rules are given by : 𝑆 →
𝑎𝐴𝑆|𝑎𝑆𝑆|Λ, 𝐴 → 𝑆𝑏𝐴|𝑏𝑎 is ambiguous or unambiguous.
9. Draw the transition diagram for the language L = the set of all strings over {0,1} wich are
ending with 01.
10. Let 𝐿 ⊆ {0, 1}∗ be the language containing all strings that do not contain the
substring 10. Consider the strings 𝑥 = 101 and 𝑦 = 11. Determine whether 𝑥 and 𝑦
are distinguishable or not with respect to 𝐿.
11. Let 𝐿1 ⊆ {0, 1}∗ be the set of all strings which do not contain the substring 00 and
𝐿2 ⊆ {0, 1}∗ be the set of all strings ending with 10. Find finite automata for 𝐿1 ∩ 𝐿2 .
12. Using Principle of Mathematical Induction, show that
𝑛(𝑛+1)(2𝑛+1)
12 + 22 + ⋯ + 𝑛2 = , 𝑛 ∈ ℕ.
6
13. Design a finite automaton which accepts the language
𝐿 = {𝑥 ∈ {𝑎, 𝑏}∗ |𝑥 ends with 11}
14. Using Principle of Mathematical Induction, show that
1 + 3 + ⋯ + (2𝑛 − 1) = 𝑛2 , 𝑛 ∈ ℕ.
15. Find a CFG corresponding to the regular expression 𝑅 = 0∗ 1(0 + 1)∗ .
16. Construct a Moore machine that counts the occurrences of the sequence ‘𝑎𝑎𝑏’ in any
input string over {𝑎, 𝑏}.
17. Construct a Mealy machine that produces 1’s complement of any input string over
{𝑎, 𝑏}.
18. Construct a Mealy machine that prints ‘1’ whenever the sequence 𝑎𝑏 is encountered
in any input string over {𝑎, 𝑏}.
19. Construct a Mealy machine that accepts the language consisting of strings from Σ ∗ ,
where Σ = {𝑎, 𝑏} and the string should end with either 𝑎𝑎 or 𝑏𝑏.
20. Define following:
(i) Unit production (ii) Null production (iii) Regular grammar (iv) Chomsky Normal
Form (v) Unambiguous Grammar (vi) Left derivation tree (vii) Ambiguous Grammar.
21. Determine whether the grammar 𝐺 whose grammar rules are given by :
𝑆 → 𝑎𝑆𝑏|𝑆𝑆|Λ is ambiguous or unambiguous.
22. Let 𝑓: ℝ → ℝ+ ∪ {0} be defined as 𝑓(𝑥) = |𝑥| and 𝑔: ℝ → ℝ be defined as
𝑔(𝑥) = 𝑥 2 . Find 𝑓 ∘ 𝑔 and 𝑔 ∘ 𝑓.
23. Consider the relation 𝑅 = {(𝑎, 𝑎), (𝑏, 𝑏), (𝑐, 𝑐)} on a set 𝐴 = {𝑎, 𝑏, 𝑐}. Determine
whether it is an equivalence relation on 𝐴 or not.
24. The recursive definition of the language 𝐿 = {𝑎𝑛 𝑏 𝑛 , 𝑛 ≥ 0} is given by: (i) Λ ∈ 𝐿(ii)
For every 𝑥 ∈ 𝐿, 𝑎𝑥𝑏 ∈ 𝐿 (iii) No other strings are in L. Construct a CFG 𝐺 that
generates 𝐿. Is 𝐺 regular? Justify your answer.
25. Determine whether the grammar 𝐺 whose grammar rules are given by :
𝑆 → 𝑎𝑆|𝑆𝑎|Λ is ambiguous or unambiguous.

You might also like