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}
1
  • 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 2, 2016 at 18:59

3 Answers 3

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}}.

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}
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

6
  • I am trying to put it as item but I am getting this error ! Undefined control sequence. <recently read> \underset l.8 \item[1.] $\underset in the edit code. Do u know how can I fix it?
    – Mr Asker
    Feb 2, 2016 at 18:45
  • Sorry, forgot to mention, that you need the amsmath package.
    – Benjamin
    Feb 2, 2016 at 19:01
  • The \left and \right modifiers to \{ and \} aren't needed. In fact, they do exactly nothing but produce code clutter.
    – Mico
    Feb 2, 2016 at 19:04
  • @Mico You are right. It's just a habit of mine, that I add \left and \right all the time, so I don't forget it when it is actually needed.
    – Benjamin
    Feb 2, 2016 at 19:35
  • Please check out the postings Is it ever bad to use \left and \right? and “(” or “\left(” parentheses? for discussions of why using \left and \right habitually can be quite counterproductive.
    – Mico
    Feb 2, 2016 at 19:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .