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?
1 Answer
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 $?
0
$ _
Profit!
-
-
$\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$– AmmarOct 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$– 108880Oct 13, 2019 at 7:31