Error while writing multi-valued function in LateX

2.2k Views Asked by At

I am creating a document in LateX and the following multivalued function has been giving me trouble for a while.

alt text

The Latex code for the above as I gave is

$\[delta \tau_{i,j}^{k}$ = $\left\{$
  \begin{array}{l l}
  \frac{1}{L_{k}} & \quad \mbox{if ant k travels on edge \textit{i,j}} \\
  0 & \quad \mbox{otherwise}
  \end{array} \right. \] 

While compiling it gives me the following error

    ! LaTeX Error: Bad math environment delimiter.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.52 $\[
        delta \tau_{i,j}^{k}$ = $\left\{$
? 

Any help on fixing this error would be much appreciated.

2

There are 2 best solutions below

3
On BEST ANSWER

aschepler is right--it's the [ inside the $.

You may also want to consider the cases environment, which I think is easier for this sort of thing. For you example, you'd have:

\[
    \Delta\tau_{i,j}^k=
    \begin{cases}
        1/L_k & \text{if ant $k$ travels along edge $i,j$} \\
        0 & \text{otherwise}
    \end{cases}
\]
3
On

You can't use both $ $ and \[ \] like that. $ is for in-line equations (fit within a paragraph of text), so you should probably use just \[ \] around your equation and remove all the $s.