2

How can I do the following kind of matrix in MathJax?

enter image description here

mavavilj
  • 191
  • 3
    This can quite easily be done in LaTeX, with blkarray. Realizing it in MathJax is off topic for the site. – egreg Nov 19 '16 at 13:25
  • I think this should be doable with \begin{array} as well, but not sure how exactly. – mavavilj Nov 19 '16 at 13:45

1 Answers1

5

I have no idea whether this will work in MathJax, but using LaTex with array you can do:

\documentclass{article}
\usepackage{mathtools}

\begin{document}

\begin{equation*}
\begin{array}{ccc}
 & & \textit{next state}\\
 & & \begin{array}{ccc} 1 & \quad 2 \quad & 3 \end{array}\\
\textit{current state} & \begin{array}{c} 1\\ 2\\ 3\end{array} &
  \left(\begin{array}{ccc}
    1/2 & 0 & 1/2\\
    0 & 1/2 & 1/2\\
    1/4 & 1/4 & 1/2
  \end{array}\right)
\end{array}
\end{equation*}
\end{document}

demo

John Kormylo
  • 79,712
  • 3
  • 50
  • 120