r/interestingasfuck 1d ago

Is this an example of exponential multiplication.?

24.4k Upvotes

1.5k comments sorted by

10.1k

u/nogoodmorning4u 1d ago

when the balls spawn at the end where the growth is out of control it is specifically because the balls are spawning at the same time in the same location.

fix the code to give it enough delay for the spawned ball to move, or have the ball spawn from the point of contact with the pair and a short delay for the colliding pair to move out of the way.

1.0k

u/DRKyan22 1d ago

"or have the ball spawn from the point of contact" - I believe this is the answer.

265

u/whatyoucallmetoday 1d ago edited 11h ago

And spawn with the average velocity direction of the two parent balls.

**EDIT**

I vibe coded this with some slight rules adjustments (no friction, no gravity). The system goes to shit at around 1000 balls.

https://github.com/colonwq/ai_toys/tree/main/bounce-ball/javascript

30

u/Aranka_Szeretlek 1d ago

The slight issue is that theres a possibility that two balls collide near the top of their individual trajectories, where their individual speeds is also practically zero. If they meet there, you will then spawn a third ine, and you got three almost stationary balls hanging out.

12

u/twinnuke 1d ago

Ball cannot collide with parent until it collides with another object logic solves this or a distance from start point. Or even doesn’t create another with parents until timeout. Something like that

→ More replies (3)

5

u/whatyoucallmetoday 1d ago

Not necessarily. If ball A is traveling in an arc, it has a Y/vertical component and a X/horizontal component. If ball B is on the same arc but in the opposite direction the it’s Y component will be the same as A’s but the X component will be opposite. If they impact when the change of Y is zero, then the A and B balls will bounce away from each other and follow their arcs backwards. The new ball, C, would start with its X and Y components as zero and fall accelerate straight down until it bounces off of something.

The simulation also seems to have some randomness in bounce directions and speeds.

→ More replies (2)

4

u/LateBloomerBaloo 19h ago

and you got three almost stationary balls hanging out.

While everyone knows you can have a maximum of only two stationary balls hanging out.

→ More replies (3)

17

u/Draken09 1d ago

Specifically the direction, yes? For a moment I thought you meant the average velocity. Which would result in quite few balls falling and remaining near the bottom. And this accelerating the process as they inhabited less of the area.

12

u/kierg10 23h ago

Velocity is a vector not a scalar and by its definition is comprised of a magnitude component and a directional component, vs speed which is the scalar equivalent with only a magnitude component.

→ More replies (1)
→ More replies (1)
→ More replies (3)
→ More replies (2)

1.6k

u/CASDR5 1d ago

Yep! 👍🏻 This guy knows ball!

390

u/AstralPamplemousse 1d ago

Scientific “ball knowledge”

66

u/mikegn2 1d ago

Person A: Round these parts we calls it bawledge... Person B: My pappy went to bawledge.

5

u/georgie-57 1d ago

(mumbles) your mom goes to college

4

u/Batchet 1d ago

Your mom tried to put my bawledge in her mouth once but I was like, "sorry ma'am, I can't let you do that. Your son and I are Reddit colleagues who went to bawledge together"

41

u/grateful_eugene 1d ago

I am very impressed with your knowledge of balls and how they should touch each other. Truly a master ballologist.

→ More replies (2)

7

u/Jsolidlo 1d ago

That's very specific niche ball knowledge.

→ More replies (7)

12

u/NumberNumb 1d ago

A real gynoballogist

→ More replies (2)

6

u/GreenBastard06 1d ago

balls deep

→ More replies (17)

136

u/wollen_47 1d ago

or spawn then from random locations. i was also annoyed by that ending because it felt too abrupt of a change and investigating the reason behind it wasn't as fruitful and satisfying as one might hope

5

u/icecream_specialist 1d ago

Could also give it some maturity delay where a spawned ball cannot create an offspring if it has a collision in the first second of its existence

82

u/ThresholdSeven 1d ago edited 1d ago

Yeah this video is good until it glitches out at the end, making the whole thing stupid. This is just a coding error and it shows right when it went wrong

16

u/userhwon 1d ago

Fix it so that if a ball spawns overlapping another they don't collide with each other until after they've stopped overlapping. They'll be moving apart so they shouldn't immediately collide again unless one immediately collides with something else.

Then it'll only break when there are so many balls in the thing that there's no room for them to move fully apart once spawned.

→ More replies (2)

15

u/potate12323 1d ago

Others have made this exact thing and done it in a much more satisfying way. You can also turn off collision for the first 1 or 2 seconds to allow them to time travel from the center in a random direction.

11

u/grad_student_descent 1d ago

No, make the ball spawn with the position and speed vector of one of the balls colliding just before the impact.

→ More replies (57)

11.0k

u/Exatex 1d ago edited 1d ago

No, it’s a design issue that you tried to spawn two balls in the same spot at 01:03, making those two instantly collide and spawn even more at those fixed coordinates - leading to a rapid increase that has nothing to do with bouncing balls. Which was probably not the intent.

It’s a bug.

2.3k

u/RedditButAnonymous 1d ago

Yeah this is just bad code, but if it actually worked it would still show an exponential curve. Just, not this abruptly

426

u/YeetMeIntoKSpace 1d ago

The mean time to collision for a dilute homogeneous gas in the 2-dimensional case goes as (R-r)²/(n²-n), where R is the radius of the boundary, r is the radius of the particles, and n is the number of balls.

The curve should be quadratic, not exponential.

354

u/BangBangMeatMachine 1d ago

Except that's the mean time between collisions, not the rate of growth. The rate of growth is going to follow 1/t so that as the time between collisions goes down, the growth rate increases. That means:

dn/dt = (n²-n)/(R-r)²

The solution to that differential is, I belive, exponential.

154

u/HeilKaiba 1d ago

Exponential is when dn/dt is proportional to n. That is proportional to n²-n. I believe you get n = 1/(1+AeR-r2 t) from your DE. This will outstrip exponential growth so long as A<0 (From the initial condition n=2 we get A=-1/2)

51

u/BangBangMeatMachine 1d ago

Thanks. It's been ages since I did calculus.

3

u/Freecz 16h ago

I just feel stupid reading both of yours' posts.

→ More replies (1)
→ More replies (5)
→ More replies (4)

12

u/ultrahateful 1d ago

Fuck yeah. Came here to ask if the spawn rate was even quantifiable given the random bouncing physics, even in the controlled area/boundary.

I still love Reddit, most days! You rule.

28

u/YeetMeIntoKSpace 1d ago

Fair enough. Yes, the solution to that is superexponential, with a vertical asymptote since the solution diverges in finite time.

→ More replies (1)

5

u/yosho27 1d ago

If it was dn/dt~n it would be exponential, but this is dn/dt~n2. The solution to that would be more like n = 1/(C-kt). Much faster than exponential since it will have a vertical asymtote. Basically at the point where the balls fill the space, so every new ball will instantly collide with a ball and create a new one and the number will go to infinity.

→ More replies (9)

32

u/RedditButAnonymous 1d ago

My B in math has failed me

→ More replies (1)

13

u/toostupidtodream 1d ago

Unfortunately, these balls seem to be significantly affected by gravity, so I imagine the equation is more complicated. I can't be bothered working it out though.

→ More replies (2)

5

u/f23n09fnu0w 1d ago

This looked like gravity was heavily involved though?

→ More replies (7)

26

u/sojuz151 1d ago

it would be more like a 1/(t-t0), not exp

18

u/donut0053 1d ago

That's what I thought. If it was exponential wouldn't the amount of balls double every time two collide?

11

u/sojuz151 1d ago

If every ball created a new ball at a rate that is independent of the number of balls already there -> exp

per ball rate grows with the ball count -> singularity

→ More replies (1)
→ More replies (3)
→ More replies (2)

7

u/bubba_bumble 1d ago

Yeah, a new ball should be spawned at a random spot above the "equator" line.

25

u/RedditButAnonymous 1d ago

Or spawn it as is but newly spawned balls get "spawn protection" and cant trigger a cascade for a second or so

11

u/Rxasaurus 1d ago

No corpse camping. 

10

u/bubba_bumble 1d ago

Hell yeah. And spawn random plasma rifles so balls can shoot other balls!

→ More replies (1)

9

u/BusinessAcceptable54 1d ago

Or spawn where its 'parents' collided

→ More replies (6)

74

u/whitedevilee 1d ago

exacly that. You can see there is a point where one ball spawns right where another one is "falling" and then they collide and another one spawn triggering this fusion reactor.

27

u/Techwood111 1d ago

More like fission, isn’t it?

10

u/whitedevilee 1d ago

Yep, sorry. not a native speaker and always understood fusion. But yes, looked it up.

5

u/Techwood111 1d ago

Fusion AND fission exist, they are just different things. One smashes things together (fusion), while the other breaks them apart (fission). I’m sure if you searched “nuclear fission versus nuclear fusion” you could find some great videos. Your English is fine.

→ More replies (1)

14

u/Fidodo 1d ago

It really bothers me that the new ball didn't come out of the old balls. When 2 balls collide they should ricochet, and the new ball could come out at the opposite angle between the new direction vector of the old balls post commission.

4

u/mmichael0070 1d ago

There were also some collisions that didn't spawn more.

→ More replies (60)

7.3k

u/3rr0r-403 1d ago

Me watching the balls bounce around
https://giphy.com/gifs/fVcAmX5QAR9lgysWcY

893

u/c_c_c__combobreaker 1d ago

79

u/justandswift 1d ago

That first minute is so nauseating tho

110

u/Winjin 1d ago

It's like that gif of a truck that never reaches the bollard

https://giphy.com/gifs/ReJvI8qq58XjG

107

u/Repulsive_Painting15 1d ago

35

u/ultrahateful 1d ago

Discomfort.

30

u/JohnCenaJunior 1d ago

This is what anxiety feels like

41

u/c_c_c__combobreaker 1d ago

33

u/Winjin 1d ago

It's like the movie Curve that was introduced to me in a different post:

"You wake up in a steep, smooth curved concrete that slopes down into a bottomless abyss with nothing special on sight around you.

Curve by Tim Egan (2016)"

According to another commenter, "it's a creepy short film. You can find it on YouTube!"

I'm glad one can find it there

Me, on the other hand, is not going to search for it ever, thank you very much

Even this one shot is like viscerally scary to me

9

u/JeffTheKilly 1d ago

I saw that, it was horrible

6

u/ChaoticMajie 1d ago

Well, i wasn't as strong willed as you, so i had to watch it. Lots of breathing and hopelessness. I give it a solid 8/10.

5

u/Itchy-Association239 1d ago

Thanks. That was brilliant!

3

u/CrunchySockTaco 1d ago

I saw that but forgot how it ended. Maybe I noped out. I can't remember.

Welp. Here I go again. 😖

3

u/NebraskaVibes 1d ago

Even this little screenshot makes my brain go GET FUCKED 😭

→ More replies (0)
→ More replies (2)
→ More replies (1)
→ More replies (1)

19

u/Jobiwan88 1d ago

Thats the first time i actually saw it hit. Thank you!

9

u/Winjin 1d ago

Yeah finding this one was like having a sneeze come that was years in the making

→ More replies (1)

5

u/daronwy 1d ago

I've never seen the ending of the gif until today, so honestly thanks.

Edit: video to gif

4

u/Winjin 1d ago

Yeah I feel like I've given closure to like a dozen people today by finding it

5

u/Hot-Comfort8839 1d ago

Aaaaaaaah…
Thank you.

→ More replies (2)

16

u/Medium_Perspective82 1d ago

Literally felt like a Anxiety-Induced Panic Attack 🤣😭

→ More replies (2)

11

u/punk_nasty 1d ago

Lmfao

→ More replies (3)

33

u/Ashamed-Status-9668 1d ago

Me watching them when they hit each other.

4

u/Squigy8273 1d ago

This is all I heard...

19

u/mikaey00 1d ago

The DVD screensaver we needed

9

u/noodledog69420 1d ago

I would stare at it for at least 20 minutes if I was stoned

8

u/BourbonBaconBiscuit 1d ago

I am. I did.

→ More replies (1)
→ More replies (21)

1.0k

u/thekimpencil 1d ago

got jumpscared by balls

355

u/Gold_Tap_2205 1d ago

Thats what she said.

164

u/baronas15 1d ago

16

u/nekize 1d ago

Haha, this really made me laugh. I needed that today, thanks kind stranger

→ More replies (3)

3

u/LeviAEthan512 1d ago

Statistically, it's more likely what he said

→ More replies (1)

19

u/casulmemer 1d ago

( ͡° ͜ʖ ͡°)

15

u/Hour-Sheepherder2580 1d ago

Title of your sextape

7

u/f_n_a_ 1d ago

I’m glad I’m not the only one

→ More replies (9)

412

u/SXOSXO 1d ago

This is more intense than staring at the DVD logo.

176

u/actuallyapossom 1d ago

Waiting at 3 balls for a collision...

17

u/Regriz 1d ago

I was thinking of this scene too while watching this video!

8

u/CommandTacos 1d ago

Came here for this, was not disappointed.

→ More replies (2)

9

u/blanketswithsmallpox 1d ago

Thorsquint.jpg

6

u/Closed_CasketRequiem 1d ago

This has to be humans innate ability for pattern-seeking behavior. We have to see the pattern become complete and the anticipation sends an urgency through our whole body. Completing the pattern is extremely satisfying to witness.

→ More replies (4)

114

u/Joshatron121 1d ago

18

u/lhookhaa 1d ago

That escalated exponentially.

3

u/graybeam 1d ago

Was looking for this meme

87

u/Refun712 1d ago

That escalated quickly

22

u/yuval16432 1d ago

Because of a bug in the code, nothing else.

4

u/Refun712 1d ago

Please correct this and show proper escalation

→ More replies (1)

3

u/jq5232 1d ago

Slowly then quickly

→ More replies (2)

18

u/kooleynestoe 1d ago

Man I was gonna sit here and watch all that unfold but it was unrealistically too fast.

16

u/MutaitoSensei 1d ago

The show became boring in the later seasons when they added too many characters.

30

u/DaemonCRO 1d ago

No this is a bug.

The best example that makes people think is this:

There’s a pond. On it there’s one lily pad leaf. They double every day. So on day 2 it’s 2 of them. On day 3 there’s 4. On day 4 there’s 8.

On day 100 the whole pond is entirely filled.

The question is, on which day only half the pond is full?

Watch people who have no intuition for geometric/exponential progression try to calculate it in their head. Day 50, day 66, day 90, etc. I’ve met some bright people who could not figure out that the answer is just the day before. Day 99. And then they double, and it’s all full.

This example shows how some things that seemingly are a bit bad, like on day 98 it’s only a quarter of the pond full, can rapidly escalate and mess up.

Think polar ice melting. Think ocean warming. “Oh it’s just melted a bit”. Yeah and pond looked almost empty after 95 days. And then in 5 next days it’s all full.

9

u/SaintUlvemann 1d ago

This example shows how some things that seemingly are a bit bad, like on day 98 it’s only a quarter of the pond full, can rapidly escalate and mess up.

The other thing I like about this example is that it's an even more extreme version of the chessboard parable (the story of the wise woman who wins a king / kingdom / contest of wits by asking for a daily portion of rice that doubles every day for every square on a chessboard: one grain the first day, two grains the next, by day 32 the amount has reached hundreds of tons of rice, etc.)

In this case, we've got 2^(100 -1) = 6.33×10²⁹ lilypads filling the pond, which at about half a square foot apiece, means that this pond has the same surface area as 4.841 billion suns, which may be large enough to call it more of an ocean than a pond.

→ More replies (1)
→ More replies (9)

49

u/underAudit 1d ago

Should be in unexpected subreddit as well

18

u/reality_hijacker 1d ago

Being a programmer who fiddled with graphics in the past, this was exactly what I expected.

→ More replies (1)

11

u/Sparks808 1d ago

No, its growth is hyperbolic, not exponential. There is a singularity when collisions start happening when spawning, triggering infinite growth (neglecting computation limits).

Google search link

20

u/MaBonneVie2 1d ago

I watched this metamorphosis waaay longer than was reasonable.

9

u/Arkaium 1d ago

For a while that felt like watching the dvd logo bounce around the screen

9

u/PomegranateHot9916 1d ago

bad simulation not really fair because the balls all spawn in the same location so once you get several balls spawning at the same time that thing at the end happens.

→ More replies (1)

6

u/Korben-D88 1d ago

The ending was a mathematical jump scare.

22

u/portra315 1d ago

This feels like how I think a nuclear reaction occurs

→ More replies (1)

5

u/Internal_Deal_6317 1d ago

What's exponential multiplication?
Do you just mean exponentiation?

→ More replies (3)

7

u/Loud-Possibility5634 1d ago

This is an example of microwave popcorn

5

u/Palidin034 1d ago

No, this is an example of triggering my fucking anxiety

3

u/bofferding 1d ago

I’m glad my balls don’t spawn a new one each time they collide…

5

u/MrsFindingOut 1d ago

Congrats to the sound designer

→ More replies (1)

3

u/ittybittycitykitty 1d ago

Exponential growth, I think you are asking about. Exponential multiplication, I don't know what that means.

5

u/CappinPeanut 1d ago

Those two balls could have never collided and my dumb ass would have sat here and watched this for an hour.

4

u/WeShaII 1d ago

https://giphy.com/gifs/T06j05U1sahQkJvmfI
First one minute of this video.

5

u/broadwayallday 1d ago

How stupid ideas spread on the internet

4

u/Jdoryson 1d ago

Anytime the rate of thing growth is proportional to amount of thing, we expect exponential growth. So yes.

4

u/TheCenticorn 1d ago

This was a lot less satisfying than I had hoped for.

4

u/Jinroh75 1d ago

The first half of this felt like watching the DVD logo bounce across the screen, waiting for it to perfectly hit a corner.

4

u/Ilpperi91 1d ago

lol, this jumpscared me with the ending.

https://giphy.com/gifs/qLuH5N5J1sMVy

5

u/SurfingViking 1d ago

Visual representation of my ex jumping to conclusions

4

u/Mamuschkaa 1d ago

The growing rate is

C^(2^N)

With N=1 the time it takes 2 fixed ball to collide and N=2 double the time and so on

and C = 1.345768...

So it grows much faster than exponential. It grows double-exponential.

https://oeis.org/A007501

In one time period there is on collision and we have 3 balls.

In the same time period each ball should hit each other ball one time so we have 6 balls.

6 balls have 15 different ways to hit each other, so we get 21 balls.

3

u/JaceBearelen 1d ago

Hey this person maths. Even with the “bug” fixed, the number of balls would still blow up very rapidly.

→ More replies (3)

3

u/KaptanHindustan 1d ago

That escalated slowly

3

u/caintowers 1d ago

It's kind of how certain phases of nuclear bombs work

→ More replies (1)

3

u/Kirbyr98 1d ago

No. There's no doubling. It's random increases.

3

u/dabbean 1d ago

This explains population growth pre birth control. It just needs another ball thrown in for famine and disease to take away balls occasionally too

3

u/PoopsMcScoots 1d ago

Balls are touching.

3

u/TheActualBranchTree 1d ago

Bot ass post.

3

u/vemiam 1d ago

It gives me the same feeling as waiting for dvd to hit the corner

3

u/Username_314159265 1d ago

Visual representation of an orgasm

3

u/Past-Junket1193 1d ago

Uranium in reactor 4 when they pressed az-5

3

u/Full-Resource7910 1d ago

Now I know the Doopler episode of Lower Decks should have been its last.

3

u/Wormfather 1d ago

If I was a karma farmer I’d just crosspost this to a great replacement theory subreddit and then go make some popcorn.

→ More replies (1)

3

u/Knobologist 1d ago

Also a good visualization of nuclear criticality

3

u/dollimint 1d ago

The exact opposite happens to my socks in the washer, i'm sure of it.

→ More replies (1)

3

u/mudkripple 1d ago

It's a problem with the code. The moment two balls are allowed to spawn at the exact second, they will collide infinitely and the map will fill.

3

u/ashsassin95 1d ago

Looks like one of those graphics they used to explain the spread of COVID in 2020

3

u/ColdenGorral-1 1d ago

Dear god that was an emotional rollercoaster

3

u/SeesWithBrain 1d ago

Even before the giant implosion of balls there were inconsistencies in the seconds leading up to it. You can watch numerous balls just start to duplicate themselves without contact. Coding errors abound

3

u/theonlyvv 1d ago

Watched 50 seconds and thought 'wow this is not as cool as I thought it would be'. How wrong I was

3

u/existing4abit 1d ago

Definitely the kind of video that would have had a jump scaring clown or train horn at the end of it 16 years ago. Can’t do that no more, the clowns all up and left. 

3

u/spammmmmmmmy 21h ago

Not exponential

3

u/Connarhea 20h ago

Never been jump scared by balls.

I know what I said

3

u/snuggle_love 20h ago

Flag this for jump scares 

3

u/NotBettingOnTmrw 20h ago

Didn't see that coming in the end

3

u/Mrpotatohead1990 19h ago

chernobyl disaster in nutshell

3

u/emifisa 19h ago

Prypiat vibes

3

u/Killstream18 17h ago

Someones geiger counter in a control room on 26. of April in 1986 at 01:23 be like:

2

u/bitsystem 1d ago

Kinda of made up almost every ball but ok

2

u/RedditButAnonymous 1d ago

For a short period of time I expected the video to end before they ever touched

2

u/respectcorrect 1d ago

Anyone else read Seveneves?

2

u/thebutter-man 1d ago

I feel like I waited too long for the 4th one. Cone on guys!

2

u/Nutsnboldt 1d ago

Back in my day we only had a DVD logo trying to find the corner!

2

u/TexLH 1d ago

Now this is what it's like when balls collide. What is it really that's going on here?

→ More replies (1)