WorksheetsTheory of Computations -SET 6
Total questions: 150
Worksheet time: 13hrs 30mins
1. Finite state machine is represented by -------------- tuples
4
5
6
3
2.The transition function of a DFA is
Q X Σ→2Q
Q X Σ→Q
Q X Σ→2 n
Q X Σ→2n
3. Basic limitations of finite state machine is cannot remember
large amount of information
state transitions
grammar for a language
language generated
4. A finite automata recognizes
Any Language
Context Sensitive Language
Context Free Language
Regular Language
5. An NFA’s transition function returns
A Boolean value
A state
A set of states
An edge
6. For which of the following applications regular expressions can be used ?
Designing compilers
Developing text editors
Simulating sequential circuits
All of these
7. The transition function of a NFA is
Q X Σ→2Q
Q X Σ→Q
Q X Σ→2n
Q X Σ→2n
8. ε-closure of state is combination of self state and
ε-reachable state
initial state
final state
all the above
9.Number of states require to accept string ends with 101
3
4
2
can’t be represented
10. W is any string whose length is n in {0, 1}* then minimum number of states in a NFA that accepts L is
n
2n
n + 1
n - 1
11.Regular expression for the language L = { w ∈ {0, 1}* | w has no pair of consecutive zeros} is
(1 + 010)*
(01 + 10)*
(1 + 010)* (0 + λ)
(1 + 01)* (0 + λ)
12. The behavior of a NFA can be stimulated by DFA
always
sometimes
never
depend on NFA
13.The DFA shown above accepts the set of all strings over {0, 1} that
End with 00
End with 0
Begin either with 0 or 1
Contain the substring 00
Statement 1: FA can be represented graphically;
Statement 2: The nodes can be its states
Statement 3: The edges or arcs can be used for transitions.
Which of the following make the correct combination?
Statement 1 is false but Statement 2 and 3 are correct
Statement 1 and 2 are correct while 3 is wrong
None of the mentioned statements are correct
All of the mentioned
15. ___________ states are called the halt states.
ACCEPT AND START
ACCEPT and READ
ACCEPT AND WRITE
ACCEPT and REJECT
16.L={w | w=0n1m for n,m>0| } then L is accepted by which of the following
DFA
NFA
ε-NFA
All the above
I and II
II and III
I,II and III
none of the above
18. e-closure of (q0) is
{q0,q1,q2,q3,q4}
{q0,q1,q3,q4}
{q0,q1,q2,q3}
{q1,q2,q3}
19.which of the following equivalence is true?
∅ * = ε
ε* = ∅
∅ + ε = ε
∅*. ε = ε
20.Which of the following stmts are true:
There exist a DFA which has infinitely many states
There exist a DFA which accepts a language containing infinitely many strings
For every NFA with ‘n’ states, there exist an equivalent DFA with ‘n’ states
None of the above
aba
abaabb
aaba
babab
a
b
c
d
a
b
c
d
q1
q2
q3
q4
a
b
c
d
q0
q1
q2
q3
b
a
q1
c
d
0
1
A
any symbol
q0
q1,q3,q6
q5,q6
q2,q4,q5
yes
no
Obtaining the final string by concatenating the labels of the tree from left to right is called yield of a _____ tree.
Perfect
Concatenation
Leaves crafting
Parse
Given the grammar G = {{S, B}, {0,1}, {S}, P}, what are {0,1}?
Non terminals
Production
Starting Symbol
Terminals
What is an approach in CFG that starts derivation from the tree leaves?
Bottom-down approach
Top-up Approach
Bottom-less Approach
Bottom-up Approach
Which among the two approaches reduces an input string back to the start symbol?
Top down
Bottom up
What is an approach that draws the derivation tree from the start symbol to the tree leaves?
Topping approach
Top gearing approach
Top down approach
Derivation down approach
A (a) form is a tree wherein if the partial derivation tree contains the root vertex.
What is a type of derivation tree that is obtained by applying production to the rightmost variable in each step?
Right part tree
Right derivation tree
Production processing rightly
Rightly derivation tree
A left recursive production has a form of X --> aX. True or False
True
False
A grammar G is said to be ________ if there exists two or more derivation tree for some sting in a L(G).
Ambitions
Ambigious
Ambiguous
Ambitious
The set of all CFL is identical to the set of languages accepted by (a) Automata.
Which of the following is NOT considered closed for Context free languages?
Concatenation
Union
Kleen Star
Complement
During the derivation of a tree, if the leaves are null, then the derivation is null. True or False
True
False
Pushdown automata accepts
Regular language
Context-free language
Context-sensitive language
Both Regular and context-free language
What is addition in pushdown automata as compare to finite state automata?
Stack memory
Input Tape
Read Head
None of them
A pushdown automata behaves like an finite state automata when the number of auxiliary memory it has, is
1
2
0
3
Pushdown automata behaves like Turing machine when it has the number of auxiliary memory
One or more
Two or more
Zero
Can't behave like Turing machine
A PDA machine configuration (p, w, y) can be correctly represented as:
(current state, unprocessed input, stack content)
(unprocessed input, stack content, current state)
(current state, stack content, unprocessed input)
none of the mentioned
A DPDA is a PDA in which:
More than one state can have two or more outgoing transitions
Atleast one state has more than one transitions
No state p has two outgoing transitions
None of the mentioned
State true or false:
Statement: For every CFL, G, there exists a PDA M such that L(G) = L(M) and vice versa.
true
false
How many ways PDA can be accepted?
1
2
3
4
L = { a^n b^n c^m | m, n >=1} is ------------------------------ Language
Regular Language
Context Free language
Recursively Enumerable Language
Context Sensitive Language
PDA is more powerful than
Turing machine
Finite automata
Both (a) and (b)
None of these
PDA can be represented with the help of
Instantaneous description
Transition diagram
Transition table
All of these
The push down automata indicate the acceptance of input string in terms of
Finial state
Empty store
Both (a) and (b)
None of these
Which type of symbols contain in the stack of PDA
Variable
Terminal
Both (a) and (b)
None of these
The symbol Z0 in formal definition of PDA is used for
Stack symbol
Input symbol
Both (a) and (b)
None of these
Which of the following option resembles the given PDA?
{0^n1^n|n>=0}
{0^n1^2n|n>=0}
{0^2n1^n|n>=0}
None of the mentioned
A push down automaton employs ________ data structure.
Queue
Linked List
Hash Table
Stack
State true or false:
Statement: The operations of PDA never work on elements, other than the top.
true
false
may be
Can't say
Push down automata accepts _________ languages.
Type 3
Type 2
Type 1
Type 0
Which among the following is not a part of the Context free grammar tuple?
End symbol
Start symbol
Variable
Production
The moves in the PDA is technically termed as:
Turnstile
Shifter
Router
None of the mentioned
Obtaining the final string by concatenating the labels of the tree from left to right is called yield of a _____ tree.
Perfect
Concatenation
Leaves crafting
Parse
Given the grammar G = {{S, B}, {0,1}, {S}, P}, what are {0,1}?
Non terminals
Production
Starting Symbol
Terminals
What is an approach in CFG that starts derivation from the tree leaves?
Bottom-down approach
Top-up Approach
Bottom-less Approach
Bottom-up Approach
Which among the two approaches reduces an input string back to the start symbol?
Top down
Bottom up
What is an approach that draws the derivation tree from the start symbol to the tree leaves?
Topping approach
Top gearing approach
Top down approach
Derivation down approach
A (a) form is a tree wherein if the partial derivation tree contains the root vertex.
What is a type of derivation tree that is obtained by applying production to the rightmost variable in each step?
Right part tree
Right derivation tree
Production processing rightly
Rightly derivation tree
A left recursive production has a form of X --> aX. True or False
True
False
A grammar G is said to be ________ if there exists two or more derivation tree for some sting in a L(G).
Ambitions
Ambigious
Ambiguous
Ambitious
The set of all CFL is identical to the set of languages accepted by (a) Automata.
Which of the following is NOT considered closed for Context free languages?
Concatenation
Union
Kleen Star
Complement
During the derivation of a tree, if the leaves are null, then the derivation is null. True or False
True
False
Which of the following is not a Context-Free Grammar ?
anb4m Where mn ≥ 1
aibj Where mn i=2j+1
ann Where n ≥ 1
ambm+ncn Where mn ≥ 1
Which of the following RE are equivalent?
1. (00)* 2. (00)* ( ϵ +o)*
3. 0* 4. 0(00)*
1 and 2
2 and 3
2 and 4
3 and 4
How many states does Minimum DFA needs to construct a language where all string ending with "ab"
2
3
4
5
Dp Np Df Nf are PDA, NPDA, DFA and NFA,respectively.
Which of the following statement is correct ?
Dp = Np
Df = Dp
Df = Nf
Np = Nf
RE= (01+11)*
How many states need to design a minimum DFA?
2
3
1
4
Which of the following statement is true ?
Containing aaa
any number of "a" followed by "b"
any number of "b" followed by "a"
Multiple of a where a mod 3 =0
Identify the language generated by the grammar
S-->XY
X-->aX/a
Y-->bY/b
anbm where mn≥0
bman where mn≥0
anbm where mn>0
anbm where m≥n
let L1 and L2 be context free language and regular language, respectively. Then which of the following statement is True
Compliment of L1 is not regular
Compliment of L2 is not regular
Compliment of L2 is regular
L1-L2 is not a context free
L1= S-->aSB/ab
L2= S--> Sab/ab
P:L1 is regular language
Q: L2 is context free language
Which of following statement true?
P true and Q False
Q true and P False
P true and Q True
P False and Q False
L1: { 0p1q0r, where p=q and pqr≥0 }
L2: 0p1q0r, where p=q =r, and pqr≥0
L1 is context free
L2 is context free
L2 is context free
L1 is not a context free
L is a language accepted by the turning machine. x is a string accepted by TM is a
Decidable problem
Undecidable problem
X can be accepted by CFG
X can be accepted by RG
L1= anbm where n=m, nm>0
L2= anbm where nm>0
L= L1 U L2 is
L is regular grammar
L is regular but not context free
L is context free only
L is only accpeted by turing machine
Which of the problem is Undeciadable
Membership of CFG's
Ambiguity of Problem of CFGs
Membership of TM
Equivalance of finite state machines
Transition function δ of NFA i.e Q x Σ =
2Q
Q
2XQ
Q0
S-->aBCD
BCD--> DE
D-->aD/a
E--> ϵ /b
The above grammer is
Type 0 but not type 1
Type 1 but not type 2
Type 2 but not type 3
Type 0,1,2,3
L1 is a Recusive and L2 is Recursive enumerable but not recursive language. Which of the following is True?
Homomorphism of L1 is Resursive
complement of L2 is Recursive enumerable
complement of L1 is Recursive
Homomorphism of L2 is not Resursive enumerable
L1 is a Recusive and L2 is Recursive enumerable but not recursive language. Which of the following is False?
L1 is Recursive Enumerable language
Kleen Clousre of L1 is Recursive
Kleen Clousre of L2 is Recursive
Kleen Clousre of L2 is not Recursive enumerable
L1, & L2 are RL and DCFL . Which of the following is True
L1 ∪ L2 is not DCFL
L1 ∩ L2 is not DCFL
L1 ∪ L2 is CFL
none of the above
Which of the follwing is Equivalent to RE: L+ + ϵ
Kleen closure (ϵ)
Positive closure (L)
Kleen closure (Kleen closure (L))
Postive closure (L)
Which of the following Statement is True
L is language is accepted by PDA it means it is a Regular Grammar
L is language is accepted by Finite State automata it means it is a Context sensitive Grammar
L is language is accepted by Finite State automata it means it is a Context Free Grammar
L is language is accepted by PDA it means it is a Context Free Grammar
Which of the following problem is undecidable ?
Membership problem for CFG
Ambuguity of Finite state machine
Equivalent of CFL
Totally of DCLF
0p1q0r, where p=q =r, and pqr≥0 , Which of the following is true
It is accepted by Finite state machine
it is accepted by PDA
It is accpeted NPDA
It is accepted by Turing Machine
if L and compliment of L is CFL, then L is not
Regular
Context Sensitive
Context Free
Recursive language
L1 and L2 is regular language, then
L1 ∪ L2 is not Regular
L1 ∩ L2 is not Regular
U-L2 is regular, where U is universal
R1+ is not Regular
L1={10,01,110}, L2={ ϵ + 101} then L1L2 is
{ ϵ , 10101,101110}
{10101,10101}
{10110, 10101}
{10101, 101110}
Recursive Enumerable are
is a Type 0
subset of CFL
recognized by Turing machine
all of the above
Which of the problems are unsolvable?
a) Halting problem
b) Boolean Satisfiability problem
c) Both (a) and (b)
d) None of the mentioned
Which of the following a turing machine does not consist of?
a) input tape
b) head
c) state register
d) none of the mentioned
A turing machine that is able to simulate other turing machines:
a) Nested Turing machines
b) Universal Turing machine
c) Counter machine
d) None of the mentioned
If d is not defined on the current state and the current tape symbol, then the machine
a) does not halts
b) halts
c) goes into loop forever
d) none of the mentioned
Which of the following are the models equivalent to Turing machine?
a) Multi tape turing machine
b) Multi track turing machine
c) Register machine
d) All of the mentioned
A turing machine operates over:
a) finite memory tape
b) infinite memory tape
c) depends on the algorithm
d) none of the mentioned
Which of the functions are not performed by the turing machine after reading a symbol?
a) writes the symbol
b) moves the tape one cell left/right
c) proceeds with next instruction or halts
d) none of the mentioned
Turing machine can be represented using the following tools:
a) Transition graph
b) Transition table
c) Queue and Input tape
d) All of the mentioned
Statement 1: Multitrack Turing machine.
Statement 2: Gamma is Cartesian product of a finite number of finite sets.
Which among the following is the correct option?
a) Statement 1 is the assertion and Statement 2 is the reason
b) Statement 1 is the reason and Statement 2 is the assertion
c) Statement 1 and Statement 2 are independent from each other
d) None of the mentioned
According to Chomsky hierarchy, which of the following is adopted by Recursively Ennumerable language?
a) Type 0
b) Type 1
c) Type 2
d) Type 3
Which of the following statements are false?
a) A multi track turing machine is a special kind of multi tape turing machine
b) 4-heads move independently along 4-tracks in standard 4-tape turing machine
c) In a n-track turing machine, n head reads and writes on all the tracks simultaneously.
d) All of the mentioned
A multitape turing machine is ________ powerful than a single tape turing machine.
a) more
b) less
c) equal
d) none of the mentioned
Which of the following is/are not an application of turing machine?
a) Language Recognization
b) Computers of functions on non negative numbers
c) Generating devices
d) None of the mentioned
Which of the following cannot be a possibility of a TM while it processes an input?
a) Enters accepting state
b) Enters non-accepting state
c) Enters infinite loop and never halts
d) None of the mentioned
Pick the odd one out.
a) Subroutines
b) Multiple tracks
c) Shifting over
d) Recursion
Which among the following is not true for 2-way infinte TM?
a) tape in both directions
b) Leftmost square not distinguished
c) Any computation that can be performed by 2-way infinite tape can also be performed by standard TM.
d) None of the mentioned
For the following language, an enumerator will print:
L={anbn|n>=0}
a) anbn
b) {ab, a2b2, a3b3, …}
c) {e, ab, a2b2, a3b3, …}
d) None of the mentioned
A man said to a lady, “Your mother’s husband’s sister is my aunt”. How is that lady related to that man?
(A) Daughter
(B) Grand-daughter
(C) Mother
(D) Sister
If X is brother of the son of Y’s son, how is X related to Y?
(A) Son
(B) Brother
(C) Cousin
(D) Grand-Son
Pointing to a photograph, a man said, “I have no brother or sister but that man’s father is my father’s son”. Whose photograph was it?
(A) His son’s
(B) His father's
(C) His nephew’s
(D) His own
Which of the following statement is wrong?
Every recursive language is recursively enumerable
A language is accepted by FA if and only if it is context free
Recursive languages are closed under intersection
A language is accepted by FA if and only if it is right linear
Reursive Language has --------------------------------------
Turing Machine
No Turing Machine
PDA
FA
Union of two REL will be ----------------------------------------------
Recursive
REL
Partially Recursive
None
Complement of Recursive language will be ---------------------------
REL
Recursive
Non Recursive
none
The intersection of two Recursive Language will be
Recursive
Recursively Enumerable
Non-Recursive
Partially Reccursive
REL may or may not halt for Strings that are in Language L
True
False
Decidable problems are ----------------------
Recursive
Recursively Enumerable
Undecidable
non Recursive
Semi Decidable Problems are ------------------------
Recursive
Recursively Enumerable
Non-Recursive
None of the above
If Turing Machine not able to decide the Problem P, that comes under the category ---------- Problem
Decidable
Semi Decidable
Undecidable
None
Turing Machine will always halt for -------------------- Language
Recursive
REL
Non-Recursive
Undecidable
Recursively Enumerable Language may or may not halt for the string w that are not in Language L.
True
False
This is an example of a _______ problem.
decidable
undecidable
polynomial hard
polynomial incomplete
"Given two numbers x and y, does x evenly divide y?" This is called a _______ problem.
decision
undecidable
polynomial hard
polynomial incomplete
On the APCSP exam, you need to explain the existence of undecidable problems in computer science (Don't need to know whether a given problem is solvable or unsolvable.) Which of the following are true?
An undecidable problem may have instances that have an algorithmic solution that solves all instances of the problem.
A decidable problem is one in which an algorithm can be constructed to answer "yes" or "no" for all inputs (e.g., "is the number even?").
An undecidable problem is one in which no algorithm can be constructed that always leads to a correct yes-or-no answer. (Don't need to know if a problem is undecidable.)
The Halting problem is decidable.
When using mathematical induction to prove : i=1∑ni2=6n(n+1)(2n+1) . In step #2, after you have made your assumption, what are you trying to prove? (What is your goal?)
i=1∑k+1i2=6(k)(k+1)(2k+1)+(k+1)2
Sk+1=6k(k+1)(2k+1)
i=1∑k+1i2=6(k+1)(k+2)(2k+3)
Sk+1=(k+1)2
A counterexample is ...
a conclusion based on repeated observation of a pattern
a hypothesis made given some information on a repeated pattern
used to disprove a general rule
used to affirm our initial guess
On the basis of this assumption,
[The statement is true for n = k:
1 + 3 + 5 + 7 + . . . + (2k − 1) = k2]
What must we show?
2x1 − 1 = 12
1 + 3 + 5 + 7 + . . . + (2k − 1) = k2
1 + 3 + 5 + 7 + . . . + (2k − 1) + (2k + 1) = (k + 1)2
1 + 3 + 5 + 7 + . . . + (2n − 1) = n2
To prove this by mathematical induction, what will be the induction assumption?
1 + 3 + 5 + 7 + . . . + (2k − 1) = k2
2x1 − 1 = 12
1 + 3 + 5 + 7 + . . . + (2k − 1) + (2k + 1) = (k + 1)2
1. Write regular expression for All the words of a language with alphabets {a,b,c} that begins with an ‘a’ or a ‘c’ and then followed by some number of b’s.
(a+c)b
((a+c)b)*
((a+c)*b)*
(a+c)b*
2. Write regular expression for all the words of a language with alphabets {a,b} that contains all the strings of a’s and b’s of length exactly three.
(a+b)3
(a3+b3)
(3a+3b)
(a+b)
3. Write regular expression for All the words of a language with alphabets {a,b} that begin with a and end with b
= ab(a+b)*ab
= a*(a+b)* b*
a(a+b)* b
= a(a+b) b
4. Write regular expression for all the words of a language with alphabets {a,b} that begin with a
a (a+b)*
a* (a+b)*
a (a+b)
a (a*+b*)*
5. Write regular expression for all the words of a language with alphabets {a,b} that ends with aa
(a+b)* a*a
aa
(a+b) aa
(a+b)* aa
6. Write regular expression for all the words of a language with alphabets {a,b} that have atleast one a
(a+b)a(a+b)
(a+b)* a (a+b)*
(a+b)* a* (a+b)*
(a+b)* a
7. Write regular expression for all the words of a language with alphabets {a,b} that have atleast one a and one b
(a+b)* a (a+b)* b (a+b)* + (a+b)*b (a+b)* a (a+b)*
(a+b)* a (a+b)* b (a+b)*
(a+b)*b (a+b)* a (a+b)*
(a+b)* a* (a+b)* b* (a+b)* + (a+b)*b* (a+b)* a* (a+b)*
8. Write regular expression for all the words of a language with alphabets {a,b} that containing any number of a’s and b’s except null string.
(a+b)*
(a+b)+
(a+b)
(a*+b*)
9. Write regular expression for all the words of a language with alphabets {a,b} that have the total number of a’s are divisible by 3
(b*a*b*a*b*a*b*)*
(b*(a+b)*(a+b)*(a+b*)*
(b*ab*ab*ab*)*
((a+b)(a+b)(a+b))*
10. Write regular expression for all the words of a language with alphabets {a,b} that third character from right end of the string is always a.
(a+b)*a (a+b)* (a+b)*
(a+b)*a (a+b) (a+b)
(a+b)*a (a*+b*) (a+b)
(a+b)*a (a+b) (a*+b*)
