SLIDE 1
CS 341 Practice Final Marvin K. Nakayama Computer Science Dept., NJIT
CS 341 Practice Final 2
- 1. Short answers:
(a) Define the following terms and concepts:
- i. Union, intersection, set concatenation, Kleene-star, set
subtraction, complement Answer: Union: S ∪ T = { x | x ∈ S or x ∈ T} Intersection: S ∩ T = { x | x ∈ S and x ∈ T} Concatenation: S ◦ T = { xy | x ∈ S, y ∈ T} Kleene-star: S∗ = { w1w2 · · · wk | k ≥ 0, wi ∈ S ∀ i = 1, 2, . . . , k} Subtraction: S − T = { x | x ∈ S, x ∈ T} Complement: S = { x ∈ Ω | x ∈ S} = Ω − S, where Ω is the universe of all elements under consideration.
- ii. A set S is closed under an operation f
Answer: S is closed under f if applying f to members of S always returns a member of S.
CS 341 Practice Final 3
- iii. Regular language
Answer: A regular language is defined by a DFA.
- iv. Kleene’s theorem
Answer: A language is regular if and only if it has a regular expression.
- v. Context-free language
Answer: A CFL is defined by a CFG.
- vi. Chomsky normal form
Answer: A CFG is in Chomsky normal form if each of its rules has one of 3 forms: A → BC, A → x,
- r S → ε,
where A, B, C are variables, B and C are not the start variable, x is a terminal, and S is the start variable.
CS 341 Practice Final 4
- vii. Church-Turing Thesis
Answer: The informal notion of algorithm corresponds exactly to a Turing machine that always halts (i.e., a decider).
- viii. Turing-decidable language
Answer: A language A that is decided by a Turing machine; i.e., there is a Turing machine M such that
- M halts and accepts on any input w ∈ A, and
- M halts and rejects on input input w ∈ A.
Looping cannot happen.
- ix. Turing-recognizable language
Answer: A language A that is recognized by a Turing machine; i.e., there is a Turing machine M such that
- M halts and accepts on any input w ∈ A, and
- M rejects or loops on any input w ∈ A.