How to find the difference between the son's and mother's age if it(ages of son and mother) is reversible for a total of 8 times?

499 Views Asked by At

There is a quiz question for which I need to write a python code. I don't need help for the code but this is what I need help with.

A son had recently visited his mom and found out that the two digits that form his age (eg :24) when reversed form his mother's age (eg: 42). Later he goes back to his place and finds out that this whole 'age' reversed process occurs 6 times. And if they (mom + son) were lucky it would happen again in future for two more times. So we have a total of 8 times when this would occur. The actual question is how old is the son at present ? I don't need help with that , I am trying to figure out the age difference which in turn will lead to me the present age and based on that I could write my code.

Observation: If you take any two-digit number and switch the digits, the difference between the two numbers is a multiple of 9.In particular, the difference is 9 times the difference between the two digits.

But how do I figure out this age difference ?

4

There are 4 best solutions below

4
On

He is his mother's age and presently he is $66$.

6
On

I would suspect you would start with the son's age at the first time when their age swaps were possible. For instance, suppose the son was $12$ years old. Then his mom was $21$ years old. So, your code should age the son and see how many times their ages reverse until the mom would have a 3 digit age. If it occurs eight times, then report the sixth time and you are done. Otherwise, try $13$ for the son and $31$ for the mom. Etc.

I think the answer is the mom was $9$ when she had her son. The son is $67$ and the mom is $76$. Eww.

$$\begin{array}{c|c|c}\text{Mom} & \text{Son} & \text{Number} \\ \hline 21 & 12 & 1 \\ 32 & 23 & 2 \\ 43 & 34 & 3 \\ 54 & 45 & 4 \\ 65 & 56 & 5 \\ 76 & 67 & 6 \\ 87 & 78 & 7 \\ 98 & 89 & 8\end{array}$$

1
On

The first time it happen was when the son was $10a + b$ and then mother was $10b + a$. In $k$ years it happened again and the son was $10a + b+k$ and then mother was $10b + a + k$.

Case 1: $b+k$ and $a+k$ are both under $10$

Then $a+k =a$ and $b+k = b$ and $k =0$. That's .... a loophole. The implicit assumption was $k > 0$.

Case 2: $b+k \ge 10$ but $a + k < 10$ so $k \le 9$ and $b+k \le 19$. So the son is $10(a+1) + (b+k-10)$ and the mother is $10b + (a+k)$ and $a+k = a+1$ and $(b+k-10) =b$ so $k=1$ and $k=10$. That's impossible.

Case 3: $b+k < 10$ but $a+ k \ge 10$. Same problem as Case 2. $(a+k-10)=a$ but $b+1 = b+k$.

Case 4: $b+k \ge 10$ and $a+k \ge 10$.

Case 4a: There is a $j$ so that $10j \le b+k < 10(j+1)$ and $10j \le a+k < 10(j+1)$

Son is $10(a+j) + (b+k-10j)$ and Mother is $10(b+k) + (a+k-10j)$ so $a+j = a+k-10j$ and $k = 11j$.

Now a bit of common sense: This can not proceed to three digits. The reverse of $1xy$ is $yx1$ and we can assume $200$ is beyond the range of human longevity. So if the son is the reverse of a three digit mother, then they are both $1x1$ and are the same age which is obviously impossible.

SO for this to occur $8$ times $j$ must be $1$.

For this to occur $8$ times then $8$th time we will have the son $10a+b+77$ and the mother is $10b+a+77$ and as we can never have a Case 2: or Case 3 we need $a+7 < 10$ and $b+7<10$ So $a<3$ and $b< 3$. As the mother is older $b > a$. So if $b=2$ and $a=1$ then the mother was $21$ and the boy was $12$ and that is just plain GROSS!!!!

So I'm guessing a first digit of $0$ has to be acceptable. So this occurred at when the son was $2$ and the mother was $20$.

....

To really complete this I should consinder $b+k < 10j \le a+k$ (and vice versa)

And we should also consider that in $k$ years and some months. That the son (or mother) may have had $k$ birthdays the other could have had $k+1$ birthdays.

0
On

Consider the age digit of mom as 'xy' then son will 'yx'; difference in there age is c

10x+y=x+10y+c

(x-y)=c/9

(x-y)=n

(n+9-TE,n)={7,6}=76(21,32,43,54,65,_76,87,98)

TE=it's 8 in your case

n=6th in your case

I don't explain well so i had removed all Massy things this is the final outcome I found.using above equation you can find any event age even total occurrence chance from 8 to something else