If $a<b$ what is the maximum possible value of a mod b+ b mod a.
I tried several times, the answer always came out to be 2a-2. But then it is not a choice. Am I right?
If $a<b$ what is the maximum possible value of a mod b+ b mod a.
I tried several times, the answer always came out to be 2a-2. But then it is not a choice. Am I right?
On
Since $b>a$, it follows that $a\mod b =a$. Further more $b \mod a$ can take the values $0,1,2...a-1$, and the largest of these values being $a-1$, so said maximum is $$2a-1$$
On
If $b\ge 3$ is fixed, then $a$ mod $b$ + $b$ mod $a=a+(b$ mod $a)$. Since $b>a$, $b$ mod $a\le b-a$. So $a$ mod $b$ + $b$ mod $a \le a+b-a = b$. This upper bound of $b$ can be achieved by taking $a=b-1$. I guess this leaves the funny case of $b=2$. Then $a$ must be 1 (I am assuming that $a$ and $b$ are restricted to positive integers since we are modding by them). In this case $a$ mod $b$ + $b$ mod $a=1+0=1$, which would be the max in the $b=2$ case.
E.g. try $a = 3$, $b = 5$. $3 + 2 > 2\times 3 - 2$.