Answer :
The initial factor is the moon's size, which is relatively small compared to the Earth, meaning it has less gravity. This means that more gas is allowed to escape from the surface, which means that there is no atmosphere. This leaders to highly fluctuating temperatures.
To find the relationship between them, let's take advantage of Physics. According to Newton's law of gravitation:
[tex] F_g = \frac{GmM}{R^2} [/tex]
Where m = Mass of the body on the surface.
M = Mass of the bigger object, which in this case is the Moon.
R = Radius of the moon (assuming the body is at the surface of the Moon) or in general sense, it is the distance between the two objects.
Relatively,the mass of the Moon is less than that of our Earth, meaning the force of gravity will be less on the surface of the Moon compared to the Earth as, according to the above equation, mass of the bodies are directly proportional to their respective force of gravity.
Since gravity is weak on the surface of the Moon, it cannot keep the atmosphere around itself (as atmosphere is nothing but teeny tiny particles floating around on the surface and they escape the gravity of the moon). Consequently, there will be a varying range of temperature on the surface of the Moon due to little to no atmosphere.