-3

i don't know how to use algorithm to covert this dfa to regular expression. Please help me.please click here to get the dfa

cyshes21
  • 11
  • 4
  • 1
    This DFA has no accepting states, so its regex is trivial. – Welbog Nov 05 '18 at 15:07
  • 2
    This is homework and has nothing to do with programming. Most likely your course material will contain the algorithm and lessons on how to convert a dfa to a regular expression. – Corion Nov 05 '18 at 15:07
  • i just cant understand how algorithm works. so if anyone can try to explaine the details i will appreciate! – cyshes21 Nov 05 '18 at 15:14
  • Just follow the arrows and write down on a piece of paper each path you find. Multiple arrows leaving the same state are alternations (`|`). Loops are quantifiers (`*`). If there's still something left unclear, then please be specific about that in your question. At present, your question is too broad. – Ruud Helderman Nov 05 '18 at 15:18
  • @RuudHelderman thank you so much!! But can you write details for me.. Sorry i really dont know how to start it.. – cyshes21 Nov 05 '18 at 15:36
  • Possible duplicate of [Convert a NFA to Regular Expression](https://stackoverflow.com/questions/20061252/convert-a-nfa-to-regular-expression) – Welbog Nov 05 '18 at 15:45
  • @Welbog isnt that covertion from nfa to r.e.? – cyshes21 Nov 05 '18 at 15:48
  • All DFAs are NFAs. The algorithm is identical. – Welbog Nov 05 '18 at 15:49

1 Answers1

0

Assuming that this notation indicates that (1) is both the initial and only accepting state, the transition table for this automaton is:

 q     s     q'
(1)    a    (3)
(1)    b    (2)
(2)    a    (1)
(3)    a    (2)
(3)    b    (3)

Let r, s and t be the regular expressions which lead to (1), (2) and (3). Then

r = e + sa
s = rb + ta
t = ra + tb

We can begin iteratively solving this system. First, we see the self-reference in the expression for t, and we can remove if with the rule x = y + xz <=> x = yz*:

r = e + sa
s = rb + ta
t = rab*

Now we can get rid of t by substituting in the first two lines:

r = e + sa
s = rb + rab*a

Now we need an expression for r, so we might as well bite the bullet and sub in the expression for s in line one:

r = e + (rb + rab*a)a
  = e + rba + rab*aa
  = e + r(ba + ab*aa)

From our rule, we further reduce:

r = (e)(ba + ab*aa)*
  = (ba + ab*aa)*

Spot checking suggests this regular expression is correct. If you accept the validity of the following rules for reducing expressions involving regular expressions (i.e., prove them or accept them without proof), the derivation constitutes a valid proof of the regular expression:

rule 1: x = y + xz IFF x = yz*
rule 2: w = xy AND x = z IFF w = zy
rule 3: w = x + y AND x = z IFF w = z + y

The interpretation given to equality above is this: the LHS is equal to the RHS if and only if the language of the LHS is equivalent to the language of the RHS. While (0+1)(0+1) and 00+01+10+11 are different regular expressions, they generate the same language of four strings and therefore are equal for the purposes of discussion.

Patrick87
  • 27,682
  • 3
  • 38
  • 73
  • thanks so much! sorry for late response! and super clear showing how you worked out! – cyshes21 Nov 15 '18 at 05:23
  • hi professor could you help me another question on: https://stackoverflow.com/questions/53692526/could-anyone-give-me-help-on-turing-machine-design – cyshes21 Dec 14 '18 at 08:33
  • @cyshes21 The question was a little complicated and has been closed. you might be able to clean it up a bit and ask it again. – Patrick87 Dec 17 '18 at 13:04