Lines That Connect
Lines That Connect
  • 4
  • 2 072 216
The Bubble Sort Curve
A derivation of the curve that is approximated by a common visualization of the bubble sort diagram.
Read the full proof on my site: linesthatconnect.github.io/blog/a-rigorous-derivation-of-the-bubble-sort-curve/
The viral sorting algorithm video which first sparked my interest: ua-cam.com/video/kPRA0W1kECg/v-deo.html
The animations in this video were created using Manim: www.manim.community/
Music credits:
Fluidscape by Kevin MacLeod is licensed under a Creative Commons Attribution 4.0 license. creativecommons.org/licenses/by/4.0/
Night Music by Kevin Macleod
river - Calm and Relaxing Piano Music by HarumachiMusic
... And a couple of my own songs:
The Fog: soundcloud.com/lines-that-connect/the-fog
Heavy Head, Light Rain: soundcloud.com/lines-that-connect/heavy-head-light-rain
Thanks For Watching: soundcloud.com/lines-that-connect/thanks-for-watching
Chapters:
00:00 Intro:
0:37 Laying the Background
3:20 How Bubble Sort Works
6:59 Mathematically Describing Diagrams
9:13 Stretching the Diagrams
11:52 Visual Derivation
14:38 Symbolic Derivation
16:48 Nice!
17:07 A Rigorous Solution
Переглядів: 449 932

Відео

The Trig Hiding Inside the Factorials (And the Harmonic Numbers)
Переглядів 146 тис.Рік тому
In this video, we build on my last two videos by exploring connections between the gamma function (the extended factorials), the digamma function (the extended harmonic numbers), and trigonometry. We derive Euler's Sine Product Formula, which we then use to prove the gamma and digamma functions' reflection formulas. Finally, we derive a related formula for calculating cotangent. Watch my previo...
How to Take the Factorial of Any Number
Переглядів 1,2 млнРік тому
In this video, I walk through the derivation of an extension of the factorial function that works for any number: fractional, irrational, and even complex! This turns out to be a very important function, known as the gamma function, which has many surprising connections, one of which I explore in the last chapter of the video. The animations in this video were made with Manim, an open-source Py...
Extending the Harmonic Numbers to the Reals
Переглядів 312 тис.2 роки тому
The harmonic numbers are the partial sums of the harmonic series - sums of whole number reciprocals. This video explores how we can extend their domain to the entire real line. The animations for this video were made with the community edition of Manim (www.manim.community). Huge thanks to everyone who worked on the library, as well as the members of the Discord server who answered my many ques...

КОМЕНТАРІ

  • @haukzi
    @haukzi 13 годин тому

    FYI, calling it "worst" is simply wrong. It is pretty much tied with the optimal algorithm to use if your lists are almost-but-not-quite sorted. Using quicksort and merge sort in that scenario is actually really bad.

  • @thetopnick32
    @thetopnick32 День тому

    I was so suprised it's so simple formula.

  • @josiahliang1455
    @josiahliang1455 День тому

    doth mine ears protest a Minnesota accent

  • @Kasfas
    @Kasfas День тому

    Good video very entertained. Would this logic also apply to the strange hump you see in cocktail sort?

  • @AudNarrations
    @AudNarrations 2 дні тому

    Maths grad here - I always assumed the graph was a square root but very happy to be shown wrong! Really liked your assumptions and method its very clever!! Loved the graph stretching and bam they match part that was crazy cool

  • @aniksamiurrahman6365
    @aniksamiurrahman6365 2 дні тому

    But the curvy hump section of the bubble sort curve waves. How to account for that wave?

  • @gnawnickvods939
    @gnawnickvods939 2 дні тому

    30 seconds in "its logarithmic" And then he talks about continuous functions, and i was like "it's logarithmic"

  • @gnawnickvods939
    @gnawnickvods939 3 дні тому

    Can you show us what a bar graph of a group of randomized bar graphs look like

  • @PepijndeVos
    @PepijndeVos 3 дні тому

    But what IS that curve? Some kind of maximum or average or...

  • @orbatos
    @orbatos 3 дні тому

    The gap in data is pretty interesting, there are applications I can think of that satisy the constraints.

  • @MrLegarcia
    @MrLegarcia 4 дні тому

    Masterfully done

  • @Inspirator_AG112
    @Inspirator_AG112 4 дні тому

    *@[**02:16**]:* Like you are doing right here. (:

  • @dalibormaksimovic6399
    @dalibormaksimovic6399 5 днів тому

    And bernoullis numbers poping out somewhere...

  • @munimahmed7877
    @munimahmed7877 5 днів тому

    Ur friendly arrogance is adorable 😂

  • @CarrotCakeMake
    @CarrotCakeMake 5 днів тому

    I think you somewhat yadda yadda over the issue that a/2 of the end of prefix of the first list, and b/2 of the end of the second list's prefix, are actually modified by what is in the suffixes. That's a pretty big gap between the end of the prefix and the (1-a, 1-a) point.

  • @d0tz_
    @d0tz_ 6 днів тому

    This is nice but I want to know WHY bubble sort would produce such a curve. It’s crazy that the answer is as simple as x/(x+t). How is it that the algorithm precisely creates this function?

  • @SthefanoSchiavon
    @SthefanoSchiavon 6 днів тому

    Beautiful

  • @mikebernard8535
    @mikebernard8535 6 днів тому

    Great topic choice, well-explained solution, and beautifully animated!

  • @hummel6364
    @hummel6364 6 днів тому

    3:38 OH BROTHER, THAT'S JAVASCRIPT. That language is so horrible I have no idea what that means, and I have over a decade of programming experience in various languages.

    • @cst1229
      @cst1229 4 дні тому

      javascript does not have for..to.. loops

  • @sojwalgosavi7871
    @sojwalgosavi7871 7 днів тому

    Didn't grasp all but enjoyed alot 😮

  • @houmamkitet9555
    @houmamkitet9555 7 днів тому

    An amazing video I always wanted to have a passion for math the way you guys seem to have but never really had the stomach or the time to pursue it whilst also following natural science stuff Keep rocking it and thank you for the grey matter stimulation

  • @anugrah1921
    @anugrah1921 7 днів тому

    real ones know that Bogosort is the fastest

  • @DarkblueRadiance
    @DarkblueRadiance 7 днів тому

    10:37... instant subscribe

  • @skyjumper4097
    @skyjumper4097 7 днів тому

    fancy as hell intro i approve

  • @yobniares
    @yobniares 7 днів тому

    this video has some ancient math vibe, when no complicated methods are used, but we still can come up with an elegant solution. i really enjoy that stuff

  • @marcoramonet1123
    @marcoramonet1123 8 днів тому

    What's the name of the principle (if any) behind the introductory animation? The squares rotating.

  • @math4fun
    @math4fun 8 днів тому

    Here some points that does not connect: Which is the inverse of the factorial function. Would you define a formula to determine Which factorial gives an odd number, like 3;5;7;9... It's normal starts with (x!)^-1 here is half of a wonder identity.

  • @ayabaroudi333
    @ayabaroudi333 9 днів тому

    U are better than 3blue 1brown

  • @beaumatthews6411
    @beaumatthews6411 9 днів тому

    NOICE

  • @yahyabenabdelkrim2131
    @yahyabenabdelkrim2131 9 днів тому

    I love when u come up with those problems they are very unique and special also how u make it easier to understand by this animation. Keep going bro

  • @paulwhite6995
    @paulwhite6995 9 днів тому

    Comment No. 666: Your background fake "music" is a pestilence.

  • @Joao_-wv3yq
    @Joao_-wv3yq 9 днів тому

    This sounds like megaman 1 diying

  • @ChristofApolinario
    @ChristofApolinario 11 днів тому

    11:30 lol it's just like a kid needing a help to a strong one

  • @74bassman
    @74bassman 11 днів тому

    What type of math is this called? Very fascinating, I want to study the gamma constant more !

  • @leonardofilippini
    @leonardofilippini 11 днів тому

    unbelievable

  • @cypriengimenes4022
    @cypriengimenes4022 11 днів тому

    This is really impressive, thank you !

  • @ardabkc
    @ardabkc 12 днів тому

    I don't understand how we can say that for arbitrarily large N the interval approaches a horizontal line. Isn't harmonic series divergent? Doesn't it approaching to a horizontal line imply that series is convergent?

    • @fsponj
      @fsponj 2 дні тому

      It does not approach a horizontal line. It just looks that way. It still gets larger but the amount is extremely small. The function grows but at an extremely slow pace. For example x/1000 does not converge at x approaches ∞ but it still looks like a straight line. Another example is Σ(n¹ᐟⁿ-1) from n=1 to x diverges as x approaches ∞ even though it looks like a straight line if you go far enough.

  • @ishu4227
    @ishu4227 12 днів тому

    Oh boy, I can't wait for the Cocktail Shaker Sort Curve!

  • @ishu4227
    @ishu4227 12 днів тому

    "Hey, check this out!" "What?" "WAWAWAWAWAWAWAWOWOWOWOWOWOWOWOWOWOWOOWOWOWOWOOOWOWOWOWWWWWowwowowwowwwuwuwuwuwuwwwwhwhhhuhh" "What the flip-"

  • @Inderastein
    @Inderastein 13 днів тому

    (0.5!*2)^2 = Pi I accidentally found this out by literally multiplying 0.5! by two in desmos. This was where my legacy in mathematics began in school. And yes, I've seen that most of the numbers are actually irrational as Pi is included... but for months i've been searching a way to connect Pi and Phi through the same gamma function

  • @kman41822
    @kman41822 13 днів тому

    This is the coolest! Just found your channel, excited to see more!!

  • @thexoxob9448
    @thexoxob9448 14 днів тому

    Paradox alert: (1/2)! = sqrt(pi)/2 = (1/2) × (-1/2)! = (1/2) × (-1/2) × (-3/2)! = (1/2) × (-1/2) × (-3/2) × (-5/2)! = (1/2) × (-1/2) × (-3/2) × (-5/2) × ..., which diverges..

  • @user-lf1po1mm9b
    @user-lf1po1mm9b 16 днів тому

    Ok, that's the way to start a video!

  • @ShadyHero
    @ShadyHero 18 днів тому

    you should make this this your dissertation for a PhD

  • @DominusTalks01
    @DominusTalks01 19 днів тому

    Acctualy sin/cos =tan and -sin/-cos=cot but u said -pi× that so that is just: Pi×-sin/pi×-cos=-pi tan which is cot(2.14159...) so ur right

  • @shiznickzon
    @shiznickzon 19 днів тому

    Since sine is an entire functions, the Weierstrass factorisation theorem can be used to show the sine product formula is valid

  • @hobocraft0
    @hobocraft0 19 днів тому

    Aww shit, I thought it'd be a log, not an exponential, whoops it's an inverse, I'm silly.

    • @yobniares
      @yobniares 7 днів тому

      same, after so much time studying of linear control systems my first thought was like "hmm, that's probably 1-exp(-T*x)"

  • @ioansimion892
    @ioansimion892 21 день тому

    Is it possible to make it a one variable function?

  • @dagalabable
    @dagalabable 21 день тому

    I once calculated factorial of 1 million on my laptop, when I was 13. I had to python, but its just a simple recursuve algorithm. Suffice to say, after about half an hour of calculating, it returned a message that it had finished, but if i expanded the output to view it, it might break my computer. So I never did see factorial of 1 million, but I can tell you it has 5 565 709 digits (that laptop died several years ago, i wonder why...?)

  • @DalFuqBoom
    @DalFuqBoom 21 день тому

    10:36 bro turned into Vsauce