1

How can I add the term v<-{0,1}^n to the formula as in the screenshot?

   $  Pr_{v \leftarrow {0,1}^n} [ Fre(A,B,C) = Ja ] \leq \frac{1}{2} $

Enter image description here

Edit Code:

\documentclass{article}

\usepackage{ amssymb }

\begin{document}

\begin{itemize}
\item[1.] $\underset{v \leftarrow {0,1}^n}{\Pr} \Big[ \texttt{Fre}(A,B,C) = \texttt{Ja} \Big] \leq \frac{1}{2}$

\end{itemize}
\end{document}
Mr Asker
  • 837
  • The code you've posted under the Edit Code: line won't compile unless one replaces \usepackage{ amssymb } with \usepackage{ amsmath }. (The macro \underset is provided by the amsmath package.) – Mico Feb 02 '16 at 18:59

3 Answers3

3

I suggest you use the \Pr macro, which places its subscript argument (the "constraint") below rather than to the side when in displaystyle-math mode. For inline-style math mode, add \limits after \Pr.

A separate issue: use \mathtt for the letters that apparently need to be set in monospaced (aka "teletype") font face.

enter image description here

\documentclass{article}
\begin{document}
\begin{tabular}{ll}
inline-style math: use \texttt{\string\limits}&
$
\Pr\limits_{v\gets\{0,1\}^n} [ \mathtt{Fre}(A,B,C) = \mathtt{Ja} ] \leq \frac{1}{2} .
$ \\[3ex]
display-style math &
$\displaystyle
\Pr_{v\gets\{0,1\}^n} [ \mathtt{Fre}(A,B,C) = \mathtt{Ja} ] \leq \frac{1}{2} .
$
\end{tabular}
\end{document}
Mico
  • 506,678
2

For example (some tuning is needed):

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\[
  \Pr_{v \leftarrow \{0,1\}^n}[ \operatorname{Fre}(A,B,C) =\operatorname{Ja} ] \leq \frac{1}{2} 
\]


\end{document}

enter image description here

If Fre and Ja are used more times, it would be wise to define them, e.g., \newcommand{\Fre}{\operatorname{Fre}}.

egreg
  • 1,121,712
0

An alternative to Przemysław's solution would be to use \underset{•}{•}.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\underset{v \leftarrow \left\{0,1\right\}^n}{\Pr} \Big[ \texttt{Fre}(A,B,C) = \texttt{Ja} \Big] \leq \frac{1}{2}
\]
\end{document}

I also tuned your original formula a bit to make it look a bit nicer.

formula

Benjamin
  • 4,781