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


1 Answer 1


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 $?
$ _



  • $\begingroup$ Hey is this the moore diagram? $\endgroup$
    – Ammar
    Oct 12, 2019 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, 2019 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, 2019 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, 2019 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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