0
$\begingroup$

I was trying to calculate something, when I came across with something I couldn't solve. I needed to "reverse an average", find whole numbers, of which's average is 0,625. I feel like this is a thing that must be brute forced, check every possible combination. What would the most effective way to write an algorithm that performs a reverse average search?

$\endgroup$
  • $\begingroup$ Any partition of 625 into 1000 numbers, e.g. 0+0+...0+625, is a solution. $\endgroup$ – Marcus Ritt Apr 30 at 21:58
1
$\begingroup$

$0.625 = \frac58$ so you need $8k$ integers which add up to $5k$ for some positive integer $k$ to get this exactly

$\{0,0,0,0,0,0,0,5\}$ is a simple example, as is $\{0,0,0,1,1,1,1,1\}$, but there are many more

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.