I was doing my homework and I am confused on what I'm doing, it can't be that straightforward. I'm making a mistake somewhere. I tried looking for practice problems but they don't cover my issue either, I'm still confused. What will be the pictorial diagram for the following transition table?

a table consisting in four columns and three rows


You just create a super simple Graphviz document encoding the information:

$ cat foo.gv 
digraph {
  q0 -> q0 [label = "input: a\noutput: 0"];
  q0 -> q2 [label = "input: b\noutput: 0"];
  q1 -> q1 [label = "input: a\noutput: 1"];
  q1 -> q0 [label = "input: b\noutput: 1"];
  q2 -> q2 [label = "input: a\noutput: 1"];
  q2 -> q1 [label = "input: b\noutput: 1"];
$ _

Process it:

$ dot foo.gv -T png -o foo.png
$ echo $?
$ _



| cite | improve this answer | |
  • $\begingroup$ Hey is this the moore diagram? $\endgroup$ – Ammar Oct 12 '19 at 9:25
  • $\begingroup$ @Ammar, hey, so you know for the future, we are encouraging gender-neutral writing: see meta.stackexchange.com/q/334900/160917, meta.stackexchange.com/q/335031/160917. I hope you'll consider thinking about how you can follow those guidelines! $\endgroup$ – D.W. Oct 12 '19 at 17:25
  • 1
    $\begingroup$ I'm sorry but is that a warning? I didn't even know I'm violating any guidelines and there isn't even any mention of a gender pronoun like he/she so how come? $\endgroup$ – Ammar Oct 13 '19 at 6:43
  • $\begingroup$ This comment now marked with "this comment was edited 1 time" wasn't gender neutral in its original form, and so was flagged for moderation attention. $\endgroup$ – 108880 Oct 13 '19 at 7:31
  • $\begingroup$ My apologies I didn't know that I wrote something like that $\endgroup$ – Ammar Oct 13 '19 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.