Also, I realise I forgot to address your most important question.
1/2 mv^2 is related to these formulae through something called “equipartition theorem”. Unless you are doing degree level chemistry/physics, I doubt you need to understand it, but here goes:
Equipartition theorem boils down to something along the lines of “for every quadratic degree of freedom a gas particle has to move, there is a 1/2 kT (or 1/2 RT for bulk matter) contribution to the (translational) kinetic energy”.
Gases move in 3 dimensions - call these x, y and z. Suppose the components of the velocity of the gas are v(x), v(y) and v(z).
The total kinetic energy will be 1/2 mv(x)^2 + 1/2 mv(y)^2 + 1/2 mv(z)^2 = 1/2 m(v(x)^2 + v(y)^2 + v(z)^2) - this is three quadratic terms, so the kinetic energy should be 3 x 1/2 kT = 3/2 kT for a single particle.
In truth, this only holds for monatomic gases as gases with more atoms can have rotational (and vibrational, if the temperature is high enough) contributions to the number of quadratic degrees of freedom.