1
$\begingroup$

How many 3-digit positive integers are there whose middle digit is equal to the sum of the first and last digits?

I noticed that the solution to this problem, $45$, is the same as the solution to the problem

How many 3-digit positive integers are there whose middle digit is the average of the first and last digits?

Is this purely a coincidence or is there some sort of a bijection/one-to-one correspondence that links these two?

$\endgroup$
  • $\begingroup$ I am not completely sure, but it is not clear to me, what a bijection between two problems should be, when the problems have no free parameters, like the bijection between two fixed numbers 23 and 42. Shouldn't it be simply 23 $\leftrightarrow$ 42, or "sum" $\leftrightarrow$ "average"? $\endgroup$ – flonk Jan 11 '14 at 22:38
  • $\begingroup$ Presumably what is being asked for is a reasonable bijection between the solution sets to the two problems. $\endgroup$ – Greg Martin Jan 11 '14 at 22:42
  • $\begingroup$ Yes -- I want to know why (if it is not just a coincidence) both answers come out to be the same. It seems like they could be related. $\endgroup$ – 1110101001 Jan 11 '14 at 22:43
  • $\begingroup$ @GregMartin Of course, there is because both sets have the same size. But I guess for an insightful answer, one might have to find generalized problems. $\endgroup$ – flonk Jan 11 '14 at 22:44
  • $\begingroup$ @flonk There is a pretty obvious generalization, from base $10$ to base $b$. $\endgroup$ – bof Jan 11 '14 at 23:07
4
$\begingroup$

Note that in both problems, the middle digit (if valid) is determined by the first and last digits.

There are 90 possible pairs of first and last digits $(f,\ell)$, since $1\le f\le 9$ and $0\le\ell\le9$. These can be grouped into 45 pairs $\{ (f,\ell), (10-f,9-\ell) \}$.

Note that exactly one member of each such pair leads to an answer to the first problem: exactly one of $f+\ell$ and $(10-f)+(9-\ell)$ is between 0 and 9, since the two sums add to 19.

Note also that exactly one member of each such pair leads to an answer to the second problem: exactly one of $\frac12(f+\ell)$ and $\frac12((10-f)+(9-\ell))$ is an integer, because the two expressions add to $\frac{19}2$ and both are half-integers.

Therefore the trivial bijection between the sets of 45 pairs induces a bijection between the solution sets of the two problems. For example, $110, 121, 132, 143$ are bijectively mapped to $999, 111, 987, 123$ respectively, while the preimages of $333, 345, 357, 369$ are $363, 385, 792, 770$ respectively.

$\endgroup$
  • 1
    $\begingroup$ And of course it works for any radix. $\endgroup$ – bof Jan 11 '14 at 23:05
  • $\begingroup$ Sorry to comment on this question after such a long time, but is there any reason why the bijection is between $(f,l)$ $\to$ $(10-f,9-l)$? Can it be between $(f,l)$ and $(9-f,10-l)$? $\endgroup$ – 1110101001 Apr 12 '14 at 4:49
  • 1
    $\begingroup$ What would the image of $990$ be then? $\endgroup$ – Greg Martin Apr 12 '14 at 5:49
1
$\begingroup$

Let $S=\{(a,b,c): b=a+c\}$ and $T=\{(a,b,c): b=\frac{a+c}{2}\}$, with $1\le a\le 9$ and $0\le b,c\le9$.

Define $f:S\rightarrow T$ by $ f(a,b,c)=\begin{cases} (\;\;\;a,\;\;\;\;\;\frac{b}{2},\;\;\;\;c) & \mbox{, if b is even}\\(10-a,\frac{19-b}{2},9-c) & \mbox{, if b is odd} \end{cases}$.

Then f defines a bijection between S and T, with inverse $g:T\rightarrow S$ defined by

$\;\;\;\;\;\;\;\;g(a,b,c)=\begin{cases} (\;\;\;a,\;\;\;\;\;\;2b,\;\;\;\;\;\;\;c) & \mbox{, if $0\le b\le4$}\\(10-a,19-2b,9-c) & \mbox{, if $5\le b\le 9$} \end{cases}$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.