One-to-one correspondence between these two problems? 
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?
 A: 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.
A: 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}$. 
