Problems while displaying sum limits below

I'm having some trouble when trying to correctly display a summation using LaTeX.

I'm using the package mathtools, and the formula:

Cov(O) = \frac{ \sum_{\forall c_i \in C} exists(O, c_i)}{n}


My problem is the \forall c_i \in C text appears as a sub index of the \sum element instead of appearing below it.

-
Welcome to TeX.sx! This question seems very similar to Problem with sum subscript. Can you check if the accepted solution works for you? In this case, please let us know by leaving a comment; otherwise, try being more precise in your question. –  egreg Dec 20 '12 at 12:28

This is standard because the arguments of \frac are in textmode math. Try \frac{\displaystyle ... or \frac{\sum\limits_{....

BTW: One usually never write \forall in the limits of the sum, one would usually just write \sum_{c_i \in C}, the for all is implied

-

I would prefer rewriting the text as follows:

\Cov(O) = \frac{1}{n} \sum_{\forall c_i \in C} \texists(O, c_i)


It seems that Cov(0) andexists(0,c_i) are functions, so it should be typeset as one. For that, add this to the document preamble:

\usepackage{amsmath} % not needed if it's already in the preamble
\DeclareMathOperator{\texists}{exists}
\DeclareMathOperator{\Cov}{Cov}


Notice that we cannot use the name \exists since it already exists ;)`

-