For the given reaction, we first write the two half-reactions:
- Oxidation half-reaction: Mg(s) \rightarrow \text{Mg}^{2+} (0.100 M) + 2e^{-}
- Reduction half-reaction: 2Ag^{+} (0.001 M) + 2e^{-} \rightarrow 2Ag(s)
Now, to calculate the cell potential, we use the Nernst equation:
\[
E_{\text{cell}} = E^\circ_{\text{cell}} - \frac{0.0592}{n} \log Q
\]
Here, \( n = 2 \) (the number of electrons transferred) and
\[
Q = \frac{[\text{Mg}^{2+}][\text{Ag}]^2}{[\text{Ag}^{+}]^2[\text{Mg}]}
\]
Substituting the given values:
\[
Q = \frac{(0.100)(1)^2}{(0.001)^2(1)} = 10^4
\]
Now, apply the Nernst equation:
\[
E_{\text{cell}} = 3.17 - \frac{0.0592}{2} \log 10^4 = 3.17 - \frac{0.0592}{2} \times 4 = 3.17 - 0.1184 = 3.0516 \, \text{V}
\]
Thus, the cell potential is \( E_{\text{cell}} = 3.0516 \, \text{V} \).