a. Let A = { < A,w > | A is a DFA that accepts w}, M is a Turing machine, and L(M) = A. Suppose M accepts the string p. p is in the form of < B,s > where B is a DFA, s is a string, and B accepts s.
True
False
b. A linear equation is in the form of ax + b where a and b are constants and x is a variable. Let x-intercept be the point in which the graph of a linear equation crosses the x-axis. Note that for a given linear equation f(x) and its x-intercept, f(x-intercept) = 0. Consider the problem of determining whether x-intercept of a linear equation is greater than 0. What would be an equivalent membership problem?
a. |
{ < p > | p is an x-intercept} |
|
b. |
{ < p > | p is a linear equation and x-intercept of p is greater than 0} |
|
c. |
{ < p > | p is an x-intercept that is greater than 0} |
|
d. |
{ < p > | p is a linear equation} |
a)
Answer: True
explanation :
Given M accepts p which is of form < B,s >, and L(M) is A
and now by the definition of A
< B,s > where B is a DFA, s is a string, and B accepts s.
b)
Answer: B
{ < p > | p is a linear equation and x-intercept of p is greater than 0}
Let Show that L is undecidable L = {〈M) IM is a Turing Machine that accepts w whenever it accepts L = {〈M) IM is a Turing Machine that accepts w whenever it accepts
In class, we talked about how you could encode a DFA as a string, so that a Turing machine could read in that string M, along with another input string w, and determine whether the DFA M accepts w or not. Now, let's think about how we could do this for grammars. In particular, explain how you would encode a grammar as a string g so that a Turing machine could easily take g and an input string w and...
3. (20) Give proofs of the following: a. The question: "Given a DFA M and a string w, does M accept w" is decidable. b. Given two Turing-acceptable language Li and L2, the language LtLz is also Turing-acceptable. [D not use non-determinism. Do be sure to deal with cases where a TM might loop.l
Question 1: Every language is regular T/F Question 2: There exists a DFA that has only one final state T/F Question 3: Let M be a DFA, and define flip(M) as the DFA which is identical to M except you flip that final state. Then for every M, the language L(M)^c (complement) = L( flip (M)). T/F Question 4: Let G be a right linear grammar, and reverse(G)=reverse of G, i.e. if G has a rule A -> w B...
(g) If there is an NFA with s states which accepts a language L, then we can construct a DFA which accepts the same language and has: (circle the smallest correct answer a) s states b) 2s states d) 2 states (h) If there is a DFA which accepts a language A with s states and another whiclh accepts language B with t states, then we can construct a DFA which accepts An B which has (circle the smallest correct...
Let L = {w element {0, 1}^* | w has odd parity}. And let f: {0, 1}^* rightarrow {0, 1}^* be the function computed by a deterministic finite state transducer that does the following: for the first bit the DFT writes it out as is. Then for any bit it outputs a 1 if it is different than the previous bit and outputs a 0 if it is the same as the previous one. Produce DFA that accepts f(L).
a). Provide a DFA M such that L(M) = D, and provide an English explanation of how it works (that is, what each state represents): b). Prove (by induction on the length of the input string) that your DFA accepts the correct inputs (and only the correct inputs). Hint : your explanation in part a) should provide the precise statements that you need to show by induction. For example, you could show by induction on |w| that E2 = {[:],...
Question 1: Design a DFA with at most 5 states for the language L1 = {w ∈ {0, 1}∗ | w contains at most one 1 and |w| is odd}. Provide a state diagram for your DFA. Approaching the Solution --since we haven’t really practiced this type of assignment (i.e. had to define our machine based on only having the language given; not the formal 5 tuples), I am providing the steps for how to work through this; you are...
Question 9 10 pts Select all the statements below which are true: Every dfa is also an nfa. A maximum of 1 final state is allowed for a dfa. Alanguage that is accepted by a dfa is a regular language. Each dfa must have a trap state 0 Let M be an nfa, and let w be an input string. If Mends in a non-final state after reading w, then wis rejected. Let = {a,b,c,d}and M be an nfa with...
Mark each statement True or False. Justify each answer. a. A homogeneous system of equations can be inconsistent. Choose the correct answer below. O A. True. A homogeneous equation can be written in the form Ax o, where A is an mxn matrix and 0 is the zero vector in R". Such a system Ax -0 always has at least one solution, namely x-0. Thus, a homogeneous system of O B. True. A homogeneous equation cannot be written in the...