say I set
z_grid=[alive,dead]
then
pi_z=[1-dj, dj; 0, 1]
(obviously this is not the actual grid, but it gives the idea)
or a bigger example
z_grid=[healthy, sick, dead]
then
pi_z=[h*(1-dh), (1-h)*(1-dh), dh;
(1-s)*(1-ds), s*(1-ds), ds;
0,0,1]
where h is probability of remaining healthy (conditional on staying alive), s is probability of remaining sick (conditional on staying alive), and dh and ds as the two probabilities of dying (and you would set ds>dh). So, e.g., the second row first column is the probability of transitioning sick–>healthy, which is (1-s) [that you are no longer sick, conditional on staying alive] times (1-ds) [that you stay alive].
(I find it easiest to think about first setting up the top-left 2x2 for the probabilities given you stay alive, then expanding this into the full thing by multiplying it by the probabilities of staying alive (which here differ by row) and then put the last column and last row in which are fairly simple to write out)