MA0301/exercise12/diagrams/ex6_b.tex

26 lines
1.0 KiB
TeX
Raw Permalink Normal View History

2021-05-03 01:06:04 +02:00
\begin{tikzpicture}
\tikzset{
->, % makes the edges directed
>=Stealth, % makes the arrow heads bold
node distance=5cm, % specifies the minimum distance between two nodes. Change if necessary.
every state/.style={thick, fill=white}, % sets the properties for each state node
initial text=$ $, % sets the text that appears on the start arrow
}
\node[state] (s0) {$s_0$};
\node[state, right of=s0] (s2) {$s_2$};
\node[state, below of=s0] (s3) {$s_3$};
\node[state, right of=s3] (s1) {$s_1$};
\draw (s0) edge[loop above, above] node{a,0} (s0)
(s0) edge[right] node{b,1} (s3)
(s0) edge[above] node{c,1} (s2)
(s1) edge[below, loop below] node{(a,0), (b,0)} (s1)
(s1) edge[below] node{c,1} (s3)
(s2) edge[right] node{(a,1), (b,1)} (s1)
(s2) edge[below right, bend left] node{c,0} (s3)
(s3) edge[above left, bend left] node{a,1} (s2)
(s3) edge[below, loop below] node{b,0} (s3)
(s3) edge[left, bend left] node{c,1} (s0);
\end{tikzpicture}