Answer: 503
Explanation:
First, we need to find the largest possible value when sending a number with Option 2. If we had 10 1s the smallest binary number would be:
This is greater than 1000, so the greatest possible cost when sending with option 2 will be 9. We can look at the largest numbers less than 1000 which cost 9 with Option 1 and see if they cost 9 with option 2. The largest numbers are:
900, 810, 801, 720, 711, 702,...
The smallest possible number with 10 digits and cost 9 in Option 2 is: 10111111112 = 767
Below this, we would have:
which doesn't work. We can quickly check the numbers above and see that they cost less than 9 with method 2. So, we now need to consider numbers with cost of 8. The largest numbers with a cost of 8 in Option 1 are:
It is possible to check these in base 2 and see which is the first to cost 8 with Option 2, or we can go the other way and look at numbers with a cost of 8 in Option 2. Either way, we will find the largest possible integer with a cost of 8 is:
111110111₂ = 503
We must check and make sure that there are no numbers larger than 503 with an Option 2 cost lower than 8. The numbers with cost 7 in Option 1 with value greater than 503 are 700, 610, 601, and 520. We can check that all cost less than 7 in Option 2 and can be eliminated. The numbers with cost 6 in Option 1 with value greater than 503 are 600 and 510, neither of which have cost 6 in Option 2 and therefore do not work. Since a number with cost 5 or lower must be less than 500, the largest possible integer is 503