0% found this document useful (0 votes)
26 views9 pages

Automata

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)
26 views9 pages

Automata

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/ 9

Automata and complexity Chapter 1 and 2 Question

1)What is the meaning of the Kleene Star operation on a language L?

A) The union of all strings in L


B) The set of all strings formed by concatenating zero or more strings from L
C) The reverse of strings in L
D) The subset of L containing all prefixes

2. What does the production rule S→aSb represent in a grammar?

A) The replacement of S with a followed by b


B) Generation of strings with equal numbers of a and b
C) A recursive definition of balanced strings
D) All of the above

3.What is the lexicographic order of strings over the alphabet{0,1}?

A) 0,1,00,01,10,11

B) 00,0,11,1,10

C) ϵ,1,0,11,10,01,00
D) ϵ,0,1,00,01,10,11

4. In the language L={a^nb^n:n≥0}, which of the following strings belong to L?

A) abb
B) aabb
C) aaaabbbb
D) Both B and C

5.What is the set of all strings over an alphabet Σcalled?

A) A finite language
B) The language Σ∗
C) The concatenation of Σ
D) The reverse of Σ

6. Which of the following statements about a Turing machine is true?

A) It is a finite automaton with a stack


B) It is an abstract machine capable of simulating any algorithm
C) It cannot handle context-free languages
D) It is a physical computing device

7. What does the string concatenation operation produce?

A) A subset of strings from Σ∗


B) A single string obtained by appending one string to another
C) The reverse of the first string
D) A prefix of both strings

8. What kind of language is accepted by a Deterministic Finite Automaton (DFA)?

A) Recursive enumerable language


B) Context-free language
C) Regular language
D) Context-sensitive language

9. Which of the following is a property of regular languages?

A) They can be described by a DFA.


B) They can be described by a regular grammar.
C) They can be described by a regular expression.
D) All of the above.

10. What is the language generated by the grammar G=({S},{a,b},S,P) with


P={S→aSb, S→λ}?

A) {a^nb^m: n, m≥0}

B) {a^nb^n: n≥0}
C) {a^n: n≥0}

D) {b^n: n≥0}

11. What is the main difference between a DFA and an NFA?

A) DFA has multiple start states; NFA does not.


B) NFA can have multiple transitions for the same input from a state, while DFA
cannot.
C) DFA is more powerful than NFA.
D) NFA does not accept regular languages.

12. Which of the following is a practical application of Automata?

A) Designing pattern-matching software


B) Constructing lexical analyzers for compilers
C) Checking the behavior of digital circuits
D) All of the above

13.Which of the following strings is accepted by the languageL = {a^n b^n c^n : n≥0}?

A) aabbcc
B) abcabc
C) aaabbbccc
D) Both A and C

14. What is the union of two regular languages?


A) Always regular
B) Context-free
C) Context-sensitive
D) Recursive enumerable

15. Which of the following is the correct description of a finite automaton's transition
function?

A) δ:Q→Σ
B) δ:Q×Σ→Q
C) δ:Q→Σ×Q
D) δ:Σ→Q

16. Which of the following is true about nondeterministic finite automata (NFA)?

A) They are more powerful than DFA.


B) Every NFA can be converted into an equivalent DFA.
C) They can recognize non-regular languages.
D) They require infinite states to recognize regular languages.

17. Which regular expression corresponds to the language "all strings over {0,1} that
start with 1"?

A) 1∗
B) 1(0∪1)∗
C) 0∗ 1
D) 1(0∗ 1)∗

18. Which of the following is true for deterministic finite automata (DFA)?

A) They have multiple start states.


B) They accept the same class of languages as nondeterministic finite automata
(NFA).
C) They can recognize context-sensitive languages.
D) They can process strings of infinite length.

19. Which of the following languages is not regular?

A) {0^n:n≥0}
B) {0^n1^n:n≥0}
C) {0,1}∗
D) {w:w starts and ends with 0}

20. What is a necessary property of a language for it to be regular?

A) It can have nested dependencies.


B) It can be expressed using a finite number of rules.
C) It can be expressed using a regular expression.
D) Both B and C.
21. Which of the following is not true about finite automata?

A) They can recognize all regular languages.


B) They can process infinite-length strings.
C) They have a finite number of states.
D) They cannot recognize context-free languages.

22. What does the language {a^mb^n: m,n≥0}represent?

A) Strings with equal numbers of a s and b s.


B) Strings with independent numbers of a s and b s.
C) Strings that are palindromes.
D) Strings where a must appear before b.

23. Which of the following operations preserves regularity of a language?

A) Union
B) Concatenation
C) Kleene Star
D) All of the above

24. Which of the following is true for all regular languages?

A) They can be recognized by a deterministic finite automaton (DFA).


B) They can have nested dependencies.
C) They require a pushdown automaton to recognize.
D) They are infinite.

25)What is the regular expression for the set {ab, abab, ababab, ...}?
A. (ab)*
B. ab+
C. ab(ab)*
D. (ab)+

Answer: D

26)What does the regular expression (a+b)* represent?


A. Strings containing one or more occurrences of a or b
B. Strings containing zero or more occurrences of a or b
C. Strings containing only a or b
D. Strings containing at least one a

Answer: B

27) If Σ = {a, b}, what does a (a+b)* b represent?


A. Strings starting with a and ending with b
B. Strings containing a followed by zero or more b s
C. Strings with exactly one a and one b
D. None of the above

Answer: A

28)What is the regular expression for strings starting with 0 and ending with 1
over {0,1}?
A. (0+1)*
B. 0(0+1)*1
C. 01*
D. 0*1

Answer: B

29)Which of the following sets does the regular expression a(aa)+ represent?
A. {a, aaa, aaaaa, ...}
B. {aa, aaaa, aaaaaa, ...}
C. {a, aa, aaa, ...}
D. None of the above

Answer: A

30)Which of the following is equivalent to a*?


A. a+ + λ
B. λ + aa*
C. Both A and B
D. None of the above

Answer: C

31)Which of the following is a regular language?


A. {a^n b^n | n ≥ 0}
B. {0^n 1^n | n is prime}
C. {a, ab}
D. None of the above

Answer: C

32)For a DFA accepting language L, what is the complement of L?


A. Swap the accepting and non-accepting states
B. Add more states
C. Add a start state
D. Reverse all transitions

Answer: A

33)Which rule does not belong to the class of regular languages?


A. L1 ∪ L2
B. L1 L2
C. L*
D. L-L2

Answer: D

34)What is the language of a regular expression b*ab* over Σ = {a, b}?


A. Strings with at most one a
B. Strings containing exactly one a
C. Strings with no a
D. None of the above

Answer: B

35)What is the regular expression for {w | w contains an even number of


0s}?
A. (0+1)*
B. 1*(01*01*)*
C. 0*1*0*
D. (01)*

Answer: B

36)What does an NFA state transition depend on?


A. Only the current state
B. Current state and input symbol
C. Only the input symbol
D. None of the above

Answer: B

37)What kind of machine outputs based on states and inputs?


A. Moore machine
B. Mealy machine
C. Both A and B
D. None of the above

Answer: B

38)In a Moore machine, the output depends on:


A. Only the present state
B. Only the input
C. Both state and input
D. None of the above

Answer: A

39)How is concatenation of two NFAs achieved?


A. Using union
B. By chaining the NFAs together
C. Using the star operator
D. None of the above

Answer: B

40)Which of the following cannot be represented by an NFA?


A. Regular expressions
B. Regular languages
C. Context-free languages
D. Finite languages

Answer: C

41)The pumping lemma is used to prove that a language is:


A. Regular
B. Context-free
C. Not regular
D. None of the above

Answer: C

42)For the pumping lemma, a string w is divided into parts:


A. x, y, z
B. x, y
C. x, z
D. None of the above

Answer: A

43)If L is regular, then for all strings w in L, which condition is true?


A. |xy| ≥ c
B. |xy| ≤ c
C. |x| > 0
D. None of the above

Answer: B

44)Which of the following languages is regular?


A. {a^n b^n | n ≥ 0}
B. {a^n b^m | n, m ≥ 0}
C. {ww^R | w ∈ {a,b}*}
D. None of the above

Answer: B

45)The regular expression for {a^2n+1 | n > 0} is:


A. a(aa)*
B. a+(aa)*
C. (aa)*a
D. None of the above
Answer: A

46)The set {w ∈ Σ* | w contains at most one a} is represented by:


A. b*a*b*
B. b*(a + λ)b*
C. b*ab*
D. a*b*

Answer: B

47)The complement of a DFA is obtained by:


A. Adding states
B. Swapping accepting and non-accepting states
C. Reversing all transitions
D. None of the above

Answer: B

48)The language L = {a^ib^i | i ≥ 0} is:


A. Regular
B. Not regular
C. Context-free
D. Both B and C

Answer: D

49)The operation L1 ∪ L2 for languages L1 and L2 is called:


A. Intersection
B. Concatenation
C. Union
D. Kleene Star

Answer: C

50)Which of the following statements is true?


A. All regular languages are finite
B. All finite languages are regular
C. Regular languages cannot be infinite
D. None of the above

Answer: B

51)Which of the following is true about the Pumping Lemma for regular
languages?
A. It is used to prove that a language is regular.
B. It states that regular languages can always be pumped.
C. It helps to prove that a language is not regular.
D. It only applies to context-free languages.

Answer: C
52))In the context of the Pumping Lemma, what condition must the string y
satisfy in the decomposition w=xyz?
A. y must be empty.
B. ∣y∣≥1
C. ∣xy∣≥p
D. ∣yz∣≤p

Answer: B

You might also like