Schwin has a large jar containing some M&Ms, each with the letter "m" stamped on it. He removes 1000 candies from the jar, and removes the letter "m" from each one. He then returns all of the M&Ms to the jar. After thoroughly mixing up the candies in the jar, he randomly removes 1000 candies from the jar, and finds that 245 of them do not contain the letter "m". To the nearest integer, what is the expected number of M&Ms in the jar?
I started out by setting a proportion: $\frac{245}{1000}=\frac{1000}{x}$
Then, I solve it getting $x=\frac{1000000}{245}\approx 4028$
Apparently, this was the right answer. However, I have no idea what I just did, as I was playing around with the problem. Could someone please explain what I did? Thanks!