AMAZING example of complex emergent behavior from a very simple rule

Поделиться
HTML-код
  • Опубликовано: 24 дек 2024

Комментарии • 1,3 тыс.

  • @LarchmontVillageOG
    @LarchmontVillageOG 4 года назад +9381

    Can we install this in cars so that at stop lights eventually every cars' blinkers will be flashing in unison?

    • @cros108
      @cros108 4 года назад +919

      god please

    • @treeoflibertydefense8612
      @treeoflibertydefense8612 4 года назад +601

      You’re thinking in the right direction. I’m sure this exact type of research is going to lead to all sorts of amazing tech like that!

    • @prestonduffield5393
      @prestonduffield5393 4 года назад +203

      That's actually an amazing idea

    • @omfgmouse
      @omfgmouse 4 года назад +720

      Turn signals are actually intended to all blink at different rates and _not_ be in sync because if they were in sync the sight could become mesmerising (and thus distracting).

    • @treeoflibertydefense8612
      @treeoflibertydefense8612 4 года назад +154

      I’m thinking more along the lines of keeping every car from hitting another car. Let’s say, if every car has one of these bad boys in every corner, they could maybe purposely repel vehicles away from other vehicles or use brakes/turning/acceleration to steer clear of accidents ETC. Computers think and operate on the millisecond level, and can react SO much quicker than humans. If cars could automatically detect and avoid accidents, working together as machines to keep us safe, that would be an awesome place for these to be.

  • @zbyszanna
    @zbyszanna 4 года назад +5655

    "I understand the code, I even wrote the code" - one does not necesarilly follow from the other :)

    • @alperbasar1639
      @alperbasar1639 4 года назад +666

      code doesn't work: "but why?"
      code works: "but WHY?"

    • @verifiedgentlemanbug
      @verifiedgentlemanbug 4 года назад +134

      @@alperbasar1639 sounds like engineer to me

    • @Karakta
      @Karakta 4 года назад +25

      Depends on your definition of "to write". If you define "to write" as "tracing letters together with a pen or with a keyboard", then yes the second proposition does not necesserallly follows from the first. But if you define "to write" as "come up with a text and inscribe it with a pen or a keyboard", then writing does presupose understanding.

    • @maxireigl1919
      @maxireigl1919 4 года назад +201

      ​@@Karakta Trust me, nearly every programmer can tell you a story of having written a programm that, by all accounts, should not have worked but still did so for reasons beyond their comprehension.

    • @Karakta
      @Karakta 4 года назад +10

      @@maxireigl1919 If I refer strictly to what you said, what is beyond their comprehension are the reasons why what they have written works, not what they have written itself.
      In fact, if they had not understood what they have written, then they would not be surprised as to why it works.

  • @HilmyA.S.
    @HilmyA.S. 4 года назад +614

    "i understand how it works, i even wrote the code to make it work, but when i turn it on and it works, i am still shocked and amazed"
    -Basically every programmer

    • @LightningShiva1
      @LightningShiva1 4 года назад +7

      Are you stupid? I make anything logical and nothing WORKS in the first place

    • @skyeshoe.223
      @skyeshoe.223 4 года назад +6

      I was the 256th like. :)

    • @JohnUnsub
      @JohnUnsub 2 года назад +3

      @@skyeshoe.223 I was 517th and I'm sad it wasn't 512th

    • @inyobill
      @inyobill 2 года назад +1

      ROFL, I resemble that remark. Particularly when working a particularly gnarly bit of logic, and you see it actually execute correctly the first time.

    • @inyobill
      @inyobill 2 года назад

      @@skyeshoe.223 I see what you did there. I just missed being #512, at 521. Sigh. After being retired for seven years, I can still look at an eight-digit hexadecimal number and see the bit pattern.

  • @seditt5146
    @seditt5146 4 года назад +3808

    That is how heart cells work. They will beat but become in unison when they are in contact

    • @alex.hleconte6007
      @alex.hleconte6007 4 года назад +145

      Thanks, big brain.

    • @曾程-r6h
      @曾程-r6h 4 года назад +441

      Also that is how the fireflies synchronize their lighting. Good example showing simple rules to build complexity within nature.

    • @johnjordan3552
      @johnjordan3552 4 года назад +42

      When they are in contact? Care to elaborate it, or could you just send some link to this phenomenon. I don't know what wording I should use to search for it on the internet

    • @hippocratesm.d.1543
      @hippocratesm.d.1543 4 года назад +25

      Syncetium

    • @hippocratesm.d.1543
      @hippocratesm.d.1543 4 года назад +26

      Not exactly, if they out of sync like these before they sync .. u got urself an arrhythmia!

  • @americannacho
    @americannacho 4 года назад +363

    Imagine finding all your homies and blinking together and then getting reset

  • @melvin3509
    @melvin3509 4 года назад +550

    They have the urge to blink... "GODDAMNIT LET ME BLINK ALREADY - AHHH that was great, OH PLS AGAAAIN"

    • @rewrose2838
      @rewrose2838 4 года назад +6

      I imagine it's more like trying to keep your eyes closed

    • @awertyuiop8711
      @awertyuiop8711 4 года назад +2

      Is that an SCP reference?

    • @barnabyjjones2348
      @barnabyjjones2348 4 года назад

      Awer Tyuiop “Clear” “Clear” *blinks*

    • @eadweard2214
      @eadweard2214 4 года назад +1

      What in the *[F U C K]* Is no one gonna talk about that obvious innuendo

    • @rewrose2838
      @rewrose2838 4 года назад +4

      @@eadweard2214 yeah let's talk about his obvious innuendo issues and make him feel more insecure. smh.

  • @dawidlaszuk
    @dawidlaszuk 4 года назад +64

    The synchronization is due to the Kuramoto coupling (a phase coupling in oscillators which you explained as the "urge"). The same phenomenon is behind fireflies flashing in sync or people applauding. I've spent a couple of years working on this and it's really great to see your enjoyment of discovering this by yourself :) Enjoy your experiments!
    en.wikipedia.org/wiki/Kuramoto_model

  • @thefacedlool2706
    @thefacedlool2706 4 года назад +1079

    "The Sky is falling!" - Chicken Little, from the movie Chicken Little. These things look like the panel that hit Chicken Little on the head.

    • @kanishkachakraborty
      @kanishkachakraborty 4 года назад +32

      You're right! Now just to coat it with an invisibility cloak.

    • @kanishkachakraborty
      @kanishkachakraborty 4 года назад +1

      @blindwillie99 yes

    • @ion7701
      @ion7701 4 года назад

      Woah! - Morcubine Porcupine

    • @bigjoshlevine
      @bigjoshlevine  4 года назад +44

      For those who didn't get the reference (like me!)...
      ruclips.net/video/PPuk2JQgMkU/видео.html

    • @helpsulaiman7144
      @helpsulaiman7144 4 года назад +2

      Interestingly I thought of that too

  • @MaximusLight
    @MaximusLight 4 года назад +958

    Edit: To be fair I think this is neat, I'm just making a nitpick.
    Further edit: Glad to see this generating so much discussion but keep it civil and remember there isn't one clear definition of complexity that's why it's a debate in the first place. :P
    Calling it complex emergent behavior doesn't seem right, the code used is literally designed to add a set value to each unit then reset to a ground state this behavior has no choice but to emerge based on that (it's designed by default to have emergent behavior but calling it complex is a stretch). It'd be a more fitting demonstration of complex emergent behavior if it was some random value that's added between 0-100% instead of just 10% then find consistent patterns emerge when they interact. (bit of a nit-pick I know)

    • @sevrothegoblin5212
      @sevrothegoblin5212 4 года назад +65

      Completely agree

    • @robertmines5577
      @robertmines5577 4 года назад +74

      This concept is called the Kuramoto Oscillator, and I think there is an exact solution for Gaussianly distributed periods of oscillation.

    • @deoxal7947
      @deoxal7947 4 года назад +84

      @@robertmines5577 I understand some of those words

    • @OrangeC7
      @OrangeC7 4 года назад +55

      @@deoxal7947 Honestly whenever that happens to me I think "I'm so proud of myself for understanding at least half of that sentence"

    • @dereknalley
      @dereknalley 4 года назад +54

      Agree. The original video is "Hey, I designed things to sync their cycles. Watch this AMAZING video!" and then, the cycles sync. How is this amazing?

  • @hybridswifty3873
    @hybridswifty3873 4 года назад +557

    Who else thought the tiles were going to attach together when they were separate?

  • @Kobe005
    @Kobe005 4 года назад +351

    "5 lines of code" = an entire page. Wish it was that way for essays.

    • @marcoguastella8929
      @marcoguastella8929 4 года назад +4

      it's a way of saying it's an easy code

    • @HelmuthGerka
      @HelmuthGerka 4 года назад +45

      Its literally 5 lines of code, you dont count descriptions.

    • @spacetechempire510
      @spacetechempire510 4 года назад +25

      5 lines of active code. The rest is descriptions and for the light color.

    • @nickmagrick7702
      @nickmagrick7702 4 года назад +4

      an essay is likely way easier to write than that one page of code.

    • @Shijaru64
      @Shijaru64 4 года назад +9

      @@nickmagrick7702 Debatable. That depends on what you're coding.

  • @micycle8778
    @micycle8778 4 года назад +18

    When you write code for the first time and it doesn't break, everyone is shocked and amazed.

    • @Volvary
      @Volvary 4 года назад +1

      I've always heard that called a Programming Headshot.

  • @LesDempseySoloLesta
    @LesDempseySoloLesta 4 года назад +39

    This reminds me of a documentary I saw on fetal development. It showed how a few pulsating cells would connect together and their pulses would sync. Those cells would be the basis of the heart.
    Excellent work.

  • @Karpe_Deem
    @Karpe_Deem 4 года назад +12

    2:17 the cry of satisfaction of every engineer, programmer, nerds, tinkerers ETC when their shit works flawlessly 😂😂

  • @erwinmulder1338
    @erwinmulder1338 4 года назад +195

    The algorithm is simple: each node runs circles, if it sees it's neighbor go trough start/finish, you jump forward 10% .. so in at most 10 cycles, you have caught up with your neighbor.

    • @sagemeline
      @sagemeline 4 года назад +36

      Agreed. I don't understand why the video is titled "complex emergent behavior" when it does exactly what it was intended to do and nothing more. It isn't even surprising behavior.

    • @igorz3551
      @igorz3551 4 года назад +6

      I wish i was this genius. Some day

    • @rykehuss3435
      @rykehuss3435 4 года назад +11

      Based on the title I thought it had somethhing to do with Conway's Game of Life or something related

    • @Kioselis
      @Kioselis 4 года назад

      @@rykehuss3435 Exactly my initial thoughts.

    • @macicoinc9363
      @macicoinc9363 4 года назад

      what if there are two neighbors with very different cycles?

  • @ngstop2603
    @ngstop2603 4 года назад +44

    imagine using this to sync sound, like they blink and emit a loud sound so eventually they will sync the sound to be super loud

    • @SoupSackHandle
      @SoupSackHandle 4 года назад +3

      And it would be like War of the Worlds

    • @blank3211
      @blank3211 4 года назад +3

      This is a must to do

    • @revenevan11
      @revenevan11 4 года назад

      @@saillively synesthesia?

  • @zencow
    @zencow 4 года назад +5

    More than a decade ago, I wanted to use this concept for syncing microcontroller oscillators to generate properly timed polyphonic music among multiple little monophonic nodes (kind of like doing polyphonic midi music with each voice given to an independent device). I never did do it, but I might still tinker with it someday. Thanks for the reminder! :)

  • @revimfadli4666
    @revimfadli4666 Год назад +1

    I just realized you used move38, the modular electronic boardgame platform

  • @nukecorruption
    @nukecorruption 4 года назад +102

    would be interesting to see them move towards the direction where there are most blinks or something

  • @udayanbanerjee5271
    @udayanbanerjee5271 4 года назад +1

    It is a well known synchronisation phenomenon that happens with coupled metronomes. Here the coupling between the modules is wireless with the condition that you mentioned.

  • @Alexagrigorieff
    @Alexagrigorieff 4 года назад +749

    So they synced their periods, too

    • @theavo
      @theavo 4 года назад +10

      I see what you did there 😁

    • @WilliamBarksdale
      @WilliamBarksdale 4 года назад +32

      the urge to bleed increases when they see another one bleed.

    • @ikagura
      @ikagura 4 года назад +2

      Wait, what does it have to do with menstrual cycle?

    • @shayanmoosavi9139
      @shayanmoosavi9139 4 года назад +16

      @@ikagura period simply means a time interval. The menstrual cycle is also a time interval of 28 days (in average), hence a period :)

    • @theavo
      @theavo 4 года назад +8

      @@ikagura Well, the blinking things in the video synchronized their periods of blinking just like en.wikipedia.org/wiki/Menstrual_synchrony :^)

  • @player6769
    @player6769 4 года назад +1

    Dude I heard about this paper on Sean Carroll's podcast and instantly recognized the concept, such a cool implementation!

  • @johnnoahdeandres9458
    @johnnoahdeandres9458 4 года назад +62

    I have no idea how I ended here from a video about cats.

    • @KarstenJohansson
      @KarstenJohansson 4 года назад +1

      Build a set of these and trigger them in front of your cat. Obviously video the results. WIN!

    • @tompeck5495
      @tompeck5495 4 года назад

      That's the youtube experience for ya!

  • @robogemp7075
    @robogemp7075 4 года назад +7

    The fact that you managed to create them with such short code is awesome man. You’re a genius

    • @inyobill
      @inyobill 2 года назад +1

      I could have coded that in 329 lines (seat-of-the-pants guestimate), no sweat. But I'm an old-school bit-pusher. There would be not one extra unneeded clock cycle, though.

  • @unintentionallydramatic
    @unintentionallydramatic 4 года назад +9

    The algorithm smiles on you, sir.
    You just got a new sub.

  • @Omgtired
    @Omgtired 4 года назад

    I like how you simply yet very accurately discribed the algorithm

  • @nipunagunarathne4882
    @nipunagunarathne4882 4 года назад +36

    2020: robots get the yawn reflex

  • @p0t4t0nastick
    @p0t4t0nastick Год назад +1

    This is very well covered in the book SYNC by the mathematician Steven Strogatz who studied that kind of stuff. Btw great science communicator overall and host of the podcast The Joy of Y.

  • @ApresSavant
    @ApresSavant 4 года назад +4

    It is completely understandable that these converge within 10 cycles with 10% boost each time they see a peer flash. In the case of two units, they will each boost the other alternately by 10% each flash, and quickly close the gap to harmonized flashing. Starting out completely out of phase, 10 x 10% is 100% synchronized. Adding in a third, common to the two, one will sync and the other will catch up for the same reason, because each will boost twice in it's own cycle. If you changed to boost by 20% they would sync within 5 cycles, and if you changed to a 5% boost, they would sync within 20 cycles.

  • @surrealdynamics4077
    @surrealdynamics4077 4 года назад

    That's beautiful, man. Electronics and programming are awesome

  • @doncorleon9
    @doncorleon9 4 года назад +8

    'Surround yourself with people you would like to emulate', in code.

    • @AristonSparta
      @AristonSparta 4 года назад

      doncorleon9 what happens if you put face masks on them and plexiglass in between them?

  • @Mookle123
    @Mookle123 4 года назад

    What a good example of emergent behavior! I love it. It makes you think what rules are in our own minds that cause emergent behaviors...

  • @CTSSTC
    @CTSSTC 4 года назад +62

    So for people who want to understand why they sync this may help:
    The code says: start counting from 0, every cycle add 1 to the counter, if the counter becomes 1000 (or more), then flash and start counting from 0 again.
    The other part says: if you see a neighbor nearby light up, increment the counter by 1/10th of its current value; this happens for each neighbor before starting a new cycle.
    So a few things to note here:
    1. at the start of the cycle, each cycle only adds 1 to the power by itself
    2. next if the power reaches 1000 or more it resets to 0
    3. the last check to see if there are any nearby neighbors is the most important part
    - Least power scenario: if it just reached 1000 the power is now 0, seeing any amount of neighbors doesn't do anything because a 1/10th of 0 is still 0
    - Most power scenario: the power just got to 999, there are 6 neighbors so it will end up at nearly 1600 power when it goes to add 1 and check if it's over 1000 on the next cycle
    - Exact power scenario with 6 neighbors: It can hit 1000 if it is currently at 625 and has 6 neighbors. Or: cycle + count of neighbors * (1/10 * cycle) = 1000. Solve for the cycle for the given amount of neighbors.
    - In any scenario, this has a substantial weight compared to the 1 power it obtains at the beginning.
    There are a couple important questions to wonder too:
    - How quick/often are the cycles?
    - Does a node always see its neighbor when nearby for every cycle? Is it only when lit up; how much lit up?
    I believe that once within range it always sees that neighbor and every cycle then increases at an exponential rate. It can go over 1000 when checking its neighbors but then will be reset to 0 on the next cycle. There must be a mathematical equation to prove out that taking 1/10 of the current power (if it's near another) will eventually sync them. One will be going faster, it will flash and reset to 0 now while the other increases faster, until eventually they flash at the same time and now have the same cycle parameters as one another.
    Someone mentioned a PLL
    zipcpu.com/dsp/2017/12/14/logic-pll.html

    • @saimnaeem9
      @saimnaeem9 4 года назад +2

      Thanks for the explanation!

  • @mkliu1882
    @mkliu1882 4 года назад

    Synchronization due to nonlinear interaction is a ubiquitous physical phenomenon. Very interesting demonstration

  • @belshir
    @belshir 4 года назад +85

    me: chillin youtube: wanna see some tiles blink?!?!?!

    • @archivushka
      @archivushka 4 года назад +2

      Everybody gangsta till tiles start synching

  • @amoghskulkarni
    @amoghskulkarni 4 года назад +1

    This is also how some species of fireflies blink synchronously! It's kinda magical to watch 1000s of them blinking almost together. Do visit Smokey mountains (those who live in the US) during summer when to watch them. :)

  • @Amonimus
    @Amonimus 4 года назад +140

    I mean, if A blinks before B, B will decrease the offset between the two, sounds pretty obvious to me.

    • @wontbebothered
      @wontbebothered 4 года назад +13

      easy there big brain

    • @wontbebothered
      @wontbebothered 4 года назад +9

      @Wulcrit i was being sarcastic 🤦‍♂️

    • @wontbebothered
      @wontbebothered 4 года назад +3

      @Wulcrit k buddy

    • @TheVergile
      @TheVergile 4 года назад +6

      @Wulcrit is he correct though? what he says may be true for any two given tiles. but given n tiles in a random arrangement can you still say this is true? how is it only one pulse gets adapted? Couldnt there be two or three independent groups that are unable to synch bc the members of each group keep each other in their own beat?
      what about signal delay between the tiles? does it matter? will a chain of any length be able to synch? what about a ring? which of the pulses will be chosen as a common pulse?
      i wouldnt say he is correct. he has stated the principle of interaction between two tiles. sure. but the emergent behaviour of larger groups of tiles could be counter-intuitive or even chaotic

    • @dannygjk
      @dannygjk 4 года назад

      You missed the point. He didn't explicitly program the tiles to synchronize.

  • @maindepth8830
    @maindepth8830 2 года назад

    Thank you foe putting the paper in the description

  • @jerbear97
    @jerbear97 4 года назад +23

    _it's just one line here_
    _actually a call to an entire ML library_

    • @wilsonli220
      @wilsonli220 4 года назад

      loss.backward() XD

    • @alexsiryj
      @alexsiryj 4 года назад

      The url looks like it was commented out if that's what you were referring to.

    • @wilsonli220
      @wilsonli220 4 года назад

      @@alexsiryj Nah, it's a common line of code in pytorch (a python ML toolkit ) that is used to start a very complicated calculation.

  • @aneffortlesssmile
    @aneffortlesssmile 4 года назад

    I'm really not tech savvy at all, but things like this truly fascinate me. This was beautiful.

  • @jerzydziaa1819
    @jerzydziaa1819 6 лет назад +41

    reminds me of John Conway's "game of life" where state of one cell is determined by the state of it's neighbors. there is something beautiful in emergent complexity :)

    • @TheRainHarvester
      @TheRainHarvester 5 лет назад +2

      Jerzy, EXACTLY! GOL is a simple rule but causes amazing outcomes! You might really like some emergent behaviour videos I've been making, "heartbeats & blood flow".
      Come on over sometime and see what I'm working on.

    • @rizkiaprita
      @rizkiaprita 4 года назад

      are you talking bout corona mate?

    • @jonathanhead302
      @jonathanhead302 4 года назад

      Rizki Aprita No lol. Look up Conways Game of Life.

  • @gavincurtis
    @gavincurtis 4 года назад

    Really neat. Reminds me of the metronomes on a wobbly table experiment where they all become perfectly in time.

  • @yan4275
    @yan4275 4 года назад +172

    This arguably isn't emergent, and certainly isn't complex emergence

    • @Gueppelol
      @Gueppelol 4 года назад +20

      Yeah it's more like multiple pendulums which sync after a while

    • @nickmagrick7702
      @nickmagrick7702 4 года назад +10

      its a behavior that emerges from a simple set of rules that don't specifically tell it to do that. So its the definition of emergent. Just like how a school of silverfish swims causing an emergent behavior the fish arn't aware of that trick predictors with their dazzling lights and swift movements.

    • @nickmagrick7702
      @nickmagrick7702 4 года назад +4

      @@Gueppelol thats also emergent behavior.

    • @dannygjk
      @dannygjk 4 года назад +2

      It is emergent.

    • @DianaProudmoore
      @DianaProudmoore 4 года назад

      Me, a degenerate: Ah yes, that cursed code~

  • @goora1866
    @goora1866 4 года назад

    This man is on the brink of a revolution

  • @SamOliver4
    @SamOliver4 4 года назад +35

    This interests me on a mathematical level. I wonder if it can be proven mathematically that the system converges to synchronization. Perhaps it can be modeled by a Markov process?

    • @basisTermium
      @basisTermium 4 года назад +6

      as seen it was increased by 10 percent of its urge so the system is stable and convergence

    • @discomfort5760
      @discomfort5760 4 года назад +6

      You know the inherent rate which is constant, which makes everything else linear and lastly convergent because the change is constant.

    • @volpo5046
      @volpo5046 4 года назад +6

      If you want a paper this will probably do your fancy, www.clear.rice.edu/comp551/papers/MirolloStrogatz-TemporalSynchronization-SIAM1990.pdf

    • @robertmines5577
      @robertmines5577 4 года назад +3

      Yeah, there is a model for this called the Kuramoto Oscillator, and it's pretty much the paradigmatic model for all synchronization phenomena. It's been studied in terms of ODEs, PDEs, and SDEs (diff eqs with Gaussian noise) for all different kinds of initial conditions including some with parameter variation.

    • @BWV478
      @BWV478 4 года назад +1

      You don't seem to have much mathematical knowledge to write somethine like that.

  • @jamesrobsonza7752
    @jamesrobsonza7752 4 года назад

    This is how pacemaker cells work.
    Individually they randomly pulse, but in groups they communicate via simple chemical signals and eventually pulse together in rhythm, creating a heartbeat.

  • @zdhome5727
    @zdhome5727 4 года назад +17

    Am i missing something? What is special about this?
    If one panel blinking encourages another to blink, eventually they will blink together. Seems obvious to me.

    • @leogazebo5290
      @leogazebo5290 4 года назад +2

      Basically he recreated the heart cell.

    • @dannygjk
      @dannygjk 4 года назад

      He didn't code them to sync that's what's special about it.

  • @yuinurahilyon5711
    @yuinurahilyon5711 4 года назад

    What an interesting experiment you are showing.

  • @jskratnyarlathotep8411
    @jskratnyarlathotep8411 4 года назад +30

    you're almost leaving every other line empty

    • @bigjoshlevine
      @bigjoshlevine  4 года назад +26

      Code should be clear and easy to read - spaces are free! :)

    • @jskratnyarlathotep8411
      @jskratnyarlathotep8411 4 года назад +10

      @@bigjoshlevine idk, personally for me the smaller the code, the less movements is required to see more of it - the easier it could be read. Personally i prefer to write a comment in case i feel strong urge to make an empty line anywhere but between the functions) comment at least tells why those are separate blocks of code

    • @LeMustache
      @LeMustache 4 года назад +5

      @@bigjoshlevine It isn't clean at all when you do that. It's barely better than no newlines at all.

    • @userPrehistoricman
      @userPrehistoricman 4 года назад +10

      But then you're missing the purpose of empty lines: to group things. Without grouping things together, there is no spacing things out. No empty lines is as spaced out as all empty lines.

    • @exelexor
      @exelexor 4 года назад +5

      empty lines are to increase readability. the man finds it easier to read his code with every other line empty, what's wrong with that?

  • @ThePikmania
    @ThePikmania 4 года назад +2

    I didn´t realize I had post-rock playing in the background. It made everything more dramatic, like this was going to be the beginning of the end for civilization

  • @erevlibe6688
    @erevlibe6688 4 года назад +5

    For a few seconds I thought this would be an allusion to Stephen Wolfram

  • @StanleySeow
    @StanleySeow 4 года назад

    This is awesome!!!! I also plan to do a hexagon PCB LED project... and randomly found your video .....

  • @johnsmith-be4jr
    @johnsmith-be4jr 4 года назад +48

    From the rules he wrote them , isn't it inevitable they synch??
    I know nothing about coding, only wondering.

    • @PostScarcitytCat
      @PostScarcitytCat 4 года назад +16

      Yes

    • @tahunuva4254
      @tahunuva4254 4 года назад +25

      Alternative title: man amazed by basic maths.
      Cool devices tho

    • @sangramjitchakraborty7845
      @sangramjitchakraborty7845 4 года назад +12

      @@tahunuva4254 not amazed by the math itself per se. Amazed by the fact that such simple math describes such amazing phenomena.

    • @sangramjitchakraborty7845
      @sangramjitchakraborty7845 4 года назад

      @/X/EN It's just elegant that such simple mathematics is powerful enough to describe this complex phenomenon. It's doesn't really jump out at first glance that this is what will happen, now does it?

    • @BotPiotr
      @BotPiotr 4 года назад

      @/X/EN it's simple and efficient, therefore, elegant. Is that weird to be amazed ?

  • @Brillemeister
    @Brillemeister 4 года назад

    Sometimes less is more, or at least enough. Thanks for sharing. God bless

  • @garysimpson7326
    @garysimpson7326 4 года назад +52

    ?? Seems predictable to me. It might be emergent but there is no mystery to it.

    • @GoldSrc_
      @GoldSrc_ 4 года назад +7

      Just like life, with a few simple laws, complex patterns will eventually emerge out of seemingly randomness and chaos.

    • @nickmagrick7702
      @nickmagrick7702 4 года назад +3

      except when you consider this same principle applies to large systems and even animal behavior.

  • @daskaninchen1670
    @daskaninchen1670 4 года назад

    RUclipss algorithm seems to be fixed. It's recommending me some good stuff

  • @sorrefly
    @sorrefly 4 года назад +12

    “5 lines of code”
    5 methods call 5000 lines each

  • @neromastic4512
    @neromastic4512 4 года назад +1

    Very Fascinating
    I love it.

  • @WilliamBarksdale
    @WilliamBarksdale 4 года назад +7

    what would happen if you introduced latency between "seeing" the other ones blink?

    • @dancoulson6579
      @dancoulson6579 4 года назад

      Given enough tiles, there'd be a kind of mexican wave effect.

    • @WilliamBarksdale
      @WilliamBarksdale 4 года назад

      @@dancoulson6579 I'm wondering if this idea would work generally for synchronizing clocks with arbitrary connection latency, probably the system would fine some non-synched equilibrium?

    • @canned_heat1444
      @canned_heat1444 4 года назад

      @@WilliamBarksdale Thats interesting. I wonder if they would phase in and out given the delay. By what ive been thinking they reach the same frequency when each one receives a signal at the same time. I would propose that if one had latency and the other hadn't they would indeed phase in and out. However if both did(or in this case all five of them did) I would propose they would reach and maintain the same frequency. Not sure...

    • @nickmagrick7702
      @nickmagrick7702 4 года назад

      theyd likely all still sync up unless they have different time periods of latency. If they are separate by the same amount then it should still sync id expect.
      Would be nice if he linked the code so ppl can try it.

  • @ultimateprakhar
    @ultimateprakhar 4 года назад

    Such an awesome display of coding and technology. It is surreal.

  • @Kaizzer
    @Kaizzer 4 года назад +6

    Well, the rule you implemented is just like a PLL!

    • @typedef_
      @typedef_ 4 года назад +2

      It is. It would be interesting to increase the blink frequency and see at what point this becomes unstable.

  • @noaheadie
    @noaheadie 4 года назад

    Humanity can learn a lot from these about unity and compassion.

    • @ThePC007
      @ThePC007 4 года назад

      More about mathematics, or perhaps even computer science to some degree (I guess?). But this has nothing to do with compassion, lol.

    • @noaheadie
      @noaheadie 4 года назад

      @@ThePC007 I was in a bad emotional space last night. Seeing these guys be able to perfectly understand and sync-up with one-another made me feel better about things. These lil guys have a perfect sense of interpersonal unity - it's literally all they know.

  • @paulsmithkc
    @paulsmithkc 7 лет назад +10

    So if you increase the urge to power/3, do they sync in 3 blinks?

    • @haph2087
      @haph2087 5 лет назад +4

      Presumably.
      You could just say that when you see your neighbor blink, immediately blink.

    • @KarstenJohansson
      @KarstenJohansson 4 года назад +3

      Exactly. At the end of the 80's, I used to build light chasers for rock concerts. The drum acted as the trigger. If we modified the input to be a light sensor instead of a microphone, the exact same thing would happen. This model needs more complexity before it even approaches alife's emergent behaviour. For now, it is merely doing exactly what you'd expect it to do by reading the code - see a light, eventually reach 100% (in 10% increments) trigger rate. The way we built the light chasers purposely *avoided* this by simply randomizing the sensitivity instead of boosting each channel identically - otherwise it'd be quite a boring light show.

  • @d1d1ka29
    @d1d1ka29 4 года назад

    From networks to game theory to collective behavior, to all of it, the universe somehow wants order, maybe even entropy is a complex emergent system too.

  • @justjamesAMX
    @justjamesAMX 4 года назад +3

    My man is gonna accidentally make the first sentient AI

  • @widdrshinswonders
    @widdrshinswonders 4 года назад

    I needed this today. Thank you.

  • @rhidlor8577
    @rhidlor8577 4 года назад +23

    Their behavior isn't surprising, "AMAZING" or "complex" at all, I cant tell if the title is clickbait or I'm missing something.

    • @ilayws4448
      @ilayws4448 4 года назад +9

      Yeah, he's pretty much just telling them "If a neighbour blinks, speed up your current cycle to blink sooner" why is he surprised

    • @necromaster998
      @necromaster998 4 года назад +2

      I agree, I'm not really sure I'd call this behavior "complex"

    • @OMGclueless
      @OMGclueless 4 года назад +4

      ​@@ilayws4448 The cool thing is that there are lots of simple rules that *wouldn't* work. For example, "Blink when your neighbor blinks" would just descend into chaos as they all blink over and over rapidly. "Blink 10% sooner" wouldn't work -- you would see your neighbor blink so you'd speed up by 10% but then they'd see you blink so they'd speed up by 10% and you'd both just end up blinking 10% faster but still out of sync. "Increase your urge to blink by 10%" does work though and that's cool. It's a simple and symmetric law that causes asymmetric behavior: if you're behind your neighbors you speed up and if you're ahead you slow down despite both you and your neighbors running the same simple code.

    • @rhidlor8577
      @rhidlor8577 4 года назад

      @@OMGclueless I agree with you completely; I personally find the rule quite interesting, especially considering it seemed to be inspired by fireflies, but I still think the adjectives used in the video title are misleading.

    • @necromaster998
      @necromaster998 4 года назад

      @@OMGclueless thanks for the great explanation, it seems there's definitely more here than I'd first thought

  • @walterdvries
    @walterdvries 4 года назад

    Pretty straight forward
    Any random value bigger than 0 will go to 1 if multiplied by 1.1^10 so it is pretty obvious they will quickly sync.

  • @DJ_Force
    @DJ_Force 4 года назад +24

    So, basically a tile will want to blink when it's neighbor blinks? Seems logical that they would all start blinking together.

    • @Volvary
      @Volvary 4 года назад +3

      I think the more "surprising" part is that it will not only blink together but actually synchronize. (As in, it's not a cascading effect but rather a blink in near unison.)

    • @dannygjk
      @dannygjk 4 года назад

      @@Volvary yep

    • @dannygjk
      @dannygjk 4 года назад +1

      The point you are missing is he did not program them to sync.

    • @Volvary
      @Volvary 4 года назад

      @@dannygjk Not sure if you meant that as "What you didn't understand" or "Missed from your explanation" but I did grasp that it wasn't coded to sync. What's I'm saying is more that the rule set forth as a tendency to lead to complete sync, where all the lights go at near exact same time, rather than very close.

    • @dannygjk
      @dannygjk 4 года назад

      @@Volvary My comment is for the OP of this thread. If your name is in the beginning of a comment then it's directed at you. If there is no name normally it means it is directed at the OP of the (sub)thread.

  • @JRabba1995
    @JRabba1995 4 года назад

    This behaviour can also be seen in fireflies that synchronize their firings. Look for a paper called “Synchronization of pulse-coupled oscillators on (strongly) connected graphs” by Núñez et. al. For an explanation on why this happens. Cheers.

  • @StefanReich
    @StefanReich 4 года назад +3

    Can you show us the full code? I'm not sure how exactly it works from your description

    • @bigjoshlevine
      @bigjoshlevine  4 года назад +1

      A quick version of the code here...
      forum.move38.com/t/cool-looking-synchronizing-firefly-demo/426

    • @StefanReich
      @StefanReich 4 года назад

      @@bigjoshlevine Nice, thanks

  • @amirkhalkhali2130
    @amirkhalkhali2130 4 года назад

    it is truly magical sir , well done ,great job.

  • @utsnow7952
    @utsnow7952 4 года назад +57

    Next episode:
    Simple coding takeovers the world

  • @Francisco-lf3zi
    @Francisco-lf3zi 4 года назад +1

    It really is amazing that under simple rules a system can spontaneously synchronize... It's a universal phenomenon that occurs when two or more oscillators interact: a system of coupled oscillators. Depending on certain parameters like frequencies and coupling coefficients, there will be or not be synchronization. www.scholarpedia.org/article/Synchronization

  • @clock4883
    @clock4883 4 года назад +4

    Did the 1K like :>
    Anywho, AMAZING. Demonstrates how simple things can emerge into extremely complex and intricate behaviour. All dependant on one very simple thing, splitting itself against many things to create a complex rule.

  • @TheMomo5502
    @TheMomo5502 4 года назад

    I aggree, simple code, simple behaviour, but very nice to watch and still very interesting effect. Great video :)

  • @HanakoSeishin
    @HanakoSeishin 4 года назад +28

    "I've programmed them to want to blink together and now they blink together, wow, that's like magic", seriously?

  • @csm8245
    @csm8245 4 года назад +3

    This is how the whole Replicator mess started. Next evolutionary step is to make them move and connect with each other to form a bug.

  • @SirBurnsicus
    @SirBurnsicus 4 года назад +14

    Why would you be surprised by this at all? There's only one way to go in the function which is up?

    • @LimitedWard
      @LimitedWard 4 года назад +6

      What's amazing is it's elegance and decentralized design. There isn't some common clock that the "bots" are using to synchronize. Through emergent behavior, each one is individually and asymptomatically reaching consensus.
      I could see this being useful for scenarios where synchronizing frequencies is difficult for complex systems. Suppose, for example, you wanted to transfer power between two or more power grids. Those grids run on AC, so you can't just tie some wires together between the grids because if the waveforms are out of sync it would cause a short. So instead you need to synchronize the grid frequencies and phases to have them operate in unison. This is one way you could do that automatically.

    • @osten222312
      @osten222312 4 года назад

      Up to what? There is no roof, there is no sync pulse or clock. It's pretty amazing.

    • @clray123
      @clray123 4 года назад +1

      I don't see any "amazing", "emergent", "behavior" or "complex" about it either. It's like the simplest imaginable feedback loop, what would you expect to happen if you define self-reinforcing rules like this? I suppose it only amazed him because of the physical devices that work by proximity and blinkenlights? Boring af if you just simulate or even think for 2 seconds about it.

    • @osten222312
      @osten222312 4 года назад

      @@toffeethedev that is not the rule

  • @luke
    @luke 4 года назад +1

    I believe this is same emergent property that causes all the clocks in clock shops to sync up their second hands?

    • @Nognamogo
      @Nognamogo 4 года назад +1

      What? Clocks don't communicate between each other in any way so no. That's just whoever set them -.-

    • @crazydragy4233
      @crazydragy4233 3 года назад

      that’s a good one :D

  • @jond532
    @jond532 4 года назад +22

    it's doing exactly what you told it to

    • @dannygjk
      @dannygjk 4 года назад

      No the syncing is emergent. He did not explicitly program them to all sync.

    • @jond532
      @jond532 4 года назад

      @@dannygjk I disagree but its still cool

  • @revenevan11
    @revenevan11 4 года назад

    My favorite kinda stuff! The RUclips recommendation algorithm knows me too well lol (this isn't quite the type chaotic emergent behaviour like the game of life of mandelbrot set or any of the chaos theory stuff I've been interested in lately, but I definitely see the common thread and why you're excited about it!). Just be careful not to make them group up into a world-ending Von Neumann machine next lol.

  • @memyselfandi8544
    @memyselfandi8544 4 года назад +2

    Life is an emergent behavior.

    • @AO-rw5xg
      @AO-rw5xg 4 года назад

      but how many rules are being applied. do these different rules intersect? do the rules change?

    • @memyselfandi8544
      @memyselfandi8544 4 года назад

      A O Rules by nature seldom vary, but in our case I think there is a case for rules that we don’t understand, under the control of a higher authority. Those rules are exactly what I want to know. Not merely the rules of physics which is a challenge indeed, but of the hierarchy, which must exist between all species.

    • @totallycarbon2106
      @totallycarbon2106 4 года назад +1

      @@memyselfandi8544 hierarchy is an emergent behaviour, not the rules.

    • @memyselfandi8544
      @memyselfandi8544 4 года назад

      TotallyCarbon Depends on who’s rules. Is nature natural? Division by who what how many..? 3 meter tall people with elongated skulls red hair transfixed on Orion roamed vast areas of Earth by sea and land, leaving a legacy of culture technology art science and theology.

  • @ismaeel747
    @ismaeel747 4 года назад

    That is actually really cool. Thanks for sharing

  • @KaliFissure
    @KaliFissure 4 года назад +8

    And if instead you make them speed up if the other liight was after them, and slow down if it was before them, phase relative
    and can you model a more complex cellular automata? build a few with some proton, neutron, electron relationship characteristics and you can model the formation of stuff out in deep space

  • @universeisawesome1
    @universeisawesome1 2 года назад +1

    Can anyone explain what the 'urge' is and how it works?

    • @bigjoshlevine
      @bigjoshlevine  2 года назад

      "Urge" is just a number that each keep track of internally. Normally it just slowly increases in value until it hits a maximum value, at which point the tile will blink and then reset the "urge" back to zero and start the process over again. But.. if a tile sees another nearby tile blink, then it will increase its current "urge" level by an amount that is proportional to the current amount of urge. This is where the magic happens! If it recently blinked, then its urge will be low and so seeing another tike blink will have little effect. But if it has been a while since it last blinked and its urge has grown pretty high, then seeing another tile blink will have a big effect and make its own urge grow by a lot. The closer it is to getting the urge to blink, the more likely seeing another tile blink with push it over the edge so it also blinks! Make sense?

  • @NihongoLoFi
    @NihongoLoFi 4 года назад +9

    affirm you just built the base of an energy shield...

  • @scottanderson8167
    @scottanderson8167 4 года назад

    Congratulations. You’ve invented the Christmas lights.

  • @ChadeGB
    @ChadeGB 4 года назад +10

    Now we know why when women live together their menstrual cycles sync.

  • @TuckerHolt
    @TuckerHolt 4 года назад +2

    This is so interesting to me.

  • @suryanshankur3078
    @suryanshankur3078 4 года назад +15

    Says *5 lines* of code shows a whole page

    • @Penguin_Spy
      @Penguin_Spy 4 года назад

      there is like 4 lines of whitespace between each line of code though

    • @crimsontyphoon3420
      @crimsontyphoon3420 4 года назад +1

      Most green lines are comments.....has no use just there for user understanding

  • @electric7309
    @electric7309 Год назад +1

    stephen wolfram is happy with you

  • @ShrubRustle
    @ShrubRustle 4 года назад +39

    Nobody:
    Menstrual cycles:

    • @Handhandme
      @Handhandme 4 года назад +1

      Why did you remind me of that... thing (the *sync* )

    • @fredericksetjadiningrat9517
      @fredericksetjadiningrat9517 4 года назад +3

      It's been proven to be anecdotal. Given different frequency of girls living togethet, over time there will an instance where the frequency will seems like it is catchinh up and sync. But then it will get out of synch and start to get further way. It also make sense because otherwise girl dorminatory will need special bulk delivery if it does sync over time 😅

  • @vinayseth1114
    @vinayseth1114 4 года назад

    Reminds me of the phenomenon of clapping at any event-we all begin by clapping at different speeds, but in a few seconds' time, all the claps have ended up getting synchronized at the same speed!

  • @axiezimmah
    @axiezimmah 4 года назад +5

    The moment when 5 lines of code are better at cooperation than the entire human race.

    • @Pellbort
      @Pellbort 4 года назад

      It's almost like computers aren't people

  • @aventurileluipetre
    @aventurileluipetre 3 года назад

    You know that "shocked" is used when you see something horrible happen, don't you? Anyway, beautiful synergy!

  • @luhem7
    @luhem7 4 года назад +4

    Oh my dude, wait till you try hanging 5 randomly oscillating pendulums on the same string

  • @stdavis
    @stdavis 4 года назад

    Thank YOU soooo much for this bro!!! WAYYYY UNDERSTAND AUTOMATA NOW

  • @bigjoshlevine
    @bigjoshlevine  5 лет назад +6

    The guy who discovered this talks about it here...
    ruclips.net/video/B7DxSTu4pzA/видео.html&t=1047

    • @KarstenJohansson
      @KarstenJohansson 4 года назад

      I wouldn't say he discovered it. He studies it, for sure, and he's made a specific model of it. But this has been known for some time now. Add one more sensor and/or response, or a more complex rule for the increase in urge, and you'll be getting into alife and cellular automata.

  • @Wignut
    @Wignut 4 года назад

    How dare this man feed these poor machines' blinking addiction.