33

What's the importance of multiplying an odd number by $3$ and adding $1$, instead of just adding $1$? After all, if you add $1$ to an odd number then it turns into an even number.

Here is a example comparing the coefficients $3$ and $1$ (any number could be used for this, but for simplicity I use $1$)

  • Using $3n+1$ for the number $27$, there are about $115$ steps.

  • Using $n+1$ for the number $27$, there are 7 steps.

I know that you could always replace $3$ by any variable you want, but why did Lothar Collatz make it specifically $3$? Was there some special reason (maybe his lucky number)? Or would using any other natural number cause instabilities (which I don't reckon)?

K DawG
  • 449
  • 4
  • 8
  • 6
    You may be interested to read about variants of this conjecture. Some work has been done on proving properties of similarly constructed recursive algorithms. Historically, 3 has been a popular choice, but it hasn't been the only one. – hasnohat Aug 18 '13 at 13:42
  • 8
    see my recent post and answer there on with all references: http://mathoverflow.net/questions/139073/beyond-collatz-a-5n1-conjecture – al-Hwarizmi Aug 18 '13 at 14:05
  • 6
    Also see this about $5n +1$ http://math.stackexchange.com/questions/14569/the-5n1-problem – Jeel Shah Aug 18 '13 at 14:14
  • And also about the 7n+-1 problem: https://arxiv.org/abs/1807.00908 – DaBler Aug 01 '19 at 14:26

5 Answers5

33

As explained in Isaac Solomon's answer just adding $1$ would make the problem simple. Multiplying by $2$ (or another even number) and adding $1$ would not work, so there one is at $3$.

One could ask the same question for $5$ instead of $3$, or there are other variants, but note the following:

If you assume a probabilistic model then in the multiplying by $3$ case you are in the following situation: in "half" the cases (even $n$) you divide by $2$, in "half" the cases (odd $n$) you take $3n+1$, but then you are guaranteed to divide by $2$ so effectively the situation is:

  • "half" the time multiply by $\frac{1}{2}$
  • "half" the time multiply by (roughly) $\frac{3}{2}$ (as the combination of $3n+1$ and the then forced $\frac{(3n+1)}{2}$).

The product of these two $\frac{1}{2}$ and $\frac{3}{2}$ is $\frac{3}{4}$ and this is less than 1, so in the long run you'd expect a decrease.

So the heuristic suggests a decrease in the long run. (This argument is rough but one could make it a bit more precise. However, I think to get a rough idea this might do.)

If you do the same with $5$ (or something still larger) instead of $3$, you'd have $ \frac{1}{2}$ and $\frac{5}{2}$ instead. So you'd get $\frac{5}{4}$ which is greater than $1$. So in the long run you'd expect an increase.

Indeed, one can also study this problem; so $5$ instead of $3$, but then the situation is different in that one will (it is believed) have some starting sequence that go to infinity and several small loops. So the question remains interesting, but it somehow changes as then one will have these values that escape to infinity.

More generally, there are numerous Collatz-like problems that are considered. But for some it can even be shown that they are formally undecidable.

Jeel Shah
  • 8,688
  • 18
  • 71
  • 117
quid
  • 40,844
  • 9
  • 59
  • 101
  • 1
    "So the heuristic suggests a decrease in the long run"... No, and this is what makes Collatz conjecture interesting: one is "at the edge". – Did Aug 18 '13 at 15:23
  • 7
    @Did what 'no'? you could say this heuristic is to rough to be relevant, which to some extent I acknowledge in the parenthesis, but why the heuristic I give should not support my claim is a bit unclear to me. – quid Aug 18 '13 at 15:41
  • 4
    Sorry for being too concise: yes this heuristics supports your claim but no, I am not sure this heuristics is relevant. The (different) heuristics I explain in my answer is that, between each `3x+1` step, the (rough, asymptotic, and assuming some equidistribution which is certainly slightly wrong but perhaps not too much...) effect of the `x/2` steps is to divide by exactly `3` in the mean. Note that numerical experiments seem to support the "null recurrent" behaviour this heuristics suggests, more than the "positive recurrent" one yours does. – Did Aug 18 '13 at 16:01
  • @Did thank you for the reply and the details. It is true my answer is quite rough, perhaps overly so. The reason why I find it tempting to state it like this is that it is simple and the parameter one considers in this way are 3/4 and 5/4 resp and one can say greater and smaller 1; and for example, in David Speyer's more sophisticated version where you just commented the same values appear, their logarithms actually, with argument negative and psoitive. So in some sense it feels alright. Though it might be too much of an oversimplification to phrase it the way I did. – quid Aug 18 '13 at 16:41
  • 1
    Thanks @quid, your explanation was simple but also nearly had the complexity of Isaac's and Did's – K DawG Aug 19 '13 at 10:06
  • Really heuristics seem to have little to do with the problem since we can have the function $f(x)=1$ if $x\equiv1(\mod 2)$ and $f(x)=x+2$ if $x\equiv0(\mod 2)$ which "on average" decreases by $\frac{x}{2}$ but half of all numbers diverge. Instinctively I think it's the "three implies chaos" rule combined with the fact that $1,4,2$ is the cycle of the $3x+1$ function that makes it special. – samerivertwice Apr 03 '18 at 19:33
  • @ProducerofBS there is an obvious "local" obstruction in your example. That's a pretty common phenomenon. As said there is nothing all that special about the problem. It's just the simplest case of a class of problems. – quid Apr 03 '18 at 21:15
  • The point is that one could just as well ask some other problems of the same form. In that sense there is nothing special about this particular problem. The class of problems is interesting though, of course, and in that sense also the particular instance is also interesting. That's a common phenonmenon. It's a famous problem if $n^2 + 1$ is prime infinitely often. One could just as well ask it for certain other polynomials of degree two (or also higher). Of course not for $n^2-1$ that's different, but I'd guess for $n^2 + 5$ it won't be all that much different. – quid Apr 04 '18 at 10:08
  • Sorry forgot the ping above @ProducerofBS – quid Apr 04 '18 at 10:09
  • @ProducerofBS maybe. But either way this is comment thread is not the place to discuss it. Good luck with your investigations. – quid Apr 04 '18 at 11:09
  • Sorry, back on the topic of your answer to the question, in particular your mention of a "local" obstruction piqued something. You probably have a better idea of what constitutes a "local" obstruction but the function $f(x)=(3x+1)\lvert3x+1\rvert_2$ is continuous in the 2-adic metric, throughout the positive odd integers (and in fact throughout $\Bbb{Z}_2^{\times}$ away from $-\frac{1}{3}$. So as well as "in the long-run expecting a decrease" we have this continuity which I have no doubt is important in the "everywhere going in the same direction" of the function. – samerivertwice Apr 05 '18 at 06:09
18

Here is a possible explanation: 3 is the unique factor which, presumably, allows the effects of the 3x+1 steps and the effects of the x/2 steps to compensate statistically. As such, Collatz algorithm is at the boundary of escaping to infinity and of hitting 1 after a (long) while. Hence the excitement and, perhaps, the difficulty...

To explain the heuristics, consider that each 3x+1 step produces an even integer and is followed by one or several x/2 steps. For each $k\geqslant1$, the proportion of even integers requiring $k$ of these x/2 steps is $1/2^k$ hence the global effect of these x/2 steps on an even integer chosen at random is to multiply it by a factor whose mean is $$ \frac12\cdot\frac12+\frac14\cdot\frac14+\cdots+\frac1{2^k}\cdot\frac1{2^k}+\cdots=\frac13. $$ This counterbalances exactly, asymptotically, the effect of the unique 3x+1 step before a new succession of x/2 steps occurs.

One should mention that to make this argument rigorous is a daunting task. For example, it is far from obvious that the integer produced by the 3x+1 step is uniformly distributed, asymptotically. Thus, the heuristics above is almost certainly false, and the challenge is to show that it is not false enough to invalidate the conjecture that, for every starting point, Collatz algorithm hits the cycle 1→2→4→1. Note finally that the analogy with some zero-drift random walk suggests that the hitting time of this cycle should be, finite yes, but typically large since null-recurrent random walks hit each given vertex after an almost surely finite, but not integrable, random time.

Did
  • 271,033
  • 27
  • 280
  • 538
  • 7
    Why do you take the arithmetic mean of multiplicative factors. I would think we would take the geometric mean: $$ m=\left(\frac12\right)^{1/2}\left(\frac12\right)^{2/2^2}\left(\frac12\right)^{3/2^3}\left(\frac12\right)^{4/2^4}\cdots $$ That is, $$ \begin{align} \log(m) &=\sum_{k=1}^\infty\frac{k}{2^k}\log(1/2)\\ &=\log(1/4) \end{align} $$ So, I would think that $m=\frac14$ instead of $\frac13$. – robjohn Aug 20 '13 at 13:24
  • 1
    Indeed, most heuristics I've seen for the Collatz problem suggest that the result should be slightly skewed towards the decrease; see for instance http://terrytao.wordpress.com/2011/08/25/the-collatz-conjecture-littlewood-offord-theory-and-powers-of-2-and-3/ . – Steven Stadnicki Aug 20 '13 at 20:32
  • @StevenStadnicki "Most heuristics" probably refers to the one explained by Tao in the post you refer to, which Isaac's and quid's posts reproduce faithfully. – Did Aug 20 '13 at 20:55
  • 1
    @Did Mea culpa; maybe I should have said that most articles I've seen on the problem choose to use that heuristic and it seems the one most supported by the modest amount of analytical machinery that's been applied to the problem. Do you have any particular reason to favor your own heuristic over that one? – Steven Stadnicki Aug 20 '13 at 20:58
  • @StevenStadnicki None. In fact I would love to see statistics on the time to reach `1` starting from each of the `n` first integers. If this time grows linearly (whatever that means), the usual heuristics is the good one. But if it grows much faster, this could indicate that the "null recurrent" interpretation has some merit. (Any reference with some "analytical machinery" included?) – Did Aug 20 '13 at 21:03
  • 1
    @Did it's been a long time, but http://www.ams.org/bookstore/pspdf/mbk-78-prev.pdf seems to have decent coverage, including at least some 'random' experimental examples that cleanly follow the 3/4 trajectory with the sort of localized variance one would expect. – Steven Stadnicki Aug 20 '13 at 21:13
  • @StevenStadnicki Thanks for the reference. – Did Aug 20 '13 at 21:14
16

If you use $n \to n+1$, this will always go to $1$. This is because, if you start with a number $n$, there are three possibilities as to what might happen in the next two turns. If $n$ is odd, then

$$ n \to \frac{n+1}{2}$$

If $n$ is even, you either have

$$ n \to \frac{n}{2} + 1$$

or

$$ n \to \frac{n}{4}$$

You can check for yourself that if $n>2$, this always shrinks the value of $n$. Over time, we must arrive at $1$.

Heuristically, the growing forces $+1$ and the shrinking forces $/ 2$ are not balanced. Addition by $1$ is not as powerful as division by $2$.

The important of choosing $n \to 3n + 1$ is that division by $2$ is balanced by multiplying by $3$ and adding $1$, since on occasion we divide by $2$ more than once in a row. See Did's answer below for an explanation of how the balancing occurs.

Elchanan Solomon
  • 27,884
  • 6
  • 55
  • 88
  • Sorry, I had not seen you edit before writing my answer, thus my answer is in part redundant with yours. – quid Aug 18 '13 at 14:15
  • 1
    The product 3/4=(3/2)(1/2) is not relevant, see my answer. – Did Aug 18 '13 at 15:25
  • Noted in my answer. – Elchanan Solomon Aug 18 '13 at 15:30
  • Ironically, I think the old version of this answer was better - the $3\times\frac14=\frac34$ heuristic is IMHO a better way of thinking about the problem than the $3\times\frac13$ 'balanced' version, and evidence seems to supportt that large Collatz iterates in general decrease along a log-linear curve directly corresponding to that factor. – Steven Stadnicki Aug 20 '13 at 22:15
4

Given a large set of numbers, half should have $\frac{3x+1}2$ applied and half $\frac x2$. Both $\frac{3x+1}2$ and $\frac x2$ are equally likely to produce even and odd numbers. So half the numbers produced by $\frac{3x+1}2$ should then have $\frac{3x+1}2$ applied again and half $\frac x2$; likewise, half the numbers produced by $\frac x2$ should then have $\frac{3x+1}2$ applied and half $\frac x2$. And so forth.

Consider the effect after $n$ iterations. $\frac1{2^n}\binom{n}{k}$ of the initial numbers will have $\frac{3x+1}2$ applied $n-k$ times and $\frac x2$ applied $k$ times. Thus, given an initial average value $m$, the expected ending value would be $$ \frac1{2^n}\sum_{k=0}^n\binom{n}{k}\left(\frac32\right)^{n-k}\left(\frac12\right)^km=m $$ Thus, the $\frac{3x+1}2$ and $\frac x2$ maps achieve a constancy in the expected value of their results.


Similarly, using the $\frac{x+1}2$ and $\frac x2$ maps, we would get an expected value of $$ \frac1{2^n}\sum_{k=0}^n\binom{n}{k}\left(\frac12\right)^{n-k}\left(\frac12\right)^km=\frac m{2^n} $$ This would give a precipitous decline in the expected value.

robjohn
  • 326,069
  • 34
  • 421
  • 800
  • "And so forth"... This does not seems obvious to me. – Did Aug 20 '13 at 20:56
  • 2
    @Did: $\frac{3x+1}2$ is bijective from $\mathbb{Z}_{2^n}^\text{odd}$ to $\mathbb{Z}_{2^{n-1}}$. $\frac x2$ is bijective from $\mathbb{Z}_{2^n}^\text{even}$ to $\mathbb{Z}_{2^{n-1}}$. Thus, $n$ iterations operating on $\mathbb{Z}_{2^n}$ will see each of the $2^n$ possible paths of $\frac{3x+1}2$ and $\frac x2$. – robjohn Aug 20 '13 at 23:58
  • Sure about the first bijection? – Did Aug 21 '13 at 05:48
  • @Did: $3x$ is bijective from $\mathbb{Z}_{2^n}^\text{odd}$ to $\mathbb{Z}_{2^n}^\text{odd}$, $x+1$ is bijective from $\mathbb{Z}_{2^n}^\text{odd}$ to $\mathbb{Z}_{2^n}^\text{even}$, and $\frac x2$ is bijective from $\mathbb{Z}_{2^n}^\text{even}$ to $\mathbb{Z}_{2^{n-1}}$. Composition gives that $\frac{3x+1}2$ is bijective from $\mathbb{Z}_{2^n}^\text{odd}$ to $\mathbb{Z}_{2^{n-1}}$. – robjohn Aug 21 '13 at 06:51
  • Aaaah... $\mathbb Z_{a}$ is $\mathbb Z/a\mathbb Z$ (I thought you were talking about $\mathbb Z\cap[-a,a]$...). Sorry for being dense about that point. Right, then indeed these mappings are bijections. :-) But why is this fact relevant? After all, we want to iterate $x\mapsto(3x+1)/2$ and $x\mapsto x/2$ on a large fixed subset of $\mathbb Z$, not on the shrinking sets the bijections from $\mathbb Z^{o/e}_a$ to $\mathbb Z_{a/2}$ seem to impose. – Did Aug 21 '13 at 07:02
  • @Did: I am simply looking at these modular mappings to see when a sequence is odd and $\frac{3x+1}2$ is applied, and when a sequence is even and $\frac x2$ is applied. This is to show that there is an even distribution of all $2^n$ possible combinations of $\frac{3x+1}2$ and $\frac x2$ after $n$ iterations. – robjohn Aug 21 '13 at 07:22
  • Let me rephrase to check if I got this correctly: assume that $X$ is uniformly distributed $\pmod{2^n}$ and let $N_k$ denote the number of times the $(3x+1)/2$ step is applied to $X$ during the $k$ first steps. Then, as long as $k\leqslant n$, $N_k$ is binomial $(k,\frac12)$. Is this correct? – Did Aug 21 '13 at 07:37
  • @Did: That's correct :-) I assume that binomial $(k,\frac12)$ means [binomially distributed](http://en.wikipedia.org/wiki/Binomial_distribution). – robjohn Aug 21 '13 at 07:48
  • Thanks. I might have been a bit slow on this one but the light finally came... (And I suppose a reason Collatz is a hard nut is that one would like to fix $n$ and to let $k$ go to infinity, in which case the heuristics breaks down.) – Did Aug 21 '13 at 07:56
0

This is not exactly an answer to your question. However, I just wanted to point this out because you ask about the importance of multiplying an odd number by 3 and adding 1, instead of just adding 1. It is little known fact that rather than defining the Collatz function as $$ T(n) = \begin{cases} (3n + 1)/2 &\quad \text{ if $n \equiv 1 \pmod{2}$,} \\ n/2 &\quad \text{ if $n \equiv 0 \pmod{2}$,} \end{cases} $$ and tracking the trajectory directly on $n$, one can track $n+1$ with $$ T(n) = \begin{cases} (n+1)/2 &\quad \text{ if $n \equiv 1 \pmod{2}$,} \\ 3n/2 &\quad \text{ if $n \equiv 0 \pmod{2}$.} \end{cases} $$ Thus the "multiplying by 3" just moved to the "even" number. This definition corresponds to the "shortcut" Collatz function. Without the "shortcut", another way of stating the same problem is $$ C(n) = \begin{cases} 3n - 1 &\quad \text{ if $n \equiv 0 \pmod{2}$,} \\ (n+1)/2 &\quad \text{ if $n \equiv 1 \pmod{2}$.} \end{cases} $$ You still track $n+1$ instead of $n$.

DaBler
  • 810
  • 1
  • 9
  • 27