where F is the gravitational force between two masses, m1 and m1, and r is the distance between them. Cavendish didn't actually calculate G. He just calculated Earth's density from his data. Still, most people credit him with finding the value of G, since plugging a few known numbers into Newton's formula would have given him that value in a minute. The present CODATA value of G is 6.67384 x 10-11m3kg-1s-2.

In this way we find that the Sun's mass is 332,946 times the mass of the Earth. This same technique can be used to estimate the mass of our Milky Way Galaxy. Stars at the periphery of our galaxy orbit its center at about 250 km/s. plugging in an appropriate value for the radius of the Milky Way gives about 1.5 x 1012 solar masses, which would definitely equate to "billions and billions" of stars if our Sun is an average star.[3] Applying the same technique to the nearby Andromeda galaxy made us confident that Andromeda and the Milky Way have about the same mass.

The Andromeda galaxy (a.k.a., M31) as seen in ultraviolet light, color mapped with blue as far UV and orange as near UV).

Instead of just using the few stars accessible at the peripheries of the two galaxies, the astronomers combined as much data as they could find for the many mass concentrations surrounding the galaxies. They used data from the smaller dwarf galaxies in orbit around them, as well as galaxies from the Local Group of which they are a part.[5]

The Local Group is bound together by the mutual gravitational affect of its galaxies. While galaxies not a part of the Local Group are receding, the Local Group galaxies are moving closer together.[5] Bayesian statistics were used to fit orbits to the published distances and velocities of these galaxies within 3 Mpc.[4]

"Historically, estimations of the Milky Way's mass have been all over the map... By studying two massive galaxies that are close to each other and the galaxies that surround them, we can take what we know about gravity and pair that with what we know about expansion to get an accurate account of the mass contained in each galaxy. This is the first time we've been able to measure these two things simultaneously."[5]

The astronomers were able to locate the center of mass of the Local Group; then, based on the location and velocity of each mass concentration, they were able to calculate the mass of both ordinary matter and dark matter. They found that Andromeda has twice the mass of the Milky Way, and the dark matter concentration in each was ninety percent.[5] The Local Group mass was 2.3 ± 0.7 x 1012 solar masses, and the mass ratio of the Milky Way to Andromeda was 0.54 +0.23/−0.17, which gives about 95% confidence that the Milky Way is truly smaller.[4]