Question

E2 = {[:], [?], [], [1]}. Here, 22 contains all columns of Os and 1s of height two.

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

(qo, w) *m (q0, ) iff the top row of w is equal to the bottom row of w. You would also need to prove at least one other state

Claim: For all w e 3*, (1) (qo, w) *m (qo, ε), iff the top row of w is equal to the bottom row of w, and (2) (qo, w) F*m(q1,

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.

a.

The given language is { w | w contains 011 as a substring }.

This means the string 011 can have any number of 0 or 1 before it as well as after it.

So, the regular expression is :

(0+1)*011(0+1)*

b.

The given language is { w | w is of odd length and there is a 1 in every even position in the string }.

Let the language be divided into 2 parts.

L1 = { w | w is of odd length }

L2 = { w | there is a 1 in every even position in the string }

DFA for L1 is :

ЯА о. 1

DFA for L2 :

30.1

To get the DFA obtained after intersecting the above 2 DFA, the cross product of states have to be applied.

( A, B ) ( C, E, D )

(AC, AE, AD, BC, BE, BD )

The intial state will be AC and the final states will be BC and BE.

To, 1 to 1 AE -0,1 BC BD

After removing the unreachable states AE and BC, the final DFA is :

110, 1

So, the final regular expression of the given language is ( 0+1 ) + ( 0 + 1 )(1(0+1))* = (0 + 1) ( ε + (1(0+1))*).

c.

The given language is { w | w has length atmost 3 or w's length is a multiple of 4 }.

The regular expression for the set of strings having length atmost 3 is :

R1 = ( 0 + 1 + ε ) ( 0 + 1 + ε ) ( 0 + 1 + ε ).

The regular expression for the set of strings having length as multiple of 4.

R2 = ((0+1)(0+1)(0+1)(0+1))*

The required regular expression R = R1 + R2

R = ( ( 0 + 1 + ε ) ( 0 + 1 + ε ) ( 0 + 1 + ε ) ) + ( ((0+1)(0+1)(0+1)(0+1))*).

d.

The given language is { w | w contains exactly two 1s }.

The regular expression for the given language is :

(0)*1(0)*1(0)*.

Add a comment
Know the answer?
Add Answer to:
a). Provide a DFA M such that L(M) = D, and provide an English explanation of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 1: Design a DFA with at most 5 states for the language L1 = {w...

    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...

  • E={a,b,c,d}, L = {anbmchdm : n, m 2 0}. For example, s = aabccd e L...

    E={a,b,c,d}, L = {anbmchdm : n, m 2 0}. For example, s = aabccd e L because the symbols are in Unicode order, and #a(s) = #c(s), #(s) #c(s), #b(s) = #a(s); ac e L for the same reason; s = abcdd & L because #b(s) #a(s); and acbd & L beause the symbols are not in Unicode order. Prove that L & CFLs using the CF pumping theorem, starting by defining w such we Land |w| 2 k. Remember...

  • Show that L = {anbm : m ≥ n +3} is deterministic. This is for formal languages and automata... Ca...

    Show that L = {anbm : m ≥ n +3} is deterministic. This is for formal languages and automata... Can you please try to explain what you are doing and why (if necessary, if not ill try my best to figure it out.) The definitions i'm working based off of are posted as a image below. Thanks! DEFINITION 7.3 A pushdown automaton M-О. Е, Г, 0, qo, z, Fİs said to be deterministic ifit is an automaton as defined in...

  • list the assumptions (if appropriate), provide a sketch (if appropriate) A thin flat plate of length L-120 mm, thicknes...

    list the assumptions (if appropriate), provide a sketch (if appropriate) A thin flat plate of length L-120 mm, thickness t=4 mm, width W=30 mm, and thermal conductivity k-20 W/m-K is thermally joined to heat sinks at different temperatures, where T(x 0) = To-100°C and T(x = L) Ti-35°C. The top surface of the plate is subjected to uniform heat flux q"-20 kW/m2, and the bottom surface of the plate is subjected to uniform convection with a convection coefficient of h-50...

  • An m×n array A of real numbers is a Monge array if for all i,j,k, and l such that 1≤i<k≤m and ...

    An m×n array A of real numbers is a Monge array if for all i,j,k, and l such that 1≤i<k≤m and 1≤j<l≤n , we have >A[i,j]+a[k,l]≤A[i,l]+A[k,j]> In other words, whenever we pick two rows and two columns of a Monge array and consider the four elements at the intersections of the rows and columns, the sum of the upper-left and lower-right elements is less than or equal to the sum of the lower-left and upper-right elements. For example, the following...

  • Please do exercise 129: Exercise 128: Define r:N + N by r(n) = next(next(n)). Let f:N...

    Please do exercise 129: Exercise 128: Define r:N + N by r(n) = next(next(n)). Let f:N → N be the unique function that satisfies f(0) = 2 and f(next(n)) =r(f(n)) for all n E N. 102 1. Prove that f(3) = 8. 2. Prove that 2 <f(n) for all n E N. Exercise 129: Define r and f as in Exercise 128. Assume that x + y. Define r' = {(x,y),(y,x)}. Let g:N + {x,y} be the unique function that...

  • 1) Based on the sequential circuit and answer the following questions SOV a) Write equations for...

    1) Based on the sequential circuit and answer the following questions SOV a) Write equations for J, K, T, and Z in terms of the input X and the current state given by flip flop outputs QA, QB b) Based on these equations and the properties of JK and Toggle FF's fill out the state table CURRENT NEVT STATE OUTPUT QA QB X- O X=1 X-OX=1 QAQB QAQB 0 0 STATE NEXT STATE OUTPUT c) Based on the State table...

  • # In this file, fill in the ... parts with lines of code. Do not # create new functions. from ran...

    # In this file, fill in the ... parts with lines of code. Do not # create new functions. from random import seed, randrange P=[" ♟♜♝♞♛♚"]; L,R,BL,TL=["▌▐▄▀"] BonR=WonR=WonB=DonR=DonB=RonB=GonR=GonB=RonG='\033[1;m\033[' WonR+='7;31;47m' # For drawing a white piece on a red background WonB+='7;30;47m' # For drawing a white piece on a black background DonR+='2;37;41m' # For drawing a dark piece on a red background DonB+='2;37;40m' # For drawing a dark piece on a black background GonR+='2;33;41m' # For drawing gold on a red...

  • Real analysis 10 11 12 13 please (r 2 4.1 Limit of Function 129 se f: E → R, p is a limit point of E, and li...

    Real analysis 10 11 12 13 please (r 2 4.1 Limit of Function 129 se f: E → R, p is a limit point of E, and limf(x)-L. Prove that lim)ILI. h If, in addition, )o for all x E E, prove that lim b. Prove that lim (f(x))"-L" for each n E N. ethe limit theorems, examples, and previous exercises to find each of the following limits. State which theo- rems, examples, or exercises are used in each case....

  • A retaining wall is to be constructed in a normally consolidated clayey sand deposit in the...

    A retaining wall is to be constructed in a normally consolidated clayey sand deposit in the figure below. Ground water table is lmbelow the bottom of the excavation. A 20 kN/m2 surcharge pressure is applied over a wide area at the ground surface. Assume the wall moves into the excavation. Consider long-tem analysis (as it is usually the more critical analysis in excavation problems). Ignore capillarity as shown 20 kPa Clayey sand T17 kNm Y-20 kNm 5 m c'-10 kPa...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT