By measuring the amount of light reaching the earth, the scientists can estimate the number of stars in the galaxy. Knowing the number of stars in the galaxy, the scientists can then mathematically determine the mass of the galaxy.