2
$\begingroup$

I have quite a tricky function that I'd like to better understand under which conditions it would converge to a fixed point. It can be best described as: repeatedly subtracting the lower of two numbers from the higher one, adding that amount to the lower number.

$$ f(a, b) = \begin{cases} 2a , & b-a & \text{if $ab$} \\ a , & b & \text{otherwise} \\ \end{cases} $$

Assume $a$ and $b$ are both positive.

So, as an example loop $f(5,7) \to f(10,2) \to f(8,4) \to f(4,8) \to \dots$ (never converges).

A convergent example: $f(1,7) \to f(2,6) \to f(4,4) \to f(4,4) \to \dots$ (converged).

Thus far, I have the following insights:

  1. if $a+b$ is odd, $f(a,b)$ never converges.
  2. The convergence of $f(a,b)$ is analogous to the convergence of $f(\frac{a}{gcd(a, b)},\frac{b}{gcd(a, b)})$.
  3. If $a=0$ or $b=0$ or $a=b$, then $f(a,b)$ is trivially converged.

What's the best way to approach something like this?

  • 0
    Note that if $a=0$ or $b=0$ and the other is positive, those points also converge rather easily.2017-01-24
  • 0
    Thanks! Quite right. I've added that, and clarified that the numbers are both positive.2017-01-24

1 Answers 1

3

For given $a,b$ let $m=a+b$. Then we can define $$g(a)=\begin{cases}2a&\text{if $2am$}\\a&\text{otherwise}\end{cases} $$ and observe that $f(a,m-a)=(g(a),m-g(a))$. But now it is clear that $g^{\circ n}(a)\equiv 2^n a\pmod m$ as long as we do not have convergence. And that we have convergence if and only if there exists $n$ such that $2^na\equiv 0\pmod m$. Thus the criterion is that the odd part of $a+b$ must be a divisor of $a$ (and $b$).

  • 0
    Fantastic! Very insightful. Intuitively I felt that $2^n a$ was important, but this makes it clear how. Once I wrap my head around that last sentence, I'll mark this as accepted. :-)2017-01-24
  • 0
    Okay, I get it. So, after repeatedly dividing $a+b$ by $2$... if that number divides both $a$ and $b$, then we are convergent. Amazing. Is it true that if it divides $a$, then it will always divide $b$ too? (Experimentally, this seems to be true.)2017-01-24
  • 1
    @Dave If $a+b=2^kd$ and $d\mid a$, say $a=qd$, then also $d\mid b=(2^k-q)d$.2017-01-24