Digit Conundrum

  • Try to solve the problem by cases.
  • There are four cases:

  1. $a = b = c = d$
  2. $a+1 = d, b = c$
  3. $a+1 < d, b = c$
  4. $a < d, b < c$.

  • Since $a \leq b \leq c \leq d$, hence $a=b, c<d$ is not possible.

We divide the situations in 4 cases:

  1. $a = b = c = d$
  2. $a+1 = d, b = c$
  3. $a+1 < d, b = c$
  4. $a < d, b < c$.


Note: We didn't include $a = d, b < c$ because it's not possible


Case 1: $a = b = c = d$

In this case $X = 0$, $Y=0$. So, $X+Y=0$


Case 2: $a+1 = d, b = c$

Since $\overline{dcba} > \overline{abcd}$ and $a < d$, hence $X's$ units digit will be $a+10 - d = a + 10 - (a+1) = 9$

Since $b = c$, hence $X's$ tens digit will be $b + 10 - (c+1) = b + 10 - (b + 1) = 9$.

Similarly, $X's$ tens digit will be $c+10 - (b+1) = c + 10 - (c + 1) = 9$.

And then the thousands digit will be $d - (a+1) = 0$


So, $X = 999$ and $Y=999$ and $X+Y=1998$.


Case 3: $a+1 < d, b = c$

This time $X's$ units digit will be $a + 10 - d$.

Like $\textbf{Case 2}$, $X's$ tens digit and hundreds digit will be $9$.

Then $X's$ thousands digit will be $d - (a+1)$.

So $X=1000 \times (d - (a+1)) + 990 + (a + 10 - d)$

and $Y=1000 \times (a + 10 - d) + 990 + (d - (a + 1))$.

Therefore, $X+Y = 10989.$


Case 4: $a < d, b < c$

$X's$ units digit will be $(a + 10 - d)$

$X's$ tens digit will be $(b + 10 - (c+1)) = (b + 9 - c)$.

$X's$ hundreds digit will be $(c - (b + 1)) = (c - b - 1)$.

$X's$ thousands digit will be $(d - a)$.

So, $X= 1000\times (d-a) + 100\times (c - b - 1) + 10 \times (b + 9 -c) + (a + 10 - d)$

and $Y = 1000\times (a + 10 - d) + 100\times (b + 9 - c) + 10 \times (c - b - 1) + (d-a)$.


Therefore, $X+Y=10890$