11 ms·
Fireflies
- johnfn 9y agoProbably one of my favorite things I've seen on HN in a long time. The perfect synthesis of tech explanations to biological phenomena. The way the entire page fits together to teach is just beautiful. Why it's sitting down on the second page with just a few upvotes is beyond me.
- DelaneyM 9y agoBeautiful, educational and clever. I love it. On the subject of fireflies and emergent patterns, RadioLab did a wonderful podcast on the subject as well a few years ago: http://www.radiolab.org/story/91500-emergence/ http://www.radiolab.org/story/91500-emergence/ This piece very much reminded me of that.
- mettamage 9y agoYay ncase did it again! Don't forget to (re)view his project on The Parable of the Polygons: https://news.ycombinator.com/item?id=8716538 https://news.ycombinator.com/item?id=8716538 Playable posts are amazing. Interactivity in texts is amazing. <3
- RKoutnik 9y agoIf you like interactive posts with lots of play, check out Bret Victor's work (if you haven't already). Good start here: http://worrydream.com/ClimateChange/ http://worrydream.com/ClimateChange/
- mettamage 9y agoFun fact which I heard on a conference about gaming: Vihart (who ncase collaborated with) worked together with Bret Victor. Disclaimer: not sure if memory serves me right though O:)
- henrik_w 9y agoWow, really great - thanks for the link!
- dyarosla 9y agoI think the example works more quickly than it should due to the line "if(ff.clock>1) ff.clock=1;" Every time the clock goes over 1, wouldn't you mod the clock value, not set it to 1 exactly?
- KeyboardFire 9y agoI think that's why it works -- if you change that = to a %=, the effect no longer happens. It does make (intuitive) sense, though, because the only time that makes a significant difference is when a lot of fireflies flash around one firefly simultaneously, in which case the firefly wouldn't decide to flash twice in a row but instead interpret it as a singular flash. And if a firefly sees another one flash when it's about to, it would naturally want to synchronize its flashing with the other.
- dyarosla 9y agoRight- but the explanation in the 'explorable' is that the effect happens due to the simple pattern of Step 1: When you see a nearby firefly flash, nudge your clock a little bit forward, Step 2: That's it. Problem is, the description of what's happening and what is actually happening doesn't match.
- tgb 9y agoAnother poster here showed their own, similar demo of this. There they had each firefly charging like a capacitor. Triggering the light causes the capacitor to deplete. This seems like the better analogy, but more people know what clocks are.
- nialo 9y agoIn addition to being a better analogy, I am told it is possible to replicate the effect with a physical capacitor and a gas-discharge lamp: https://news.ycombinator.com/item?id=4600996 https://news.ycombinator.com/item?id=4600996
- IanCal 9y ago
- janwillemb 9y agoWhat an extremely nice interactive read. Works good on mobile. And it applies the biological lesson to human life, which is a nice way to finish a sermon. Article. Well done.
- codedevgoo 9y agoYup ditto. A quick superb from me
- leovander 9y agoReminds me of the Fireflies[0] model included in NetLogo[1]. [0] https://ccl.northwestern.edu/netlogo/models/Fireflies https://ccl.northwestern.edu/netlogo/models/Fireflies [1] http://ccl.northwestern.edu/netlogo/index.shtml http://ccl.northwestern.edu/netlogo/index.shtml
- eridius 9y agoThis is neat. Did they ever figure out why Thailand fireflies do this, instead of just how?
- sliken 9y agoI suspect it helps avoid being eaten. Anything trying to eat them is presented with too many bright spots to track, then nothing to see.
- eridius 9y agoWouldn't that also be true of normal fireflies? It's pretty hard to track a single firefly if there's a bunch of them in the area.
- sliken 9y agoNot so much, there's no competition, so it's easier to track. I used to collect freflies in a jar as a kid. Seems like a similar idea to schools of fish, herds of antelope, etc. Stay together (even if defenseless) and predators have a hard time picking an individual to hunt.
- thecosas 9y agoAh, the paradox of choice (Firefly Edition).
- merraksh 9y agoReminded me of another phenomenon, the one occurring to metronomes on the same surface: https://www.youtube.com/watch?v=5v5eBf2KwF8 https://www.youtube.com/watch?v=5v5eBf2KwF8
- fogleman 9y agoI did the same thing a few years ago! My fireflies didn't move around though. https://www.michaelfogleman.com/static/fireflies/ https://www.michaelfogleman.com/static/fireflies/
- tnone 9y agoParable of the polygons is extremely questionable. For one, it attempts to have its cake while eating it too, by pretending it's an abstract demonstration about choices while explicitly calling out to hot topics in diversity, implying a clear causal link. For another, the model involves discrete agents on a discrete grid making decisions based on their immediate 8 square neighborhood, with no persistence or hysteresis, which does not at all match the real life domain it is attempting to model. If you changed the grid geometry, changed the action radius, or added a more complicated decision mechanism, it is likely to result in a completely different outcome. It is more like a cellular automaton than a sociological model, compounding design choices, not agent choices. It should probably be called Parable of the Quantization Error instead and held up as an example of an explorable explanation being misused for propaganda purposes, using its medium to present a false image of impartiality.
- j2kun 9y agoIf you're so passionate about it, you should go implement these changes to show how the model fails. I would read that, if it were done well. It's not obvious to me that simply changing the radius or grid geometry would have the effect you claim. Your objection is just that the model is too simple, but everyone knows linear regression predicts quite a lot, quadratic polynomials estimate physical motion very well, etc. On the other hand, I don't think the authors make the claims about faithfully and objectively measuring reality that you say they do. You're building up a straw man there.
- brenschluss 9y agoYes, absolutely. Also worthwhile to note that it's based on Thomas Schelling's model of segregation: http://nifty.stanford.edu/2014/mccown-schelling-model-segregation/ http://nifty.stanford.edu/2014/mccown-schelling-model-segreg...
- belorn 9y agoIts interesting to see how the simulations looks like they are modeling society, and reminds me strongly on how game of life tries to be a model of artificial life. however, if someone want it to mean more then they really need to test the model and get data on how well it can predict.
- SpicyPython 9y agoThis is nice, I really enjoy this
- drueter 9y agoApologies for what might be shameless self-promotion, but if you're interested in this idea, you might like my 2012 project , "The Kuramoto Model (1,000 Fireflies)." I built 1,000 microcontroller-based LED devices that synchronized with each other using radio communication, with a similar algorithm to what Nicky used. Link is here: http://davidrueter.com/projects/2012-the-kuramoto-model.html http://davidrueter.com/projects/2012-the-kuramoto-model.html
- Faaak 9y agoVery good result although the green mind in me screams a bit when thinking about all this waste.
- blacksmith_tb 9y agoHmm, my city gives away bike lights pretty frequently - they aren't as sophisticated (sadly) but it doesn't seem especially wasteful either way (at least I'd assume that a fair percentage of the riders using them would have bought some kind of light otherwise; and as long as they continue to work, I wouldn't expect them to end up in a landfill). The synchronization is especially fun.
- tptacek 9y agoThis is similar to a pretty famous result in networking and distributed systems about self-synchronization, which used to cause problems. http://ee.lbl.gov/papers/sync_94.pdf http://ee.lbl.gov/papers/sync_94.pdf
- demands 9y agoFascinating! I can see how synchronization across distributed systems would cause problems -- lots of requests against the same type of resource at the same time, for example, resulting in a thundering herd (https://en.wikipedia.org/wiki/Thundering_herd_problem https://en.wikipedia.org/wiki/Thundering_herd_problem) -- but also how it could be absolutely what you want (like if you want to synchronize clocks across systems, which I guess is exactly what's going on in the OP https://en.wikipedia.org/wiki/Clock_synchronization https://en.wikipedia.org/wiki/Clock_synchronization).
- jonathanpoulter 9y agoAfter the point when the whole swarm is synchronised there seems to be no further nudging, does this make sense? Am I missing something? Very interesting, just not sure I understand.
- KeyboardFire 9y agoIt's because of what dyarosla pointed out in their comment: https://news.ycombinator.com/item?id=14452832#14456254 https://news.ycombinator.com/item?id=14452832#14456254
- ozaark 9y ago> But whenever you shine, you inspire those close to you to shine too, a little bit sooner than they otherwise would have. And those close to you, in turn, inspire those close to them. This is adaptation to input disruption on a network of brain impulses. Fascinating that so much correlates with our own perception and technologies. Really great interactive post both informative and engaging.
- zachrose 9y agoIs there some inverse of the firefly's sync protocol that if they all followed would turn a synchronized swarm back into a chaotic one?
- panic 9y agoIn real fireflies, the individual clocks have slightly different frequencies. The inverse of the protocol is no protocol: stop syncing and let the blinks slowly fall back into chaos.
- m-j-fox 9y agoNature's PLL. https://en.m.wikipedia.org/wiki/Phase-locked_loop https://en.m.wikipedia.org/wiki/Phase-locked_loop
- JKCalhoun 9y agoMy only hang-up with the explanation/simulation is, why do the fireflies all have clocks that run at the same duration as one another? I understand advancing your clock to synchronize flashes, but doesn't this presuppose that the clocks run at the same speed? When I turned on "Show Clocks" in the simulation it indeed looked like the clocks ran at identical durations. Seems like this would be difficult in nature.
- bovik 9y agoI imagine if they started at wildly different speeds it would still converge but the convergence would take longer.
- golergka 9y agoThe article only talks about changing the phase on fixed amount, nothing about fixing the frequency.
- falsedan 9y agoThis is difficult to explain succinctly, but biochemical processes can set up periodic events with a fair amount of accuracy. For instance, your heart beats roughly once a second when in a resting state. Some of these processes use physical latency to time the events: if the fireflies were roughly of the same maturity, they would be of similar size and thus have clocks of similar duration.
- michaelmior 9y agoI did not realize you could scroll down on first viewing. If this weren't at 400+ upvotes when I saw it, I would have thought that was it.
- KennyCason 9y agoSame here. I'm glad I scrolled down and resized my screen. I didn't notice it my first viewing actually. I only noticed it when I called my wife down to check it out later.
- 19eightyfour 9y agoNature has the best algorithms, don't it folks? I have a question about a detail. The rule is: 1. When you see a nearby neighbour flash, nudge your own clock forward. 2. That's it. My question is -- when the fireflies are firing at the same time, they see each other flash, so they all nudge their clocks forward, correct? Assuming they don't nudge their clocks forward at the same amount, they would fall out of sync, correct? But they stay in sync, so they must nudge forward at the same amount...is this right? So my question is -- if everyone keeps nudging their clocks forward, why don't they keep speeding up? They do appear instead to continue flashing at the same steady rate. Does this mean that there ought to be another detail in the rule, such as, If you see a neighbour nearby flash, when you are not flashing, nudge your clock forward by a bit. ? Or is the perspective I just said missing something?
- msarchet 9y agoThey would all have to jump their clocks identically for that to work.
- JepZ 9y agoI think the rule is not very precise written down (e.g. I do not believe that a firefly nudges its clock multiple times within one cycle, just because it has multiple neighbors).
- metafunctor 9y agoIf nudging is done proportional to the intensity (or distance) of observed flashes, I'm pretty sure it will still work fine.
- tonmoy 9y agoNudge the clock "forward", not increase speed. So the overall frequency will be a little higher, but it won't keep on increasing
- JorgeGT 9y agoExactly. For anyone having trouble, just picture a pure sinusoidal signal, flash = sin(2π·freq·time + phase). Fireflies are changing their phase, not their frequency. Completely independent parameters.
- nether 9y agoOne of the things I miss from growing up in rural Virginia.
- cossatot 9y agoIf anyone is interested in this synchronization process or how it relates to synchronization in general, I highly recommend 'Sync' by Steven Strogatz. It's one of the best popular science/math books I've ever read, and Strogatz is a mathematician at the heart of the research, and a great writer as well, so you really get the story from someone who is a world expert, rather than an interested journalist.
- a_imho 9y agoot, the patreon link comes up with an empty white page and pukes all kinds of js errors to the console for me
- unlmtd 9y agoWho's more stupid: Those spending taxes, or those paying them?
- daleroberts 9y agoThis is fasinating topic, I recently tried to understand what happens to this type of model if you perturb it with heavy-tailed noise. http://www.sciencedirect.com/science/article/pii/S0378437116306768 http://www.sciencedirect.com/science/article/pii/S0378437116...
- duke360 9y agothis is pure genius! i love fireflies!
- omginternets 9y agoIncidentally, this is a very powerful model for neural synchrony as well.
- ge96 9y agoKind of curious how it works, when you inspect it, there's just a canvas, the fireflies don't seem to be individual, so no sense of "objects" or "individual entities" open source time to read but with regard to say if it was a real-time rendered animation, then calculating the point of origin and affecting the nearby fireflies... hmm the view clock part was particularly impressive though I could see it as a state thing, still so many of them on the same page, not crashing the browser or something interesting. Maybe I'm over thinking it. edit: I didn't look at the scripts though below the canvas.
- GrumpyNl 9y agoDoes the 137.5 degrees has something todo with this?
- rullelito 9y agoI wonder if you need the random scattering for this to work, or if it would still work if the fireflies formed a hollow circle.
- osense 9y agoIt would be even more impressive if the fireflies' internal clock was ticking at slightly different speeds. As it is now, once they're synchronized, turning the sync mechanism off has no effect and they stay synced forever.
- whalesalad 9y agoThe background noise is so soothing. http://ncase.me/fireflies/sounds/forest.mp3 http://ncase.me/fireflies/sounds/forest.mp3
- crusso 9y agoYeah, although my volume is down low and I opened the page in another tab while I was reading. By the time the sound permeated my consciousness, I thought that I had a hard drive going bad in my NAS next to my laptop.
- quadcore 9y agoWhy would a firefly that sync survive more than one which doesn't?
- kyberias 9y agoGood question. My initial guess: it is easier for predators to detect/catch fireflies that blink out of sync with the rest of the flock. If all blink in perfect synch, it's just a big flash of light to the predators.
- quadcore 9y agoOne guess is that it's easier to be part of a group that way, and then easier to reproduce.
- dharma1 9y agoVery cool. This was an interesting paper on synchrony in the brain, and how it's related to consciousness - https://www.nature.com/articles/ncomms10340 https://www.nature.com/articles/ncomms10340
- joelcollinsdc 9y agoThe view source of this is amazingly clean and refreshing to read. Great learning example, thanks!
- cwal37 9y agoNot on the coding side, but the inspiration. . . For those of us in the USA, there is a much more accessible version of synchronous fireflies at Great Smoky Mountains National Park in Tennessee. I lived there for a few years and went multiple times[1]. The dates get announced a month or so beforehand, and tickets are based on a lottery system since it only[2] occurs on one side of one river for less than a mile. You can technically also hike in if you're ok with 8 or so miles near sunset and then the same amount out in the pitch black. I believe that is frowned upon, but very few people do it that way (I was the only one the year I couldn't get tickets and decided to hike). [1] https://www.flickr.com/photos/23215983@N02/albums/72157645075559534 https://www.flickr.com/photos/23215983@N02/albums/7215764507... [2] Not exactly only, but certainly the most strongly.
- kris10BCaudle 9y agoSomething
- kris10BCaudle 9y agoSaying something. Please Help if available