Minimum Numbers to find the given average.

1k Views Asked by At

Average score of the player (sum of scores in all the games / no. of games) is given. How Can we find the minimum number of games the player should have played to achieve that average. scores are non negative numbers. eg. Average score is :- 30.25 minimum number of games :- 4

1

There are 1 best solutions below

2
On

Write the average score $x$ as a reduced fraction $x=\frac{p}q$. This means that $p$ and $q$ are integers, that $q$ is positive and that $q$ is minimal (or, equivalently, that $p$ and $q$ have no nontrivial common factor). Then the player can have played any multiple of $q$ games hence the minimum number of games the player should have played is $q$.

When $x=-30.25$, note that $-30.25=-\frac{121}{4}$ and $-121$ and $4$ have no common factors except $+1$ and $-1$, hence the minimum number of games is indeed $4$.