last day (15 days later) » 

14:28
0
Q: Which pairs can go on infinitely?

4-4Given a pair of different integers $a$ and $b$ and operation: $$(a,b) \rightarrow \begin{cases} (a-b,2b), &\text{for}\; a>b \\ (2a,b-a), &\text{for}\; b>a \\ \text{stop}, &\text{for}\; a=b \end{cases}$$ After enough repetitions, some integers, like 7 and 9 become equal to each other, causing the ...

This looks like an interesting question. But you will get downvotes and likely have the question closed if you don't provide some background: where does the problem come from and what have you tried?
4-4
4-4
This problem is part of a programming exercise I received from my mentor. I'm having trouble coming up with anything sensible to try. So far I've been banging my head against the proverbial wall by looking at what the sums,differences and ratios look like in pairs which go on forever and those which don't. Obviously if the sum is odd, then it never stops, but otherwise I don't have anything solid.
I don't understand the rules. Even if $a>b$ that property won't be passed on. What happens when it stops? Do you switch $a,b$? Something else? Please edit for clarity and to show your efforts.
Welcome to Math.SE! ... Please include all context and clarifications in the body of the question itself. Comments are easily overlooked and may be hidden.
I note that neither of your examples satisfies $a>b$, though you state that as a requirement.
14:28
@lulu Looking at the examples, I think the intended rule is $(x,y)\mapsto(|x-y|, 2\min(x,y)).$
4-4
4-4
the a>b was not meant as a requirement. I meant to specify what the operation looks like for a>b. As I've now clarified in the post, the operation for b>a is mirrored. Sorry for the lack of clarity, I'm still trying to figure out ME.
@Karl Sure, maybe. But why guess? The OP needs to edit the post to include their efforts and they can edit for clarity at the same time.
It seems to me that both $(2,6)$ and $(1,21)$ both eventually cycle, just with different periods.
4-4
4-4
@GerryMyerson clerical error in the text, (7,9) doesn't cycle.
What about $(a,b)=(1,11)$? That reaches the fixed point $(4,8)$. That would count as "stopping", no? Or do you mean it must reach $(n,n)$?
$(7,9)$ reaches the fixed point $(16,0)$. Note that the thing has to cycle. $a+b$ can't increase so you must get to a repeating pattern.
4-4
4-4
14:28
@lulu stopping in the context of this exercise means a=b. (4,8) would still change 4,8 8,4 4,8 8,4...
@lulu 7,9 doesn't reach 16,0; 7,9 14,2 12,4 8,8
You might try graphing out all the pairs $(a,b)$ that terminate and conjecturing a set of conditions to characterize the set based on the image.
It might be clearer to write the rule something like this $$(a,b) \to \begin{cases} (a-b,2b), &\text{for}\; a>b \\ (2a,b-a), &\text{for}\; a<b \\ \text{stop}, &\text{for}\; a=b \end{cases}$$
4-4
4-4
@Blue Thanks so much, that is a lot clearer. I'll try to replicate it and put it in the original post.
I think at this point it's clear that you have no idea of what question you wnt to ask, 4-4. I suggest you go away for a couple of days, and come back when you can write something down that is clear, unambiguous, mathematically accurate, consistent with standard definitions, ....
@GerryMyerson It looks like a clear question to me (at least now): Doing this algorithm, for what pairs of numbers is there a point $a=b$ will happen after a finite number of iterations.
14:28
Just thinking out loud ... To be clever (albeit not particularly helpful), you could combine the first two cases as $$(a,b)\quad\to\quad(a,b)\;+\;\min(a,b)\;\left(\,\operatorname{sgn}(b-a)\,,\,\operatorname{sgn}(a-b)\,\right)$$ When $a=b$, the above yields a constant sequence, which you might consider as an alternative to "stopping". However, that condition is also met when $\min(a,b)=0$; this would have to occur at the first application of the transformation (since there's never a chance to create a $0$), so it's easy enough to describe (or dismiss) this as a "trivial" case.
Does this answer your question? Minimum of two sequences

last day (15 days later) »