# State Transition Diagram

Can someone please provide me a starting point to draw a diagram like this. I have searched on the web, but couldn't able to find some appropriate link. Regards • inside a tikzpicture environment \draw[->] (x0,y0)--(x1,y1); gives the arrows from point to point. The circles can be drawn like \draw[fill=gray] (Xcenter,Ycenter) circle {15pt} where 15pt is the radius. The math at a point x,y can be placed there by the command \node at (x,y) {$BM(t)$};. You have all you need. Just give a MWE and we can correct any mistake. – koleygr Aug 29 '17 at 21:26
• the points are can start from any number... Start from (0,0) by putting a circle and play around by adding... circles or math. Leave the arrows for the end. – koleygr Aug 29 '17 at 21:29

for exercise ... \documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta, chains, quotes}

\begin{document}
\begin{tikzpicture}[
> = Triangle,
node distance = 8mm and 24mm,
start chain = going below,
C/.style = {shape=circle, draw,
fill=blue!60!gray!30!white,
inner sep=0pt, outer sep=0pt, minimum size=6pt,
node contents={},
},
every edge quotes/.style = {inner sep=2pt, font=\footnotesize, sloped,anchor=south}
]
\foreach \i in {1,...,4}
{
\ifnum\i=1
\node (n1\i)    [C,on chain,label=left:$\mathrm{PM}(t)$];
\node (n2\i)    [C,right=of n11,
label=right:{$\mathrm{PM}(t+1) =\max\bigl(\mathrm{BM}(t), \mathrm{BM}(T)\bigr)$}];
\else
\node (n1\i)    [C,on chain];
\node (n2\i)    [C,right=of n1\i];
\fi
}
\draw   (n11) edge[->,"$\mathrm{BM}(t)$"]   (n21)
(n13) edge[->,"$\mathrm{BM}(t)$"]   (n21);
\end{tikzpicture}
\end{document}

• Ver nice. Is there any reason why the dots are not vertically aligned? – Bernard Aug 30 '17 at 11:30
• ups, i didn't notice this before. seems to be to simplified solution. I will investigated what is going on. thank you to pointed me to this. – Zarko Aug 30 '17 at 11:35
• @Bernard, i find the cause: wrong use of chains. now corrected. – Zarko Aug 30 '17 at 11:40
• thanks for the design, I want to write 0, 1, 2, 3 in front of all left nodes, how can I proceed? – Engr Ali Sep 3 '17 at 16:04
• in nodes? then circle had to be bigger and slightly redesigned (omitted node contents={} and to node adds content like \node (n1\i) [C,on chain] {\j}; where \j is new count. if this is the case, I will add addendum to answer. – Zarko Sep 3 '17 at 17:29

The pstricks way:

\documentclass{article}
\usepackage{pst-node}
\usepackage{auto-pst-pdf}

\begin{document}

$\everypsbox{\scriptstyle}% \begin{psmatrix}[emnode=dot, rowsep=0.6cm, dotsize=5pt] %%% Matrix nodes & & \\ & & \\ & & \\ & & %%% Arrows & labels \psset{arrows=->, arrowinset=0.1, arrowsize=3pt, nodesep=0pt, shortput=nab, labelsep=1pt} \ncline{1,1}{1,2}^{BM(t)} \ncline{3,1}{1,2}^[nrot=:U]{BM(t)} \psset{labelsep=1.25em} \everypsbox{\textstyle} \nput{180}{1,1}{PM(t)} \nput{0}{1,2}{PM(t + 1)= \max\bigl(BM(t),BM(T)\bigr)} \end{psmatrix}$%

\end{document} • Thanks alot for your design, I'm getting that error while compiling above: ! Package auto-pst-pdf Error: "shell escape" (or "write18") is not enabled: auto-pst-pdf will not work! – Engr Ali Aug 30 '17 at 11:02
• @EngrAli: I'm often too lazy to add a word of explanation: pdflatex cannot do the computations required by postscript (because the pdf format, which is a subset of postscript, has not computing engine). So it has to delegate the making of the image, which is then converted to pdf, cropped, and imported back in the file. This requires you add the --enable-write18 switch to the compiler (under MiKTeX), or -shell-escape (TeX Live, MacTeX). Alternatively, you can remove loading auto-pst-pdf and either follow the traditional latex ->dvips -> pstopdf way, or compile with xelatex. – Bernard Aug 30 '17 at 11:19