You are on page 1of 8

Quiz #1

1. What concept did Alan Turing introduce?

Answer: The concept of decidability

2. Who is the father of modern computer science?

Answer: Alan Turing

3. What cannot be said about automata theory?

Answer: none of the choices

4. What is automata theory?

Answer: All of the choices

5. NP-Hard problems are problems that are...

Answer: intractable

6. What is a grammar?

Answer: a device that enumerates the sentences of a language

7. In the Chomsky Hierarchy:

Answer: Regular Language ⊂ Context-free Language

8. What are strings?

Answer: A string is a finite sequence of symbols chosen from Σ

9. The symbol used for the empty string is ____________.

Answer: ε

10. Given that the language L = {ε}, is L empty?

Answer No, because the language has an empty symbol

Quiz #2

1. The difference between DFA and NFA

Answer: DFA can exist in only one state at a given time while NFA can exist in multiple states

2. A DFA is defined ____________________.

Answer: by a 5-tuple which is {Q, Σ, q0, F, δ}


3. What is an ε-NFA?

Answer: It is an NFA with at least one explicit ε-transition defined.

4. “If H then C” is also the same as saying _______.

Answer: “C if H”

5. In mathematical notation, the symbol → means...

Answer: Implication

6. “Whenever H holds, C follows” can also be said as _______.

Answer: H → C

7. “C if H” is also the same as saying _______.

Answer: “If H then C”

8. In words, H → C means…

Answer: Whenever H holds, C follows

9. NFA means:

Answer: Nondeterministic Finite Automaton

10. {Q, Σ, q0, F, δ, Q × Σ → Q} is…

Answer: There is no such tuple

Quiz #3 Part 1

1. Circuits in graphs are always simple paths.

Answer: True

2. All trees contain loops.

Answer: False

3. How many sets belong to the power set of A = {a,b,c,d}?

Answer: 16

4. Empty set is a/an ________________.

Answer: Finite Set

5. If R = {(1,1),(2,3),(4,5)}, then domain of the function is?


Answer: Dom R = {1,2,4}

6. Some graphs contain cycles.

Answer: True

7. If A has m elements and B has n elements, then A x B has elements?

Answer: m x n

8. The union of sets A and B is expressed as?

Answer: A U B

9. A ⊂ B is read as ________________.

Answer: A is a proper subset of B

10. If A = {5,6,7} and B = {7,8,9} then A U B is equal to:

Answer: {5, 6, 7, 8, 9}

11. A' will contain how many elements from the original set A?

Answer: 0

12. (A')' = ?

Answer: A

13. All functions are relations

Answer: true

14. A - B will contain elements in?

Answer: A not in B

15. How many rational and irrational numbers are possible between 0 and 1?

Answer: Infinite

16. Every set is a /an ________________ of itself.

Answer: Improper Subset

17. The intersection of sets A and B is expressed as _________________.

Answer: A ∩ B
18. Connected graphs have components.

Answer: False

19. Which of the following Set Operations produces the set that contains everything that is in Set A and
in Set B?

Answer: Union

20. The power set of a given set does not contain the set itself.

Answer: False

21. The cardinality of the union of two disjoint sets is less than the sum of the cardinality of the given
sets.

Answer: True

22. If A = {0,2) and B = {1,3), then Cartesian product is?

Answer: A x B not equal B x A

23. All relations are functions

Answer: False

24. The commutativity property of set operations states that the union of any set with same set is the
set itself.

Answer: False

25. If R ={(1,1),(2,3),(4,5)}, then the Range of the function is?

Answer: Range R = {1,3,5}

26. A set has n elements, then the number of elements in its power set is?

Answer: 2 ^ n

27. The empty set is always a subset of any set.

Answer: True

Quiz #3 Part 2

1. A good regular expression of a person's name is ______________.

Answer: [A-Z][a-z]*

2. A good regular expression for any valid whole number is ______________.


Answer: [0-9]+

3. A good regular expression for any valid real number using engineering notation is ______________.

Answer: [0-9]+.[0-9]*[(E|e)[0-9]+]

4. The difference between regular expressions and finite automata is _____________.

Answer: that regular expressions are more program syntax-like while automata are more machine-like

5. The string aaaabbbccaaad  is accepted by this regular expression.

Answer: a*b*c*a*d*

6. The string abe  is accepted by this regular expression.

Answer: a*b*c*a*d*e+

7. The string acde  is accepted by this regular expression.

Answer: a*b*c*a*d*e+

8. The algebraic law of regular expression described by E + E = E is _____________.

Answer: Idempotent

9. JASON can generally be parsed by ______________.

Answer: A CFG

10. The algebraic law of regular expression described by φE = φ = Eφ is _______________.

Answer: Annihilator

Quiz #4

1. Checking whether there is a matching parenthesis in a computer code can be done by a


______________.

Answer: Context-free grammar

2. The CFG "S → (S) | SS | ε" accepts:

Answer: the string "((()))(())(())"

3. The string "0000111" is accepted by _____________.

Answer: the CFG S → 0S1 | A, A → 0A | ε

4. Which of the following ways can be done to simplify a CFG?


Answer: Eliminate productions of the form A → B

5. A symbol X is reachable _________________________.

Answer: if S →* aXβ

6. Given the productions S → αXβ, X → a, ___________________.

Answer: X is useful

7. If A →* ε, then we can say that:

Answer: A is nullable

8. What is a grammar?

Answer: A device that enumerates the sentences of a language

9. A nested if-then statement is one of these:

Answer: If w  then if x  then y  else z

10. The body of a production in CFG is composed of:

Answer: a string of terminals and non-terminals

Quiz #5

1. An ε-NFA with a stack is also regarded as:

Answer: A PDA

2. A PDA is already in its accept state if:

Answer: it is either in the final state or the stack is empty

3. An indirect way of building a CFG is to _____________

Answer: build a PDA and then construct a CFG from it

4. Which of the following statements is true about NPDA, DPDA, and RL?

Answer: RL ⊂ DPDA ⊂ NPDA

5. A pushdown automata can be regarded as:

Answer: a ε-NFA with a stack


Quiz #6

1. If Σ2 is {00, 01, 10, 11}, then Σ =

Answer: {0, 1}

2. Given the language L = {ε}, is L empty?

Answer: No, because the language has an empty symbol

3. An example string w  of a language L characterized by equal number of As and Bs is _______________.

Answer: ABBBAA

4. Let w  = 100011, is w  a member of a language of string with equal number of 0s and 1s?

Answer: Yes, because the number of 1s is the same as the number of 0s, which is 3

5. What can be said about CFLs?

Answer: It is closed under •

6. What can not be said about CFLs?

Answer: It is closed under —

7. According to what concept is CFL a superset of RL?

Answer: Chomsky Hierarchy

8. What is a language?

Answer: A collection finite-length sentences that were constructed from a finite set of symbols

9. In the Chomsky Hierarchy:

Answer: Regular Language ⊂ Context-sensitive Language 

10. Context Free Languages is closed under intersection.

Answer: False

Quiz #7

1. What is an undecidable problem?

Answer: When a TM cannot make a decision on an instance of the problem

2. What kind of languages does a TM decide?


Answer: recursively enumerable

3. If a problem can be shown that it belongs to the class of recursively enumerable languages then
______________________.

Answer: It may be solved by any TM

4. If we can successfully and correctly stimulate a TM with storage by two standard TMs, then
______________________.

Answer: we have already shown that the two are equivalent

5. What can be said about undecidable problems?

Answer: They are not recursive

6. The relationship between recursive and recursively enumerable languages is ________________.

Answer: ⊂

7. Recursive : TM that always halt = ________________ : TM that may or may not halt

Answer: recursively enumerable

8. If L is recursively enumerable then ________________.

Answer: L may not be recursively enumerable

9. A 2-Tape Turing Machine ___________________.

Answer: can show that recursive languages are closed under union

10. What is a Universal TM?

Answer: a TM that simulates another TM

You might also like