Theory of Computation. Please show all work.
for lang a the trans table
a | b | |
-x1(start state) | +x2 | x3 |
+x2 | x3 | x3 |
x3 | x3 | x3 |
for lang b the tran table
a | b | |
-y1 | y3 | y2 |
+y2 | y3 | y3 |
y3 | y3 | y3 |
we have to cmbine these table.for combining follow the steps
1st step: Design DFA for both languages and name their state Q0, ...
2nd step : Rename every state in both DFA i.e. rename all states in DFA as Q0 , Q1 , Q2 , Q3 , ... assuming you have started with subscript 0 that means none of the state have same name
3rd Step: construct transition table(?) by using following steps
3a. Take start state of both DFA(DFA1 , DFA2) and name them as Q[ i , j ] where i is subscript of start state of 1st DFA and j is subscript of start state of 2nd DFA . i.e. Qi is start state of 1st DFA and Qj is start state of 2nd DFA and mark Q[i , j]as start state of combined DFA.
3b. Map state of both DFA
as
if
?(Qi,ak) = Qp1 and
?(Qj,ak) = Qp2 , where
Qp1 belongs to DFA1 and Qp2 belongs to DFA2
then ?(Q[ i , j ] , ak) =
Q[p1,p2]
3c. fill entire table while there is any Q[i,j] remaining in transition table.
4th step: Construct final state table
For AND case final state would be all Q[i , j] where
Qi and Qj is final state of DFA1 and
DFA2.
For OR case final state would be all Q[i , j] where
Qi or Qj is final state of DFA1 and DFA2.
5th step: Rename all Q[i , j] (uniquely) and draw DFA this will be your result .
when combining the tran table will be
a | b | |
Q[-x1,-y1] | Q[+x2,y3] | Q[x3,+y2] |
Q[-x1,+y2] | Q[+x2,y3] | Q[x3,y3] |
Q[-x1,y3] | Q[+x2,y3] | Q[x3,y3] |
Q[+x2,-y1] | Q[x3,y3] | Q[x3,+y2] |
Q[+x2,+y2] | Q[x3,y3] | Q[x3,y3] |
Q[+x2,y3] | Q[x3,y3] | Q[x3,y3] |
Q[x3,-y1] | Q[x3,y3] | Q[x3,+y2] |
Q[x3,+y2] | Q[x3,y3] | Q[x3,y3] |
Q[x3,y3] | Q[x3,y3] | Q[x3,y3] |
by combining the table will be formed in this way.
rename the states as
Q[-x1,-y1] asQ0
Q[-x1,+y2]asQ1
Q[-x1,y3]asQ2
Q[+x2,-y1]asQ3
Q[+x2,+y2]asQ4
Q[+x2,y3]asQ5
Q[x3,-y1]asQ6
Q[x3,+y2]asQ7
Q[x3,y3]asQ8
where Q0 is the intial state
and the reg exp is
a(ab)ab*+a(ab)ab*+a(ab)*+ab(ab)*+a(ab)*+ab(ab)*+ab(ab)*+a(ab)*+ab(ab)*+b(ab)ab*+b(ab)ab*+b(ab)ab*
Theory of Computation. Please show all work. Given the following FAs for the language {a} and...
Theory of computation. Please show all work. Construct a TG for the language of all strings where characters in odd numbered positions (i.e., the 1^st, 3^rd, 5^th, etc. characters) must be the letter "a". convert your TG from problem 3 into a regular expression (show the steps that you take).
Automata theory Q1: Assume S = {a, b}. Build a CFG for the language of all strings with a triple a in them. Give a regular expression for the same language. Convert the CFG into CNF grammar. Q2: Assume S = {a, b}. Build a CFG for the language defined by (aaa+b)*. Convert the CFG into CNF grammar. Q3: Explain when a CFG is ambiguous. Give an example of an ambiguous CFG. give vedio link also
You are given two Finite Automata (FA), FA1 and FA2, as shown below. a, b w2+ FA2 FAI You need to use the algorithm of Kleene's theorem to construct a FA3 for the union language: FA1 FA2. After constructing FA3, you need to answer the following question: How many states does FA3 have? Given the following machine: a,b 1- 2 4+ ab а a 3 Is this machine a FA or a TG? is a FA O None of the...
a. Draw the transition diagram for the DFA b. Construct a regular expression for the language of the DFA by computing all the R_ij^(k) regular expressions. Consider the following DFA: 1 A В C B A C В
Theory of Computation - Push Down Automata (PDA) and Context Free Grammars (CFG) Problem 1. From a language description to a PDA Show state diagrams of PDAs for the following languages: a. The set of strings over the alphabet fa, b) with twice as many a's as b's. Hint: in class, we showed a PDA when the number of as is the same as the number of bs, based on the idea of a counter. + Can we use a...
The following question belongs to the Theory of Automata. Make a TG (Transition Graph) for: – All words (a, b) that have at least one double letter in them Please don't forget to mention its Regular Expression.
Please show all steps and work. Thanks Find (1) an NFA and (2) a regular expression for the following languages on fa, bj. Tb) imo . L-[w: 2na(w) + 3nb(w) is even) Note: na(w) means the number of a's in the string w, and n is defined in the same way.
COMPUTER SCIENCE -- THEORY OF COMPUTATION Please write a Turing-machine style of algorithm to decide the language L1 given below. Use specific, precise, step-by-step English. Describe how to test whether or not an input string is in the language L1 in finite time. A state diagram is not necessary at all -- but optional and helpful. L1 = {w : every ‘a’ within w is to the left of every ‘b’ within w} over the following alphabet Σ = {a,...
Please show all work, the directions is on the first pictures. Please show all steps, thanks! Draw detailed and appropriate cash flow diagrams for each problem, and use the EE Equations to solve each problem. Show and explain all work. Factor Name Formula Converts to Fgiven P to P given F to A given F to A given F to F given A to P given A Symbol (F/P, i%, n) (P/F, i%, n) (A/F, i%, n) Single Payment Compound...
related to theory of automation. thank you. 3- Given the NFA below, write the transition functions and then draw the equivalent DFA. (10 Points) Note: The transitions between qo and q1 are either a, or lambda. q2 q0 q1 1-Please construct a DFA that includes both the substring aa and the substring bb, over the alphabet fa,b). (10 Points)