5

Let $f:(\mathbb{N}\ \cup \{0\})^2$ $\rightarrow\mathbb{N}\ \cup\{0\}$ be such that $f(0, x) = f(x, 0) = 1$ for all x $\in$ $\mathbb{N}\ \cup$ {$0$}. Also for all $i, j \in\ \mathbb{N}$ we have $f(i, j) = f(i − 1, j − 1) + f(i, j − 1)$. Find $f(1009, 2019)$.


What I've tried:

I took two cases: $i>=j$ and $i<j$.

As $j$ is reduced by $1$ in both $f(i-1,j-1)$ and $f(i,j-1)$, if $j<=i$, then $j$ will reach $0$ first irrespective of $i$. So the value of $f(i,j)$ is $2^{j}$. Here's a branch diagram to illustrate what I meant I less than j

So $f(3,2)=2^2=4$

However I'm stuck at finding the pattern for the other case ($j>i$). Example for $f(i,j)$ where $i<j$:enter image description here

$f(2,3)=7$

I do recognize that I can stop evaluating once I reach a point where $i=j$ but I can't find at which places and how many times they reach that point. It would be highly helpful If you would help me find the pattern. Also, am I going in the right direction? Is there any other way to solve this problem(a formula or something)? Help would be highly appreciable!

VIVID
  • 11,604
basilisk
  • 626

3 Answers3

4

I programmed the sequence to see if there is any pattern. Below is the $13 \times 13$ matrix including enough initial values to notice the pattern to be proven by induction after all:

[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
[1, 2, 4, 7, 11, 16, 22, 29, 37, 46, 56, 67, 79]
[1, 2, 4, 8, 15, 26, 42, 64, 93, 130, 176, 232, 299]
[1, 2, 4, 8, 16, 31, 57, 99, 163, 256, 386, 562, 794]
[1, 2, 4, 8, 16, 32, 63, 120, 219, 382, 638, 1024, 1586]
[1, 2, 4, 8, 16, 32, 64, 127, 247, 466, 848, 1486, 2510]
[1, 2, 4, 8, 16, 32, 64, 128, 255, 502, 968, 1816, 3302]
[1, 2, 4, 8, 16, 32, 64, 128, 256, 511, 1013, 1981, 3797]
[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1023, 2036, 4017]
[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2047, 4083]
[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4095]
[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096]

So, the pattern I noticed is as follows: $$f(m,n) = \begin{cases} \displaystyle\sum\limits_{k=0}^{m} {n \choose k},\ \ m < n \\[1mm] 2^n, \qquad \ \ \ \ ~ m\ge n \end{cases}$$ Next, we should prove it by induction.


The case $m < n$ (which is more interesting since $1009 < 2019$):

$\square$ We have enough information for the base case (see the table above). Now assume that $$f(m-1,n-1) = \sum_{k=0}^{m-1}{n-1 \choose k} $$ and $$ f(m,n-1) = \sum_{k=0}^{m}{n-1 \choose k}$$ are true.

We should show that $f(m-1,n-1) + f(m,n-1) = f(m,n)$ is found by the same formula; that is, we are to prove $$\sum_{k=0}^{m-1}{n-1 \choose k} + \sum_{k=0}^{m}{n-1 \choose k} = \sum_{k=0}^{m} {n \choose k}$$

Indeed, $$ \begin{align} \sum_{k=0}^{m-1}{n-1 \choose k} + \sum_{k=0}^{m}{n-1 \choose k} &= \sum_{k=1}^{m}{n-1 \choose k-1} + {n-1\choose 0} + \sum_{k=1}^{m}{n-1 \choose k} \\[1mm] &= {n-1\choose 0} + \sum_{k=1}^{m}\left[{n-1 \choose k-1} +{n-1 \choose k}\right] \\[1mm] &\overset*= {n\choose 0} + \sum_{k=1}^{m}{n\choose k} \\[1mm] &= \sum_{k=0}^m {n\choose k} \end{align} $$ where (*) denotes the Pascal's formula. $\blacksquare$


The case $m \ge n$:

$\square$ The base case and the induction hypothesis are analogous and the induction step is trivially proven by noting that $$\underbrace{2^{n-1}}_{f(m-1,n-1)}+\underbrace{2^{n-1}}_{f(m,n-1)} = \underbrace{2^n}_{f(m,n)}. \ \ \blacksquare$$


Finally, we note that $$\boxed{f(1009, 2019) = \sum_{k=0}^{1009}{2019 \choose k}}$$

VIVID
  • 11,604
  • 1
  • One has $f(1,1)=f(0,0)+f(1,0)=2$ but $m=n=1$ in your sum formula gives $\sum_{k=0}^0 \binom{1}{k} = \binom{1}{0}=1$. This doesn't occur if the upper limit if $m$ rather than $m-1$, so you may wish to recheck this.
  • If you look along and below the diagonal, you seem to have powers of 2. In other words, $f(m,n)=2^m$ if $m\geq n$.
  • – Semiclassical Jan 06 '21 at 02:47
  • @Semiclassical 1) I seem to confuse the indexing. In my indexing $f(2,2) = f(1,1) + f(2,1) = 2$. 2) I thought that sum formula would deal with the powers of two as well. – VIVID Jan 06 '21 at 02:59
  • The problem states that $f(x,0)=f(0,x)=1$, so I think it's just an index shift by 1. As for the powers---yes, it'll include it, but it seems worth saying so explicitly. – Semiclassical Jan 06 '21 at 03:03
  • @Semiclassical Yes, I fixed the indexing. Now, I will try to do the induction step and include the powers of two as you suggest. Thank you. – VIVID Jan 06 '21 at 03:07
  • 2
    One interesting remark from WolframAlpha: For the case of $n=2m+1$, one has $f(m,2m+1)=\sum_{k=0}^m \binom{2m+1}{k}=4^m$ (source). This includes $f(1009,2019)$ as the $m=1009$ case. – Semiclassical Jan 06 '21 at 03:09
  • 2
    Upon reflection, this is simple: $$\sum_{k=0}^{m} \binom{2m+1}{k}=\sum_{k=m+1}^{2m+1} \binom{2m+1}{k}=\frac12 \sum_{k=0}^{2m+1}\binom{2m+1}{k}=2^{2m}.$$ – Semiclassical Jan 06 '21 at 03:18
  • @Semiclassical Yes, that is interesting! Thanks. – VIVID Jan 06 '21 at 03:34
  • 1
    @VIVID Do you mean$$\sum_{k=1}^{m}\left[{n-1 \choose k-1} +{n-1 \choose k}\right]$$ in the last but third line? Also thank you for your help! – basilisk Jan 06 '21 at 10:35
  • @basilisk Yes, that was a typo. Glad that it helps $\ddot\smile$ – VIVID Jan 06 '21 at 10:48