I want to get this function:
I wrote two options, but I can't match the picture. Here is the first one:
\begin{displaymath}
P[\chi_{n+1}=j|\chi_{n}=i]=
\begin{dcases}
\frac{N-i}{N}&\text{si }j=i+1\\
\frac{i}{N}&\text{si }j=i-1\\
0&\text{otro caso}
\end{dcases}
\end{displaymath}
And here is the second one: (This one is kind of compressed)
\begin{displaymath}
P[\chi_{n+1}=j|\chi_{n}=i]=
\left\{\begin{array}{cc}
\dfrac{N-i}{N} & \text{si }j=i+1\\
\dfrac{i}{N} & \text{si }j=i-1\\
0 & \text{en otro caso}
\end{array}\right
\end{displaymath}
How can improve the code?. Thanks for the support.
Best Answer
The issue seems to be that you want the "column" to the right of the brace to be centered rather than left justified, which is what happens in all of the cases environments (at least, in all of the ones that I know about). To fix this this the OP's idea of using an array seems to be the way to go, but a few tweaks are needed.
\left\{
then there has to be a matching\right<delimiter>
. As there isn't a matching right delimiter, in this case, you can use\right.
. Personally, I don't like the sizes that\left....\right
produces so, instead, I have defined a macro\Bigger
that will scale the following delimiter to the specified height in millimeters, which defaults to7mm
. Except for the optional argument, this is similar to the\bigl
,\biggl
,\Big
... amsmath macros.\\
command. So\\[3mm]
will add an extra3mm
between the rows, which seems about right.array
environment comes with padding, so there is too much space between the brace and the equations. You can remove the left-padding by adding@{}
to the array specifications.\mid
is better than|
.With these changes the MWE produces:
This is pretty close to the "ideal" image given at the top of the question. Here is the full code: