How to put the equation number at the end

How to put the equation number at the end like below

-
begin{equation} y =x ? –  Peter Grill Sep 19 '12 at 17:42
...also, following How to type such expression, use Q\min rather than Qmin. –  Werner Sep 19 '12 at 17:48
yes you are right :) –  william007 Sep 19 '12 at 17:48

As already explained in the comments, numbered equations are get by using the numbered equation environments (equation or with package amsmath: gather, align, …). Unless some option is set (fleqn) the equation numbers are put at the right. Package amsmath is also a bit cleverer by measuring the equation first and moves the equation number out of the way right below the equation, if the equation is too wide.

The min' is a little bit tricky if \min is used, because \min' prints the prime at the wrong place in displayed equations:

\min{}' does not help, because the distance becomes too large. \min\nolimits' helps in this case without subscripts. The following example defines a new operator \minp that also supports the case, where the subscript goes below the operator name.

\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator*{\minp}{min^\prime}
\begin{document}
$$Q\minp(k) = \sum_{j=1}^{n} Q\min(j,k)$$
\end{document}


-