How can I write something like this in markdown?
Here are the specific things I don't know how to do:
Here's what I would do if I knew the right syntax:
$$
CE(p, y) = \curlytwo{-\log(p) \tab \text{if }y=1}{-\log(1-p) \tab \text{otherwise.}}
$$
where I've invented \curlytwo
and \tab
.
You can use the cases
environment to write cases which is supported in MathJax:
$$
\mathrm{CE}(p, y) = \begin{cases}
-\log(p) & \text{if } y = 1 \\ % & is your "\tab"-like command (it's a tab alignment character)
-\log(1-p) & \text{otherwise.}
\end{cases}
$$