# Function with cases or array

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.

• What kind of "improvement" are you looking for? – Werner Jan 18 '17 at 5:44
• A minor suggestion: Use \mid instead of | to denote conditioning on some event. – Mico Jan 18 '17 at 5:59
• (Or \newcommand{\given}{\mid}, but yes.) – wchargin Jan 18 '17 at 20:10

• First, if you use \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 to 7mm. Except for the optional argument, this is similar to the \bigl, \biggl, \Big ... amsmath macros.