/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} Q42P Question:聽Consider the algorith... [FREE SOLUTION] | 91影视

91影视

Question:Consider the algorithm MINIMIZE, which takes a DFA as input and outputs DFA .

MINIMIZE = 鈥淥n input , where M=(Q,,,q0,A) is a DFA:

1.Remove all states of G that are unreachable from the start state.

2. Construct the following undirected graph G whose nodes are the states of .

3. Place an edge in G connecting every accept state with every non accept state. Add additional edges as follows.

4. Repeat until no new edges are added to G :

5. For every pair of distinct states q and r of and every a :

6. Add the edge (q,r) to G if q,a,r,a is an edge of G .

7. For each state q,let[q] be the collection of statesq={rQ|noedge joins q and r in G }.

8.Form a new DFA M'=Q',,',q'0,A'where

Q'={[q]|qQ}(ifq=r,onlyoneofthemisinQ'),'(q,a)=[q,a]foreveryqQanda,q00=[q0],andA0={[q]|qA}

9. Output ( M')鈥

a. Show that M and M' are equivalent.

b. Show that M0 is minimal鈥攖hat is, no DFA with fewer states recognizes the same language. You may use the result of Problem 1.52 without proof.

c. Show that MINIMIZE operates in polynomial time.

Short Answer

Expert verified

Answer:

a) M and MI are equivalent is proved..

b) No DFA with fewer states recognizes the same language is proved.

c) MINIMIZE operates in polynomial time is shown below.

Step by step solution

01

Step 1:  M and M'  are equivalent.

a)

Firstly, if a string x=x1x2xt of length t is accepted by M , and there exists a sequence of states,q0i,q1i,...,qitsuchthatq0i=q0,qij=qij-1,xj,andqitF.This implies that x can be accepted by machine one based on the sequence of states . ,q0i,q1i,...,qitsuchthatq0i=q0,qij=qij-1,xj,andqitF.Thus, Secondly, if a stringy=y1y2xtof length t is accepted by machine of its state that follows the provided algorithm.

let qi0,qi1,...,qit be the set of ,q0i,q1i,...,qitsuchthatq0i=q0,qij=qij-1,xj,andqitF.states such that ,q0i,q1i,...,qitsuchthatq0i=q0,qij=qij-1,xj,andqitF.

By induction, we can show that when y is input to M, the corresponding sequence of states visited by M,sayr0,r1,r2,...,rt,willsatisfyr0=q0,andrjqijforallj. Now,asqitF0andqitF.

Thus,rtF, so that LM0LM.

In conclusion, LM=LM0,so thatMandM0 , M,sayr0,r1,r2,...,rt,willsatisfyr0=q0,andrjqijforallj.are equivalent.

Hence, M and M' are equivalent is proved..

02

Step 2: No DFA with fewer states recognizes the same language.

b)

Let q0,x denote the state of M after reading X when M starts from q0 .

By induction, we can show that for two distinct states q and r in the undirected graph, q and r are connected by an edge if and only if there exists strings q0,x=q,q0,y=rsuch that q0,x=q,q0,y=r, x and y are distinguishable by localid="1660807511606" LM.

Based on the above result [q] will store the all states q0 such that for all x and y with q0,x=qandq0,y=q0,xandyare indistinguishable. Also, for any q0q,we observe that q0=q,.

In other words, M,sayr0,r1,r2,...,rt,willsatisfyr0=q0,andrjqijforallj.

The distinct set of states [q] in Q0 forms a partition of Q. By picking one string x with q0,xqfor each distinct [q], the resulting |Q0| strings are pair wise distinguishable by L(M) .

By Myhill-Nerode theorem, any DFA recognizing must have at least [q] states. And it has |Q0| states and LM=LM0,M0 is a minimal.

Hence, No DFA with fewer states recognizes the same language is proved.

03

Step 3: MINIMIZE operates in polynomial time.

c)

Let Q=n.M,sayr0,r1,r2,...,rt,willsatisfyr0=q0,andrjqijforallj..

Step one is to takes at most On3+n2||time,

By using the brute force connectivity algorithm. For Step three, it takes On2 time. For Step four, it repeats Steps five and six for at most On2times, each repetition takes at most O(n 2 |危|) time. For Step seven, it is done in localid="1660123076236" On2time. For Step eight, we first check if q=rfor each pair of , which requires On3time; this naturally gives a partition of Q' s states, and the partition can be stored in a table; then, we construct the final deterministic finite automaton, which takes an additional On2|| time. In total, the time required for constructing deterministic finite automaton, is On4||, which is polynomial in the length of the input.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with 91影视!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Study anywhere. Anytime. Across all devices.