# [Tex/LaTex] Typesetting a function defined by case analysis

casesmath-mode

Can any one suggess me the code to write this equation in LaTeX.

You can make use of mathtools and its cases* environment.

The environments cases* and dcases* handles the second column as text, so you wont have to manually "escape" mathmode to typeset the text correctly. The dcases* variant use displaystyle math in the first column, which will make no difference in your situation. See section 3.4.3 in the package documentation for more details.

If you want to remove the equation number (1), you can use \begin{equation*} ... \end{equation*} instead of $$...$$.

\documentclass{article}
\usepackage{mathtools}

\begin{document}
$$L = \begin{cases*} (0 + 1)^{*} & if P = \mathit{NP} \\ \phi & otherwise \end{cases*}$$
\end{document}