# How to write this math equation in LaTeX

I want insert this math equation into my paper:

However, the part in the brackets make me confused. I google math equation in LaTeX but find no relavent information. This is what I alreadly have now:

$MR(e) = \Pi_{(R_{i}.ID, R_{j}.ID)}()$


-
Please try to specify your problem (and edit the title accordingly). Are you struggling with any of the symbols? Then have a look at tex.stackexchange.com/questions/14/how-to-look-up-a-symbol. Is it the putting text on top of other text? Then specify that, please. – doncherry Jan 17 '12 at 16:46

First, never use $\Pi$ when you obviously mean $\prod$. Second, I guess dots here between $R_i$ and $ID$ should be centered.

Here is what I got:

\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\Dist}{Dist}
\begin{document}
\pagestyle{empty}
\begin{displaymath}
MR(e) = \prod_{(R_i\cdot ID, R_j\cdot ID)}
\underset{\Dist_{sp}(r_i,r_j)\le\delta}{(R_i\bowtie R_j)}
\end{displaymath}
\end{document}


-
 I am appreciate for your help. One more question, do you know how to add this into a algorithm after \state(I use algorithms package). I know how to insert use  method, but don't know how to use \begin{dispalymath} \end{dispalymath} – user1069771 Jan 17 '12 at 16:54 Use this: $MR(e) = \prod_{(R_i\cdot ID, R_j\cdot ID)} \underset{\Dist_{sp}(r_i,r_j)\le\delta}{(R_i\bowtie R_j)}$. Note that the expression under \prod symbol becomes inline rather than under it: this is because you move from display math to inline math. – Boris Jan 17 '12 at 16:57