January 16, 2008
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | \documentclass [12pt]{beamer} % color theme \usetheme {psu} \usecolortheme [RGB={0,38,93}]{structure} % For fancy fonts \usepackage {fontspec} \defaultfontfeatures {Scale=MatchLowercase, Mapping=tex-text} \setmainfont [Ligatures={Common}, Numbers={OldStyle}]{Cambria} \setsansfont [Scale=0.95]{Candara} \setromanfont {Cambria} \setmonofont {Monaco} \usepackage {tikz} \usetikzlibrary {arrows,automata} \begin {document} \begin {frame} \frametitle {Deterministic Finite Automaton} \begin {figure}[h] \begin {tikzpicture}[ % type of arrow head & gt ;=stealth', % keep arrow head from touching the surface shorten & gt ;= 1pt, % automatic node positioning auto, % node distance=2cm, % line thickness semithick, bend angle=15, % text for the initial state arrow. I left it as blank initial text=] \tikzstyle {every state}=[draw=blue!50, thick, fill=blue!20] \node [state,initial](qe){$q_ \epsilon $}; \node [state,accepting](q0)[above right of=qe]{$q_0$}; \node [state](q1)[below right of=qe]{$q_1$}; \node [state](q2)[right of=q0]{$q_2$}; \node [state,accepting](q3)[right of=q1]{$q_3$}; \node [state](q4)[below right of=q2]{$q_4$}; \path [-& gt ;] (qe) edge [above left] node {0} (q0) (qe) edge [below left] node {1} (q1) (q0) edge [loop above] node {0} () (q0) edge [left] node {1} (q1) (q1) edge [above left] node {0} (q2) (q1) edge [bend left] node {1} (q3) (q2) edge [above right] node {0} (q4) (q2) edge [above] node {1} (q0) (q3) edge [bend left] node {0} (q1) (q3) edge [right] node {1} (q2) (q4) edge [below right] node {0} (q3) (q4) edge [loop right] node {1} (); \end {tikzpicture} \end {figure} \end {frame} \end {document} |
Comments Off on Deterministic Finite Automaton