News for hackers. Stuff that matters.
Re:Collatz's Ant by easwee on Monday December 23, 2024 @03:12AM (#42492739)
Lovely.
Re:Collatz's Ant by thomascountz on Monday December 23, 2024 @03:48AM (#42492897)
For those interested, see Daniel Shiffman's Nature of Code[1], a book in which you go from simple "ant" simulations to machine learning, neuroevolution, and NEAT.

[1]: natureofcode.com

Re:Collatz's Ant by cedws on Friday December 27, 2024 @04:35AM (#42520993)
Daniel Shiffman is brilliant. Haven’t watched The Coding Train for a while now but back in the days I really enjoyed his attitude. I think “creative coding” is the optimal path to get people into programming and he’s an excellent teacher of it.
Re:Collatz's Ant by keepamovin on Monday December 23, 2024 @04:58AM (#42493213)
This is so interesting: not just this visual rep but the conjecture generally, and the iteration's production of 'pseudorandom' patterns.

Hints at deep stuff between the two simplest prime divisors of integers: 2 and 3, you have this iterated function that branches based on divisibility by 2 and changes proportional to 3. The addition of plus one really throws a spanner in the works, ensuring it's no longer divisible by 3, but whether it's divisible by 2 or not after the addition seems almost 50-50.

So cool - one day we will unravel all these patterns, see the higher order of which these are simpler cases glimpsed partially and it will all make sense! :)

Re:Collatz's Ant by JadeNB on Monday December 23, 2024 @01:07PM (#42496317)
> Hints at deep stuff between the two simplest prime divisors of integers: 2 and 3, you have this iterated function that branches based on divisibility by 2 and changes proportional to 3. The addition of plus one really throws a spanner in the works, ensuring it's no longer divisible by 3, but whether it's divisible by 2 or not after the addition seems almost 50-50.

Are you sure you said what you mean? If `n` (is an integer that) is not divisible by 2, then `3n + 1` always is. Maybe you were thinking of the model that incorporates this by replacing the iteration formula for `n` odd with `(3n + 1)/2`?

Re:Collatz's Ant by keepamovin on Monday December 23, 2024 @11:54PM (#42499821)
Haha you are right! I might have been thinking of that, thanks for your charitable generous interpretation - or I might have been confused. I think I was just confused here, but good point.

I guess it's the n/2 one whose divisibility by 2 becomes uncertain. I think I looked at the formula and thought 3n+ 1 if 3n + 1 ~ 1 (mod 2), not 'if n ~ 1' haha that was funny! :)

Thanks again :)

edit: Also what a lovely way to correct someone -- 'said what you mean' -- I am gonna use that! :)

Re:Collatz's Ant by wcerfgba on Monday December 23, 2024 @07:27AM (#42493907)
I'd like to see this for smaller n, to see if there are motifs or patterns, which can be used to implement memoisation like Hashlife (https://en.m.wikipedia.org/wiki/Hashlife), or to reveal new formulas for exploring Collatz sequences with.
Re:Collatz's Ant by Fibra on Monday December 23, 2024 @07:34AM (#42493947)
Good idea. Although, from the little exploration I did with examples for small n, given the low stopping times, the behaviour was very boring. Nothing necessarily interesting. But then again, I didn't explore it exhaustively.
Re:Collatz's Ant by wcerfgba on Monday December 23, 2024 @07:48AM (#42494024)
Exactly, so I'm wondering if it's possible to detect those smaller patterns in the bigger ones?
Re:Collatz's Ant by Fibra on Monday December 23, 2024 @11:52AM (#42495753)
I'm not sure. I'll explore it a bit. Feel free to fork it and explore it yourself!
Re:Collatz's Ant by johngossman on Monday December 23, 2024 @04:33PM (#42497789)
Warning: huge amounts of compute time have been spent trying to find a counter example to this conjecture, which almost everyone believes is true. I kept my office warm this way one winter. It has been described as a way to turn pure Platonic mathematics into heat.

Always interesting to try to visualize something though.

Ps -- I implemented hashlife one time. Still amazed someone came up with that algorithm

Re:Collatz's Ant by JadeNB on Monday December 23, 2024 @01:09PM (#42496332)
> Good idea. Although, from the little exploration I did with examples for small n, given the low stopping times, the behaviour was very boring. Nothing necessarily interesting. But then again, I didn't explore it exhaustively.

Long and/or large excursions can happen even for small n! As mentioned at https://en.wikipedia.org/wiki/Collatz_conjecture#Empirical_d... , for example, 27 meanders for quite a while before reaching the inevitable cycle.

Re:Collatz's Ant by travisjungroth on Monday December 23, 2024 @09:37PM (#42499278)
Color or grayscale changes on a cell for repeat visits would be cool.