TeX source:
\begin{matrix} 1 & \mathrm{if} \; s=0, i=a\\ 2 & \mathrm{if} \; s=1, i=b\\ 0 & \mathrm{if}\; s=2, i=c\\ 3 & \; \mathrm{otherwise}\end{matrix}