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.