Calculate the cathode electrode potential in this redox reaction In this problem I'm asked to calculate the electrode potential of the magnesium electrode ($E_{Mg^{2+}/Mg}$) given the red-ox reaction:$$\text{Mg(s)}+2\text{Ag}^+(10^{-2}\text{M})\leftrightarrow 2\text{Ag(s)}+\text{Mg}^{2+}(10^{-2}\text{M})$$

The information I'm given is:


Temperature equal to $278\,K$ (the standard).
The molar concentration of the $\text{Mg}^{2+}$ ions is of $0.01\,\text{M}$.
The standard reduction potential of the $Mg$ electrode is: $E^{º}_{Mg^{2+}/Mg}=-2.34\,V$.


I know I have to use the Nernst Equation, but my solution and the book's answer are very different.

My solution:

$$E_{Mg^{2+}/Mg}=E^{º}_{Mg^{2+}/Mg}-\dfrac{0.059}{n}\,\color{#ff3300}{\mathbf{\log\frac{\left[\text{Mg}^{2+}\right]}{1}}}=\ldots=\boxed{-2.28\,V}$$

My book's solution:
$$E_{Mg^{2+}/Mg}=E^{º}_{Mg^{2+}/Mg}-\dfrac{0.059}{n}\,\color{#00ff00}{\mathbf{\log\frac{1}{\left[\text{Mg}^{2+}\right]}}}=\ldots=\boxed{-2.40\,V}$$

($n=2$ because 2 moles of electrons where exchanged per 1 mole of reaction)



I've colored the part where I go wrong (basically the logarithm). I don't know exactly why the book put the concentration in the denominator, since $\text{Mg}^{2+}$ is a product (not a reactant), therefore following what I studied, its concentration should be in the numerator.

Any help? Sorry for asking such an elementary question, but I'm still learning the basic stuff in Chemistry!

Note
I attach an image of the solution provided by the book
The equation that corresponds to the standard reduction potential is:

$$\ce{Mg^{2+} + 2e- -&gt; Mg}$$

Notice that this is not the actual half reaction in your total equation, where magnesium is oxidized. But the book is determining the reduction potential, so the magnesium ion is a reactant not a product. In the reaction quotient, the concentration/activity of magnesium ion should be in the denominator.

I'm not sure I agree that we should choose the standard reduction potential as the electrode potential for the electrode where oxidation occurs, but at least the book is consistent.