Friday, March 31, 2017

elementary number theory - A simple problem on congruences.



This is a problem on congruences given in the book of Andy Liu, titled "Arithmetical Wonderland".



The teacher asked Ace, Beatrice and Cecil to write down some $4$-digit number, write down a second $4$-digit number obtained from the first by reversing the order of the digits, and then add the two numbers. Ace’s answer was $5985$, Beatrice’s $2212$ and Cecil’s $4983$.
(a) Without looking at their work, the teacher said that both Ace and Beatrice had made mistakes. How could she tell?
(b) If Cecil had not made mistakes, what was his initial number, given that it was not divisible by $10$ and was greater than the number obtained by digit reversal?







My attempt:
If in base $10$ arithmetic, there is a $4$ digit number, let : 'abcd', then its reverse would be 'dcba'. Adding the two leads to (a+d)(b+c)(b+c)(a+d). This means that first and last digits are the same, and similarly for the middle digits.



Based on this analysis, all the three numbers are having mistakes. But it is given that Cecil did not make any. So, consider the other two conditions (i) original number is bigger than its reverse, (ii)not having a digit $0$ at the end$.



I hope that the second condition is for the sum, as there "cannot" be a number with unit's digit as $0$, as then the MSB digit would also be $0$.
So, is the second condition redundant?



How is this a problem on congruence arithmetic even, is not clear?



Answer



The $4$-digit number can be written as $$abcd=1000a+100b+10c+d$$ where $a,b,c,d\in\{0,1,...,9\}$. So the sum required is $$abcd+dcba=1000(a+d)+100(b+c)+10(b+c)+(a+d)$$ Ace's answer is $5985$ so we know that $a+d$ does not exceed $9$ - there is no carrying. But $9\neq8$ so Ace is wrong. The argument for Beatrice is similar.



For Cecil's answer, there is no carrying either, since there are still $4$ digits - $a+d$ does not exceed $9$. In fact, $a+d=3$, so we must have that either $(a,d)=(1,2)$ or $(2,1)$ since $a,d\neq0$ by the first condition. The condition that $abcd$ must be larger than $dcba$ means that it is the latter. $$abcd=2991\implies abcd+dcba=2991+1992=4983$$


No comments:

Post a Comment

analysis - Injection, making bijection

I have injection $f \colon A \rightarrow B$ and I want to get bijection. Can I just resting codomain to $f(A)$? I know that every function i...