Filters
Question type

Study Flashcards

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

Correct Answer

verifed

verified

B

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

C

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| ?

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

If L and L' are recursively enumerable, then L is


A) regular
B) context free
C) context sensitive
D) recursive

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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)

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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=Ø

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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) *

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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.

Correct Answer

verifed

verified

D

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

Correct Answer

verifed

verified

Showing 1 - 20 of 25

Related Exams

Show Answer