Can a two-variable discrete linear combination be transformed into a one-variable discrete monotonic sequence?

89 Views Asked by At

Consider, for example, the discrete linear combination $$F(m,n) = Amn + Bm + Cn + D$$ where $A,B,C,D$ are non-zero positive integers and constants, and $m,n$ are non-negative integers and variables.

Can that be transformed in something like $G(i)$ where $G$ is the ordered sequence (strictly increasing monotonic function of $i$) of the numbers resulted from the different combinations of $m$ and $n$ evaluated on $F$?

Thanks.

2

There are 2 best solutions below

2
On

This answer was given before the OP question was updated

We can construct a transformation that maps each pair $(m,n)$ to a unique index $i$, thus creating a one-to-one mapping: $(m,n)\leftrightarrow i$. Let's assume for simplicity that $m,n,i$ are nonnegative.

Example solution: order the pairs $(m,n)$ from smaller to larger sum values $m+n$. For equal sum values, order from smaller to larger $m$. So the ordered sequence of pairs might look like this: $$ (0,0) \quad (0,1) \quad (1,0)\quad (0,2)\quad (1,1)\quad (2,0) \ldots $$ In this example, the value of $i$ can be computed from $m$ and $n$ as follows: $$ i={(m+n)(m+n+1)\over2}+m. $$ In the other direction, the values of $m$ and $n$ can be recovered from $i$ like this: $$ s=\left\lfloor{\sqrt{8i+1}-1\over2} \right\rfloor, \qquad m=i-{s(s+1)\over2}, \qquad n=s-m. $$ Moreover, for the particular case $$ A=0, \qquad B=C $$ the above solution gives a monotonic (sorted) $G(i)$ sequence, i.e. $G(i)\le G(j)$ if $i<j$.

However, in general it is impossible to satisfy the requirement that the values $G(i)$ must be monotonic (sorted). We prove this below.

Proof of impossibility of a monotonic $G(i)$ in the general case: Assume, on the contrary, that it is possible to make $G(i)$ a monotonic function for any choice of the coefficients $A, B, C, D$. Then consider $$ A = 0, \qquad B=-C. $$ For these coefficients, we will have $$ F(0,0) = D, \quad F(1,1) = D, \quad F(2,2) = D, \quad F(3,3) = D, \ldots $$ That is, for an infinite subset of pairs $(m,n)$, where $m=n$, we will have $F(m,n)=D$, so a monotonic non-decreasing $G(i)$ sequence will never get to any value larger than $D$ in such a situation. Thus $G(i)$ being monotonic and $G(i)$ taking all values of $F(m,n)$ are two contradictory requirements.

0
On

This answer is for the updated question (with positive $A, B, C, D$)

We can (in principle) construct a transformation that maps each pair $(m,n)$ to a unique index $i$, thus creating a one-to-one mapping: $$(m,n) \leftrightarrow i.$$ To do so, order the pairs $(m,n)$ from smaller to larger $F(m,n)$ values. For pairs with equal values of $F(m,n)$, order from smaller to larger $m$. Let $i$ be the ordinal number (index) of the pair $(m,n)$ in this ordered sequence of pairs. Let $G(i)=F(m,n)$, where $(m,n)$ is the pair with index $i$. Thus $G(i)$ is a monotonic function of $i$ by construction. The requirement for $G(i)$ to be a strictly increasing monotonic function is not realistic because, e.g. for $B=C$ we have $F(m,n)=F(n,m)$, that is, the same value of $F(m,n)$ will be encountered more than once.

This solution becomes possible for non-negative $A, B, C, D, m, n$, because each value $F(m,n)$ is taken only finitely often.

However, this solution might not be practical because, e.g. we do not (in general) have simple formulas for recovering $m$ and $n$ from a given $i$.

Without the monotonicity requirement, an alternative solution is to order the pairs $(m,n)$ from smaller to larger sum values $m+n$; for equal sums, order from smaller to larger $m$. Then simple formulas for the mapping $(m,n) \leftrightarrow i$ do exist.