The question in the quiz is: In a company, there are only managers and workers in the ratio 2:5. It can be shown that if there are between p and q workers (both inclusive) in the company, the number of employees in the company can be uniquely determined. What is the maximum value of q−p?
The solution I have come up with was as follows.
- p <= 5x <= q , where x can be any integer value
- thus, p + q must be a multiple of 5, as both p and q have to be multiples of 5 in order for x to be an integer
- since the only way we have one multiple of 5 in a list of numbers is when we have five integers (through brute force checking of 1,2,3,4,5, and then 22,23,24,25,25, and so on), I deduced that the highest possible value for q-p must be 4. If they are different by at least 5 or more, we will have two possibilities (for instance 20,21,22,23,24,25), here both 20 and 25 can be answers and thus not unique.
I have a few questions. The solution on the page says that to satisfy the request, the range must satisfy: 5(k−1) +1 and 5(k+1)−1. I am not sure how you go to this equation. Is this something I can practice?
If we have q-p max =8 for instance, would the list 22,23,24,25,26,27,28,29,30 be invalid since we won’t have one unique solution?