Deck 2: Formal Languages and Automata Theory: Part B
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/25
العب
ملء الشاشة (f)
Deck 2: Formal Languages and Automata Theory: Part B
1
Which one of the following languages over the alphabet {0,1} is described by the regular expression: (0+1)*0(0+1)*0(0+1)*?
A)The set of all strings containing the substring 00.
B)The set of all strings containing at most two 0's.
C)The set of all strings containing at least two 0's.
D)The set of all strings that begin and end with either 0 or 1.
A)The set of all strings containing the substring 00.
B)The set of all strings containing at most two 0's.
C)The set of all strings containing at least two 0's.
D)The set of all strings that begin and end with either 0 or 1.
The set of all strings containing at least two 0's.
2
Which one of the following is FALSE?
A)There is unique minimal DFA for every regular language
B)Every NFA can be converted to an equivalent PDA.
C)Complement of every context-free language is recursive.
D)Every nondeterministic PDA can be converted to an equivalent deterministic PDA.
A)There is unique minimal DFA for every regular language
B)Every NFA can be converted to an equivalent PDA.
C)Complement of every context-free language is recursive.
D)Every nondeterministic PDA can be converted to an equivalent deterministic PDA.
Every nondeterministic PDA can be converted to an equivalent deterministic PDA.
3
Match all items in Group 1 with correct options from those given in Group 2.
List I List II
p. Regular Expression 1. Syntax analysis
q. Push down automata 2. Code Generation
r. Dataflow analysis 3. Lexical analysis
s. Register allocation 4. Code optimization
A)P-4. Q-1, R-2, S-3
B)P-3, Q-1, R-4, S-2
C)P-3, Q-4, R-1, S-2
D)P-2, Q-1, R-4, S-3
List I List II
p. Regular Expression 1. Syntax analysis
q. Push down automata 2. Code Generation
r. Dataflow analysis 3. Lexical analysis
s. Register allocation 4. Code optimization
A)P-4. Q-1, R-2, S-3
B)P-3, Q-1, R-4, S-2
C)P-3, Q-4, R-1, S-2
D)P-2, Q-1, R-4, S-3
P-3, Q-1, R-4, S-2
4
Which of the following pairs have DIFFERENT expressive power?
A)Deterministic finite automata (DFA) and Non-Deterministic finite automata(NFA)
B)Deterministic push down automata (DPDA) and Non-deterministic pushdown automata
C)Deterministic single-tape Turing machine and Non-deterministic single-tape Turing Machine
D)Single-tape Turing machine and multi-tape Turing machine
A)Deterministic finite automata (DFA) and Non-Deterministic finite automata(NFA)
B)Deterministic push down automata (DPDA) and Non-deterministic pushdown automata
C)Deterministic single-tape Turing machine and Non-deterministic single-tape Turing Machine
D)Single-tape Turing machine and multi-tape Turing machine
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
5
Let S and T be language over ={a,b} represented by the regular expressions (a+b*)* and (a+b)*, respectively. Which of the following is true?
A)ScT (S is a subset of T)
B)TcS (T is a subset of S)
C)S=T
D)SnT=Ø
A)ScT (S is a subset of T)
B)TcS (T is a subset of S)
C)S=T
D)SnT=Ø
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
6
Let L denotes the language generated by the grammar S - OSO/00. Which of the following is true?
A)L = O
B)L is regular but not O
C)L is context free but not regular
D)L is not context free
A)L = O
B)L is regular but not O
C)L is context free but not regular
D)L is not context free
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
7
Consider the following two statements:
S1: { 0^2n |n >= l} is a regu1ar language
S2: { 0^m 0^n 0^(m+n) l m >= 1 and n >= 2} is a regu1ar language
Which of the following statements is correct?
A)Only S1 is correct
B)Only S2 is correct
C)Both S1 and S2 are correct
D)None of S1 and S2 is correct
S1: { 0^2n |n >= l} is a regu1ar language
S2: { 0^m 0^n 0^(m+n) l m >= 1 and n >= 2} is a regu1ar language
Which of the following statements is correct?
A)Only S1 is correct
B)Only S2 is correct
C)Both S1 and S2 are correct
D)None of S1 and S2 is correct
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
8
Which of the following statements in true?
A)If a language is context free it can always be accepted by a deterministic push-down automaton
B)The union of two context free languages is context free
C)The intersection of two context free languages is context free
D)The complement of a context free language is context free
A)If a language is context free it can always be accepted by a deterministic push-down automaton
B)The union of two context free languages is context free
C)The intersection of two context free languages is context free
D)The complement of a context free language is context free
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
9
Given an arbitrary non-deterministic finite automaton (NFA) with N states, the maximum number of states in an equivalent minimized DFA is at least.
A)N^2
B)2^N
C)2N
D)N!
A)N^2
B)2^N
C)2N
D)N!
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
10
Which of the following is true for the language {a^p} p is prine ?
A)It is not accepted by a turing machine
B)It is regular but not context free
C)It is context free but not regular
D)It is neither regular nor context free but accepted by a turing machine
A)It is not accepted by a turing machine
B)It is regular but not context free
C)It is context free but not regular
D)It is neither regular nor context free but accepted by a turing machine
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
11
Which of the following are decidable ?
1) whether the intersection of two regular language is infinite.
2) whether a give context free language is regular
3) whether two push down automata accept the same language.
4) whether a given grammar is context free
A)1 and 2
B)1 and 4
C)2 and 3
D)2 and 4
1) whether the intersection of two regular language is infinite.
2) whether a give context free language is regular
3) whether two push down automata accept the same language.
4) whether a given grammar is context free
A)1 and 2
B)1 and 4
C)2 and 3
D)2 and 4
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
12
If L and L' are recursively enumerable, then L is
A)regular
B)context free
C)context sensitive
D)recursive
A)regular
B)context free
C)context sensitive
D)recursive
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
13
Consider the CFG with {S,A,B) as the non-terminal alphabet, {a,b) as the terminal alphabet, S as the start symbol and the following set of production rules
S --> aB S --> bA
B --> b A --> a
B --> bS A --> aS
B --> aBB A --> bAA
Which of the following strings is generated by the grammar?
A)aaaabb
B)aabbbb
C)aabbab
D)abbbba
S --> aB S --> bA
B --> b A --> a
B --> bS A --> aS
B --> aBB A --> bAA
Which of the following strings is generated by the grammar?
A)aaaabb
B)aabbbb
C)aabbab
D)abbbba
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
14
Consider the following context free languages:
L1 = {0^i 1^j 2^k | i+j = k}
L2 = {0^i 1^j 2^k | i = j or j = k}
L3 = {0^i 1^j | i = 2j+1}
Which of the following option is true?
A)L1, L2 and L3 can be recognized by Deterministic Push down automata
B)L1, L2 can be recognized by Deterministic Push down automata
C)L1, L3 can be recognized by Deterministic Push down automata
D)None of the above
L1 = {0^i 1^j 2^k | i+j = k}
L2 = {0^i 1^j 2^k | i = j or j = k}
L3 = {0^i 1^j | i = 2j+1}
Which of the following option is true?
A)L1, L2 and L3 can be recognized by Deterministic Push down automata
B)L1, L2 can be recognized by Deterministic Push down automata
C)L1, L3 can be recognized by Deterministic Push down automata
D)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
15
Which of the following are decidable?
I. Whether the intersection of two regular languages is infinite
II. Whether a given context-free language is regular
III. Whether two push-down automata accept the same language
IV. Whether a given grammar is context-free
A)I and II
B)I and IV
C)II and III
D)II and IV
I. Whether the intersection of two regular languages is infinite
II. Whether a given context-free language is regular
III. Whether two push-down automata accept the same language
IV. Whether a given grammar is context-free
A)I and II
B)I and IV
C)II and III
D)II and IV
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
16
Let be the encoding of a Turing machine as a string over ?= {0, 1}. Let L = { |M is a Turing machine that accepts a string of length 2014 }. Then, L is
A)decidable and recursively enumerable
B)undecidable but recursively enumerable
C)undecidable and not recursively enumerable
D)decidable but not recursively enumerable
A)decidable and recursively enumerable
B)undecidable but recursively enumerable
C)undecidable and not recursively enumerable
D)decidable but not recursively enumerable
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
17
Consider three decision problems P1, P2 and P3. It is known that P1 is decidable and P2 is undecidable. Which one of the following is TRUE?
A)P3 is decidable if P1 is reducible to P3
B)P3 is undecidable if P3 is reducible to P2
C)P3 is undecidable if P2 is reducible to P3
D)P3 is decidable if P3 is reducible to P2's complement
A)P3 is decidable if P1 is reducible to P3
B)P3 is undecidable if P3 is reducible to P2
C)P3 is undecidable if P2 is reducible to P3
D)P3 is decidable if P3 is reducible to P2's complement
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
18
Consider the following decision problems:
(P1) Does a given finite state machine accept a given string
(P2) Does a given context free grammar generate an infinite number of stings
Which of the following statements is true?
A)Both (P1) and (P2) are decidable
B)Neither (P1) nor (P2) are decidable
C)Only (P1) is decidable
D)Only (P2) is decidable
(P1) Does a given finite state machine accept a given string
(P2) Does a given context free grammar generate an infinite number of stings
Which of the following statements is true?
A)Both (P1) and (P2) are decidable
B)Neither (P1) nor (P2) are decidable
C)Only (P1) is decidable
D)Only (P2) is decidable
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
19
Which of the following statements is false?
A)Every context-sensitive language is recursive.
B)The set of all languages that are not recursively enumerable is countable.
C)The family of recursively enumerable languages is closed under union.
D)The families of recursively enumerable and recursive languages are closed under reversal
A)Every context-sensitive language is recursive.
B)The set of all languages that are not recursively enumerable is countable.
C)The family of recursively enumerable languages is closed under union.
D)The families of recursively enumerable and recursive languages are closed under reversal
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
20
In some programming languages, an identifier is permitted to be a letter followed by any number of letters or digits. If L and D denotes the set of letters and digit respectively. Which of the following expression defines an identifier?
A)(L + D) *
B)(L.D) *
C)L(L + D) *
D)L(L.D) *
A)(L + D) *
B)(L.D) *
C)L(L + D) *
D)L(L.D) *
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
21
The number of strings of length 4 that are generated by the regular expression (0+1+|2+3+)*, where | is an alternation character and {+, *} are quantification characters, is:
A)08
B)09
C)10
D)12
A)08
B)09
C)10
D)12
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
22
The regular grammar for the language L = {anbm | n + m is even} is given by
A)S ? S1 | S2 S1 ? a S1| A1 A1 ? b A1| ? S2 ? aaS2| A2 A2 ? b A2| ?
B)S ? S1 | S2 S1 ? a S1| aA1 S2 ? aaS2| A2 A1 ? b A1| ? A2 ? b A2| ?
C)S ? S1 | S2 S1 ? aaa S1| aA1 S2 ? aaS2| A2 A1 ? b A1| ? A2 ? b A2| ?
D)S ? S1 | S2 S1 ? aa S1| A1 S2 ? aaS2| A2 A1 ? bb A1| ? A2 ? bb A2| ?
A)S ? S1 | S2 S1 ? a S1| A1 A1 ? b A1| ? S2 ? aaS2| A2 A2 ? b A2| ?
B)S ? S1 | S2 S1 ? a S1| aA1 S2 ? aaS2| A2 A1 ? b A1| ? A2 ? b A2| ?
C)S ? S1 | S2 S1 ? aaa S1| aA1 S2 ? aaS2| A2 A1 ? b A1| ? A2 ? b A2| ?
D)S ? S1 | S2 S1 ? aa S1| A1 S2 ? aaS2| A2 A1 ? bb A1| ? A2 ? bb A2| ?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
23
Consider the following identities for regular expressions: (a) (r + s)* = (s + r)* (b) (r*)* = r* (c) (r* s*)* = (r + s)* Which of the above identities are true?
A)(a) and (b) only
B)(b) and (c) only
C)(c) and (a) only
D)(a), (b) and (c)
A)(a) and (b) only
B)(b) and (c) only
C)(c) and (a) only
D)(a), (b) and (c)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
24
For S ? (0 + 1) * let d(s) denote the decimal value of s (e.g. d(101) = 5). Let L = {s ? (0 + 1)* d(s)mod5 = 2 and d(s)mod7 != 4}. Which one of the following statements is true?
A)L is recursively enumerable, but not recursive
B)L is recursive, but not context-free
C)L is context-free, but not regular
D)L is regular
A)L is recursively enumerable, but not recursive
B)L is recursive, but not context-free
C)L is context-free, but not regular
D)L is regular
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
25
The number of tokens in the following C statement is (GATE 2000) printf("i = %d, &i = %x", i, &i);
A)3
B)26
C)10
D)21
A)3
B)26
C)10
D)21
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck