First I want to say that NihabaAshi's post is very correct.
A moving average of length n of say a time series (like prices of a stock etc.) is computed as xbar = (Sum of n consecutive elements)/n. That means you take only into account n elements, no more, no less. The elements are all equally weighted with weight 1, it is possible to give each element a different weight.
The purpose of a moving average is to smooth a time series, ie. to replace each member by a moving average of its neighbours. Say you take a length of 5 for the ma, then an element xn is replaced by ((xn-2) + (xn-1) + xn + (xn+1) + (xn+2))/5. That is you need to know members xn+1 and xn+2 before you may replace xn by its ma. And that is the lag of the ma. Smoothness is achieved in two ways: by the choice of length and by the choice of the weights for each x. Giving far out members, like the xn+2 in the above example, less weigth, say you multiply them by 0.5 only instead of 1, will make the ma more responsive, using a longer length or a smaller multiplier for the recent members will make it smoother.
The use of a ma in Technical analysis is less to smooth a time series, but to implement a trading method, you do not replace a member xn by its ma in the way described above, but you replace xn by ((xn-4)+(xn-3)+(xn-2)+(xn-1)+xn)/5. That is you shift the ma to the right. A TA program, like Metastock, does have an option to left-shift the ma, that is to plot it correctly. Do this and you will graphically understand lag.
The exponential ma is computed as Close*percentage + (previous EMA) * (1-percentage), percentage ranging from 0.01 to 1. Starting value is Close (or whatever value you use). That is an EMA always uses *all* previous data, weighted, while a simple ma only uses data as described by its length. So there really is no equivalence between percentage used in an EMA and length (or number of periods) used in a SMA.
That said, for practical purposes the equivalence may be computed as already quoted in previous posts. Prices are not quoted infinitesimal, that is you do not pay 78.234598122.... $ for a stock but 78.23 $ so prices are "quantized" and that is the reason the formula makes sense. The farther you get away from a certain value the less its contribution to the current value of an EMA will be till it drops below the threshold.
regards
Bernd Kuerbs