markov-chain-rain-sun.tex 873 B

1234567891011121314151617181920
  1. \documentclass[varwidth=true, border=2pt]{standalone}
  2. \usepackage{units}
  3. \usepackage{ifthen}
  4. \usepackage{tikz}
  5. \usetikzlibrary{calc}
  6. \begin{document}
  7. \tikzstyle{vertex}=[draw,black,fill=blue,circle,minimum size=10pt,inner sep=0pt]
  8. \tikzstyle{edge}=[very thick]
  9. \begin{tikzpicture}[scale=2.5]
  10. \node (a)[vertex,fill=gray!10,align=left] at (0,0) {S};
  11. \node (b)[vertex,fill=gray!10,align=left] at (1,0) {R};
  12. \path[thick,->,bend left] (a) edge node [anchor=center,above,sloped] {$\nicefrac{2}{10}$} (b);
  13. \path[thick,->,bend left] (b) edge node [anchor=center,below,sloped] {$\nicefrac{4}{10}$} (a);
  14. \path[thick,->] (a) edge[loop left, looseness=15] node [anchor=center,above] {$\nicefrac{8}{10}$} (a);
  15. \path[thick,->] (b) edge[loop right, looseness=15] node [anchor=center,above] {$\nicefrac{6}{10}$} (b);
  16. \end{tikzpicture}
  17. \end{document}