Where does this equation for the activity in the gas phase equilibrium between N₂, H₂ and NH₃ come from?

I have a question with Equilibrium Constant.


I understand that for a reaction in equilibrium $aA +bB \rightleftharpoons cC +dD$
$$K\_c= \frac{[C]^c[D]^d}{[A]^a[B]^b}$$
and $K\_p$ is just using the partial pressures. 


I'm looking through my PChem1 tutorials and I saw that they wrote for 


$$\ce{1/2 N2 + 3/2 H2 <=> NH\_3}$$
$$K=\frac{a(NH\_3)}{a(N\_2)^\frac12a(H\_2)^\frac32}$$


I believe that a represents activity. However what i don't get is what follows:
$$K=\frac{a(NH\_3)}{a(N\_2)^\frac12a(H\_2)^\frac32}=\frac{\left(\frac{n(NH\_3)RT}{p\_oV}\right)}{\left(\frac{n(N\_2)RT}{p\_0V}\right)^\frac12\left(\frac{n(H\_2)RT}{p\_oV}\right)^\frac32}=\frac{n(NH\_3)}{n(N\_2)^\frac12n(H\_2)^\frac32}\left(\frac{p\_oV}{RT}\right)$$


I cant' figure out how $a(NH\_3)=\frac{n(NH\_3)RT}{p\_oV}$


It obviously has something to do with the ideal gas equation $pV=nRT$ but I don't get how.


additional context:
The question asks for the equilibrium composition starting with 1 mol each of $\ce{N\_2}$, $\ce{H\_2}$ and $\ce{NH\_3}$ in a 1L reaction vessel at 298K


P.s. I get that I am to use extent of reaction to solve this.




The activity of a molecule $\ce{M}$ as a function of its concentration in the solution can be written as


\begin{equation}
 a\_{\ce{M}} = \frac{\gamma\_{\ce{M}} c\_{\ce{M}}}{c^0} \ ,
\end{equation}


where $c^0$ is the standard concentration and $\gamma\_{\ce{M}}$ is the (dimensionless) activity coefficient (see also: [here](https://chemistry.stackexchange.com/a/10047/189) and [Wikipedia](http://en.wikipedia.org/wiki/Thermodynamic_activity#Activity_coefficient)).
If you have a sufficiently dilute solution so that non-ideal contributions become very small, the activity coefficient can be approximated by 1, i.e. $\gamma\_{\ce{M}} \approx 1$.
So, what you're left with for the activity under these conditions is


\begin{equation}
 a\_{\ce{M}} \approx \frac{c\_{\ce{M}}}{c^0} \ ,
\end{equation}


Now, the concentration is defined by $c = \frac{n}{V}$ and with the ideal gas law $\frac{n}{V} = \frac{p}{RT}$ you get:


\begin{align}
 a\_{\ce{M}} &\approx \frac{c\_{\ce{M}}}{c^0} = \frac{\frac{n\_{\ce{M}}}{V}}{\frac{n^0}{V}} \\
 &= \frac{\frac{n\_{\ce{M}}}{V}}{\frac{p^{0}}{RT}} = \frac{n\_{\ce{M}} R T}{p^{0} V}
\end{align}


where $p^{0}$ is the standard pressure.


 5