CST - 2nd Examination
CST - 2nd Examination
I. Multiple Choice. Choose the best answer that corresponds to the question. SHADE
the letter of the correct answer. If you think the answer is not found on the
choices, SHADE the letter that is closest to your answer.
1. Which of the following is true regarding the union of two languages L1 and L2 in the
theory of computation?
A. L1 U L2 contains only the common elements of L1 and L2.
B. L1 U L2 contains all strings that belong to either L1 or L2 or both.
C. L1 U L2 contains only the strings that belong to both L1 and L2.
D. L1 U L2 contains no elements.
2. The set of all strings over the alphabet ∑, including the empty string ε, is denoted by:
A. ∑ ¿
+ ¿¿
B. ∑
¿∗¿ ¿
C. ∑
D. ∑ ¿+¿ ¿
3. Which of the following is true regarding the complement of the empty language?
A. It is the empty language itself.
B. It contains all possible strings over the alphabet.
C. It contains only the empty string.
D. It is undefined.
5. If L1 and L2 are regular languages, what is the language accepted by the DFA obtained by
concatenating DFAs accepting L1 and L2?
A. L1 U L2
UM Tagum College
UM Visayan Campus, Tagum City, Davao del Norte
Telefax No.: (084) 655-9607 | Local 135
B. L1 ∩ L2
C. L1 ¿ L2
D. L1L2
7. A string over an alphabet is a finite set of sequence of symbols from that alphabet.
A. True
B. False
11. Can every NFA (Nondeterministic Finite Automaton) be converted to an equivalent DFA?
A. Yes
B. No
C. Sometimes
D. Only for regular languages
14. Can a DFA accept languages that contain infinitely many strings?
A. Yes, only if the language is regular.
B. Yes, if the language is context-free.
C. No, DFA can only accept finite languages.
D. No, DFA cannot accept any language with infinite strings.
15. A set that contains all possible strings over a given alphabet is known as:
A. Language
B. Grammar
C. Automaton
D. Transition
16. Which of the following statements about the empty set (Ø) is true?
UM Tagum College
UM Visayan Campus, Tagum City, Davao del Norte
Telefax No.: (084) 655-9607 | Local 135
A. It contains no elements.
B. It contains all possible elements.
C. It contains only one element.
D. It contains infinitely many elements.
18. Which of the following is NOT a basic set operation in the theory of computation?
A. Union
B. Intersection
C. Subtraction
D. Cardinality
22. What is the result when the Kleene star operation is applied to a regular language
accepted by a DFA?
A. It generates a new regular language.
B. It generates a context-free language.
C. It generates an infinite language.
D. It generates a finite language.
23. Which element of the 5-tuple representation determines the next state of the DFA given
the current state and input symbol?
A. Set of states
B. Input alphabet
C. Transition function
D. Start state
24. In the 5-tuple representation of a Deterministic Finite Automaton (DFA), what does the
first element represent?
A. Set of states
B. Input alphabet
C. Transition function
D. Start state
25. In DFA, each state has exactly how many transitions for each symbol in the input
alphabet?
A. At most one
B. At least one
C. At most two
D. Exactly one
UM Tagum College
UM Visayan Campus, Tagum City, Davao del Norte
Telefax No.: (084) 655-9607 | Local 135
M1
M2
33. Using the set builder notation, write the language of machine M2. (3pts)
34. The formal description of a DFA M3 is ({q1, q2, q3, q4, q5}, {u,d}, δ , q3, {q3}), where δ is
given by the following transition table:
u d
q1 q1 q2
q2 q1 q3
q3 q2 q4
q4 q3 q5
q5 q4 q5
Draw the state diagram of machine M3 based on the 5-tuple representation indicated. (3pts)
35. Draw the state diagram (5pts) for the given language below where: ∑= {0,1}. The
language {w | w ends with 00} with three states}.
UM Tagum College
UM Visayan Campus, Tagum City, Davao del Norte
Telefax No.: (084) 655-9607 | Local 135
36. The formal description of a DFA M4 is ({q1, q2, q3}, {a,b}, δ , q1, {q2}) where δ :
a b
q1 q2 q1
q2 q3 q3
q3 q2 q1
37. Draw the state diagram of machine M4 based on the 5-tuple representation indicated.
(3pts)
38. Draw the state diagram (5pts) for the given language below where: ∑= {0,1}. The
language {w | w has an odd number of a’s and ends with b}.