Partitioning cartesian products of the form $[0,n]\times[0,m]$ ($n,m\in\mathbf{N}$) "diagonally"

70 Views Asked by At

Consider the cartesian product $[0,2]\times[0,3]$. The elements of this set are $$\begin{align*} & (0,0) & (1,0) & &(2,0) \\ & (0,1) & (1,1) && (2,1)\\ &(0,2) & (1,2) && (2,2)\\ &(0,3) & (1,3) && (2,3)\end{align*}$$ The following sets partition this cartesian product "diagonally": $$\{(0,0)\},\{(1,0),(0,1)\},\{(0,2),(1,1),(2,0)\},\{(0,3),(1,2),(2,1)\},\{(1,3),(2,2)\},\{(2,3)\}.$$ Is there a way to do this for arbitrary $n,m\geq 0$? I initially thought about the following way. For each $k\in[0,m+n]$, let $$J_k=\{(i,j)\ |\ 0\leq i\leq n\ \land\ 0\leq j\leq m\ \land\ i+j=k\}.$$ But these $J_k$'s contain more elements than I need. Any suggestions to amend this?

1

There are 1 best solutions below

2
On BEST ANSWER

I was checking your definition of the set $J_k$ for your example above and it turned out to work just fine.

Consider, for example, $k=2$. Then

$$J_2 = \{(i,j) \mid 0 \leq i \leq 2 \wedge 0 \leq j \leq 3 \wedge i + j = 2\}$$

So you want those ordered pairs in the rectangle $[0,2] \times [0,3]$ that are in the line $j = -i + 2$. And has you may see, solving that equation (knowing that $i, j \in \mathbb{N}$) you will get the exact solutions that you wrote in your question.

Now, in general, that is what you are doing in those sets

$$J_k = \{(i,j) \mid 0 \leq i \leq n \wedge 0 \leq j \leq m \wedge i + j = k \}$$

Here you are listing all the pairs that are in the rectangle $[0,n] \times [0,m]$ and in the line $i + j = k$.

Therefore, a collection of these sets $J_k$ will give you the partition of that rectangle “diagonally”.