Solution
= Solution
For $i\ne j$ the generator entry is $q_{ij}=r_j$. Its diagonal is the negative total departure rate, $q_{ii}=-(R-r_i)$. Thus
$$
\boxed{Q=\mathbf1r^T-RI,\qquad r=(r_1,\ldots,r_s)^T.}
$$
Every row sums to zero, as required for a continuous-time Markov-chain generator.