Graphics, Figures & Tablesmarkov chain

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
manishkumar
Posts: 1
Joined: Thu Mar 18, 2021 7:09 pm

markov chain

Post by manishkumar »

can anyone help what is latex code for this
Attachments
Screenshot 2021-03-18 at 10.43.20 PM.png
Screenshot 2021-03-18 at 10.43.20 PM.png (21.21 KiB) Viewed 3009 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

markov chain

Post by Bartman »

A challenging incentive to keep going:

With TikZ the right part of the drawing could be created as follows:

Code: Select all

\documentclass[tikz, border=5pt]{standalone}
\usetikzlibrary{positioning,quotes,arrows.meta,automata}

\begin{document}
\begin{tikzpicture}[
  >={Triangle[scale=.8]},
  font=\sffamily, 
  every edge/.append style={font=\sffamily\footnotesize, ->},
  every loop/.style={->}
]
\node [state] (7)              {7};
\node [state] (6) [above=of 7] {6};

% The numbers after the dots are angles: <node name>.<angle>
% alternative: <node name>.<anchor>
\path
  (7.110) edge ["1"]               (6.250)
  (6.290) edge ["1/2"]             (7.70)
  (6)     edge [loop right, "1/2"] (6)
;
\end{tikzpicture}
\end{document}
You can use the "Run LaTeX here" button to compile the code and see the result.
IbiloyeCA2021
Posts: 3
Joined: Sun Mar 21, 2021 9:18 pm

markov chain

Post by IbiloyeCA2021 »

Code: Select all

%Here is my attempt, at the Markov chain challenge. :roll: %

\documentclass[tikz, border=8pt]{standalone}
 
\usetikzlibrary{positioning,quotes,arrows.meta,automata}

   \begin{document}
    \begin{tikzpicture}[
  >={Diamond[scale=.8]},
  font=\sffamily, 
  every edge/.append style={font=\sffamily\footnotesize, ->},
  every loop/.style={->}
]
\node [state] (7)              {7};
\node [state] (6) [above=of 7] {6};
\node [state] (2)  [above= of 6.210] {2};
\node [state] (1)  [left= of 2] {1};
\node [state] (3) [below =of 1.150] {Start};
% The numbers after the dots are angles: <node name>.<angle>
% alternative: <node name>.<anchor>
\path
  (3)   edge ["1.3"]    (1)
  (1.30)   edge ["2/3"]    (2.150)
  (2.200)   edge ["2/3"]    (1.340)
  (2.300)  edge ["1/3"]            (6)
  (7.110) edge ["2/3"]               (6.250)
  (6.290) edge ["1/3"]             (7.70)
  (6)     
  ;
  \end{tikzpicture}
    \end{document}
Post Reply