CS252 Midterm 2
{ w | w {a, b} and there are twice as many a's as b's in w }
CFG
Chomksy Hierarchy Type 2
Context free language (pda)
Chomsky Hierarchy Type 1
Context sensitive languages (linear bounded automata)
For every non-deterministic PDA that accepts a language L, there exists a deterministic PDA that accepts L.
False
If a CFG G generates the same string using a leftmost, as well as a rightmost, derivation, then G is ambiguously.
False
EQ_DFA how to create new language
L_new=(L2comp intersect L1) union (L1comp intersect L2)
Chomsky Hierachry type 3
Regular languages (finite automata)
(True of False) We can design a TM to accept a language or perform a particular function.
True
8. (True or False) All of the following types of TMs are equivalent in expressive power: a) Single-tape TMs b) Multi-tape TMs c) Deterministic single-tape TMs d) Non-deterministic multi-tape TMs
True
B = { ww | w is a string over {a, b} and |w| > 0 } is not context-free
True
During the process of converting a CFG into its Chomsky normal form, a unit rule is introduced when the new rule S0 S is created, where S0 is the new start variable and S is the original start variable.
True
For each CFG G that generates strings in a language L, there exists a PDA that accepts L.
True
The derivation tree for a string generated by a CFG in Chomsky normal form is a binary tree.
True
The pumping lemma for CFLs states that for sufficiently long strings in a CFL, we can find two, short, nearby substrings that we can "pump" in tandem and the resulting string must also be in the language.
True
Chomsky Hierarchy Type 0
Turing marchines (Recursively enumerable languages and decidable languages)
U = On input <M, w>, where M is a TM and w is a string 1.Simulate M on input w 2.If M ever enters its accept state, accept, if M ever enters its reject state, reject
U is also called a Universal Turing Machine, since it is capable of simulating any other TM from the description of that machine. M halts on w --> accept. M does not halt --> loop
A_CFG
decidable
A_DFA
decidable
A_NFA
decidable
A_REX
decidable
EQ_DFA
decidable
E_CFG
decidable
E_DFA
decidable
A language L is Turing-recognizable if there exists a TM M such that given an input string w over the alphabet of L, M a) Halts and accepts w, or b) Halts and rejects w, or c) Loops forever and returns no answer d) Both (a) and (b) e) All of (a), (b), and (c)
e
What are the possible scenarios that can occur during the steps of a TM M in processing an input string: a) M enters the accept state and accepts the given input string b) M rejects the given input when there are no more transitions to take c) M accepts the input string when it halts d) M rejects the input string when it loops forever e) All of the above
e
Pumping lemma can be used as a tool to show that a language is context-free
false
◦Turing-recognizable languages are not closed under set difference or complementation, i.e., given two Turing-recognizable languages L and P
oIf L is also Turing-recognizable, then L is decidable oL - P may or may not be Turing-recognizable, since L - P = L Ç L Ç P
Given that L and P are two Turing-recognizable languages, then the following languages are Turing recognizable:
oThe union, L È P oThe intersection, L Ç P oThe concatenation LP of L and P oThe Kleene star L* of L
◦Given that L is a decidable language and P is a Turing-recognizable language, then the following languages are Turing-recognizable as well:
oThe union, L È P oThe intersection, L Ç P oThe concatenation LP of L and P oThe difference, P - L (but not L - P)
◦Given that L and P are two decidable languages, then the following languages are decidable as well:
oThe union, L È P oThe intersection, L Ç P oThe difference, L - P oThe complement of L, L oThe concatenation LP of L and P oThe Kleene star L* of L ◦Decidable languages L and P are closed under set difference, since L - P = L Ç L Ç P
A = { a pb q c r| p < q < r } is not context-free
true
Given that BxqjyB is obtained from BuqivB by a single transition of a TM. If the transition causes the tape head to move one cell to the left, then x is a prefix of u
true
L = { a pb p c q | p, q > 0 } { a bb q c q | p, q > 0 } is not context-free
true
EQ_CFG
undecidable
A_TM
undecidable (halting problem)
A_CFG number of steps in chomsky
w can be derived in 2n-1 steps, which allows deciability