1

I need to assign a tag to each row and column of a matrix. Currently, I have only figured out how to create the matrix:

\begin{align*}
    \begin{bmatrix}
        \{q_0\} & \{q_0, q_1\} \\
        \{q_2\} & \emptyset \\
        \emptyset & \emptyset
    \end{bmatrix}
\end{align*}

Which yields the following matrix:

Matrix generated by LaTex

I need to add q_0, q_1 and q_2 tags to the rows and 0 and 1 tags to the columns as shown in the image below.

enter image description here

Is there any way to do this?

1

Since the solution with package blkarray isn't mentioned in the above link, I'll add it here:

\documentclass{article}
\usepackage{amssymb, blkarray, bigstrut}

\begin{document}

\[ \begin{blockarray}{rcc}
   & 0 & 1 \\
\begin{block}{r[cc]}
  q_0 & \{q_0\} & \{q_0,q_1\}\bigstrut[t] \\
q_1 & \{q_2\} & \varnothing \\
q_2 & \varnothing & \varnothing \\
\end{block}
\end{blockarray} \]%

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.