The Bubble Sort Curve

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ม.ค. 2025

ความคิดเห็น •

  • @LinesThatConnect
    @LinesThatConnect  8 หลายเดือนก่อน +544

    A few notes which might be of interest, but which didn't fit in the video:
    - 3:27 - I'm using a loose pseudocode to represent the algorithm as compactly as possible. The for loops go to N - 2, inclusive. For some reason, that felt more natural to me.
    - Most of the list sorting animations use a more optimized version of the algorithm than what I step through. Since the largest n items are sorted after n iterations, we can stop the scan early, so each iteration is quicker than the last one. I used the slower version for the math because it is simpler to pretend that every iteration takes an equal amount of time. To transform the result into the more optimized version, just replace t with 1 - √(1 - t).
    - I "cheated" a bit for some of the animations by using specifically designed shuffles to make the curve really clear (0:02, 0:23, 16:54). The curve starts becoming really clear with random shuffles when the size of the list gets into the thousands (like at 2:30). But when the list length is in the low hundreds, it's usually pretty lopsided (like at 1:18). I think the low hundreds size is the most visually pleasing, so I figured that a slightly fudged shuffle was worth the extra visual clarity.
    - 1:48 - The timings are actually still not quite right here. The time is based on comparisons only; I forgot to take swaps into account. Insertion sort should be about half as fast as it appears.
    - I recently learned that this result was published in a paper about six months before I completed this video! "Nonparametric testing via partial sorting" by Krzysztof Bisewski, H. M. Jansen, and Yoni Nazarathy. Read it here: arxiv.org/abs/2210.14546

    • @javabeanz8549
      @javabeanz8549 8 หลายเดือนก่อน +10

      This is of course a special case. A lot like a giant single deck of cards, each one is unique. Real data or random data rarely comes close to this pattern. But as you stated, a larger data set will produce better curves. It does make for some rather cool visuals.

    • @dada236
      @dada236 8 หลายเดือนก่อน +2

      Another way of deriving the function would be to use probabilities, measuring the probability P[N=n] where n is the number of numbers to the left of an arbitrary position being lower than the number at that position. You could use n as a parameter to find f(n,t)

    • @neyzzury
      @neyzzury 8 หลายเดือนก่อน +1

      Bro you gotta make more Videos
      I enjoy them so much, you have an uncommon Talent in explaining (an manim, i dont get the library -_-)

    • @bothieGMX
      @bothieGMX 8 หลายเดือนก่อน +1

      You made the assumption, that the input data of Bubble Sort is more probably random, than almost sorted. I believe this to be wrong. IMHO, the only useful application of Bubble Sort (beside for educational purposes and making videos about the Bubble Sort Curve ;) is sorting some data which is constantly changing, the changes tend to be small but are highly scattered. One example that comes to my mind is the list of objects to be drawn in a 3D game. Have the objects sorted from "most fragments" to "least fragments", so nearby objects that obstruct other objects get drawn first and thus reduces the overall amount of work to be done drawing farther away objects only to overdraw them an ms later. How, this list will constantly change by the player moving and turning around (and moving objects), but most of this changes tend to be relatively small from frame to frame. So update the array with some measurement of "number of fragments drawn for this object" then resort the stuff using some Bubble Sort variant (maybe just do a constant but small number of iterations each frame, the result doesn't even need to be completely sorted for next frame), making sure the "biggest" objects are drawn first.

    • @Smol_Schan
      @Smol_Schan 7 หลายเดือนก่อน +1

      Could you make a video showing how yo set up this equation in Desmos Graphing Calculator? I'm a highschooler with not much education on functions, and I want to play around with it.

  • @srikar4220
    @srikar4220 8 หลายเดือนก่อน +2489

    The most impressive part of it is that you did not skip the rigor, you wrote up a 26 page paper exploring the details. Really cool video.

    • @LightslicerGP
      @LightslicerGP 8 หลายเดือนก่อน +128

      HE WROTE A PAPER ALONGSIDE THIS VIDEO?
      Holy sh-
      Edit: just finished the video and oh my God the madman actually did

    • @Prograde
      @Prograde 8 หลายเดือนก่อน +8

      average lsgp strat

    • @LightslicerGP
      @LightslicerGP 8 หลายเดือนก่อน +1

      @@Prograde what the fuck why are you here

    • @kurrycat
      @kurrycat 8 หลายเดือนก่อน +2

      mcpk meetup moment

    • @LightslicerGP
      @LightslicerGP 8 หลายเดือนก่อน

      @@kurrycat what the fuck you too 😭😭
      5.15.24

  • @frama589
    @frama589 8 หลายเดือนก่อน +2365

    the curve matching is a lot more satisfying than any sorting video i have seen

    • @patch858
      @patch858 8 หลายเดือนก่อน +67

      The entire derivation build up made it so satisfying to see it smoothly lock into place after all his work

    • @haipingcao2212_.
      @haipingcao2212_. 8 หลายเดือนก่อน +2

      k
      u
      v
      I
      n
      a

    • @Luna5829
      @Luna5829 8 หลายเดือนก่อน +7

      manim has such good-looking visuals istg
      it's made by 3b1b so that's why you might see some similarities in the visuals

    • @Killerspieler
      @Killerspieler 8 หลายเดือนก่อน +3

      I watched that and could not stop myself from saying "nice", just to here "nice" in my ears a few seconds later 😂

    • @otherodd
      @otherodd 6 หลายเดือนก่อน

      @@Luna5829I don‘t know if the visuals are all manim, the equations probably are but I think there’s some other software too and it looks GORGEOUS (more so than 3b1b imho)

  • @garthgoldwater5256
    @garthgoldwater5256 8 หลายเดือนก่อน +622

    the way you gray out the inequality and move it to the side, and the way you color and increase or decrease the size of relevant parts of the graphs and equations is SO HELPFUL and i imagine tricky to get exactly right. i really appreciate it

    • @givrally
      @givrally 8 หลายเดือนก่อน +25

      It's actually not that hard to do using manim, it's a single line for each one. What I find impressive is that he even had the idea to do this, in this form, with these positions and timings, and in the end it's really the combination of all these design choices that make this video so beautiful to watch.

    • @garthgoldwater5256
      @garthgoldwater5256 8 หลายเดือนก่อน +18

      @@givrally oh i meant “tricky to get exactly right” as in there’s a ton of feeling out being done for timings and sizes, and the feedback loop is indirect

  • @EyalBrown
    @EyalBrown 8 หลายเดือนก่อน +1602

    You realize you probably have one of the best average video quality on TH-cam, right? 4 videos, all killer, no filler.

    • @unneccry2222
      @unneccry2222 8 หลายเดือนก่อน +54

      he is the next 3b1b i think

    • @1st_ProCactus
      @1st_ProCactus 8 หลายเดือนก่อน +14

      Lol @ best average video quality

    • @stevelin3659
      @stevelin3659 8 หลายเดือนก่อน +22

      I know quite a few channels with very few very high-quality videos, such as Nemean and CodeAesthetic, and they happen to both be programming-related.

    • @grayolson9529
      @grayolson9529 8 หลายเดือนก่อน +1

      Joshs Channel also up there

    • @henrycgs
      @henrycgs 8 หลายเดือนก่อน

      a channel with a single, great, video is better :)

  • @bonbondojoe1522
    @bonbondojoe1522 8 หลายเดือนก่อน +3735

    Babe not now, factorial guy just dropped

    • @Sir_Isaac_Newton_
      @Sir_Isaac_Newton_ 8 หลายเดือนก่อน +140

      I, Newton, have also come to witness this event.

    • @rewixx69420
      @rewixx69420 8 หลายเดือนก่อน +8

      yes yes yes

    • @no_mnom
      @no_mnom 8 หลายเดือนก่อน +1

      😂

    • @HopefullyJustMe
      @HopefullyJustMe 8 หลายเดือนก่อน +23

      @@Sir_Isaac_Newton_SIR ISSAC NEWTON 🗣️🗣️🗣️

    • @creativename.
      @creativename. 8 หลายเดือนก่อน +2

      Lmaoooo

  • @DavidSartor0
    @DavidSartor0 8 หลายเดือนก่อน +219

    I saw your presentation about this at a conference, maybe a month ago.
    I think maybe you said I was the first person you'd met that had seen your videos.
    This explanation is much clearer. Thank you.

    • @LinesThatConnect
      @LinesThatConnect  8 หลายเดือนก่อน +112

      Hey David, it was nice to meet you at the conference! I'm glad this approach worked for you

  • @Grayson_Wu
    @Grayson_Wu 8 หลายเดือนก่อน +391

    16:22 I can't even imagine the work you put in that ≥ to ≤ transition in manim. Great video as always.

    • @LinesThatConnect
      @LinesThatConnect  8 หลายเดือนก่อน +247

      I'm so glad this didn't go unnoticed! It's the kind of thing where you'd never think it takes so much work unless you've tried it yourself.

    • @londonl.5892
      @londonl.5892 8 หลายเดือนก่อน +26

      @@LinesThatConnect I haven't tried it and I was still in awe. I saw the equations dissolve and I was like "Wow, that was impressive."

    • @higztv1166
      @higztv1166 6 หลายเดือนก่อน

      how's that impressive, I don't get it

    • @40watt53
      @40watt53 6 หลายเดือนก่อน +14

      @@higztv1166 Editing anything takes so much obnoxiously longer than you'd expect.

    • @theseangle
      @theseangle 4 หลายเดือนก่อน

      ​@@higztv1166 try to animate it yourself and you'll see

  • @ndiamantopoulos
    @ndiamantopoulos 8 หลายเดือนก่อน +362

    Bro just comes in every year or so and just drops a banger on us

    • @haodzz
      @haodzz 8 หลายเดือนก่อน +34

      I just checked: It has been 08/2021, 08/2022, 04/2023, and this month 04/2024.
      See you in 2025.

    • @davidcotham1939
      @davidcotham1939 8 หลายเดือนก่อน +9

      Bro took quality over quantity to heart

  • @darkshoxx
    @darkshoxx 8 หลายเดือนก่อน +955

    17:50 "Which this epilogue is too small to contain", i.e. it will be proven in 350 years with methods not yet available to us. Here's to hoping 🤞. Great video btw!

    • @Rudxain
      @Rudxain 8 หลายเดือนก่อน +117

      Fermat moment

    • @sang1025com
      @sang1025com 8 หลายเดือนก่อน +14

      i thought of this exact same thing xD

    • @Celestia1323
      @Celestia1323 8 หลายเดือนก่อน +12

      Lets wait for 2374 :D

    • @whophd
      @whophd 8 หลายเดือนก่อน +14

      @@Rudxain FERMAT C: … uh oh I erased the data

    • @TheBooker66
      @TheBooker66 8 หลายเดือนก่อน

      lmao yep

  • @dizzylilthing
    @dizzylilthing 2 หลายเดือนก่อน +69

    0:33 it's called Churgleture and it is a measure of how bigly the datum is

    • @Blaczolt
      @Blaczolt หลายเดือนก่อน +9

      What

    • @dizzylilthing
      @dizzylilthing หลายเดือนก่อน +19

      @Blaczolt wouldn't look you like to know

    • @astrobolt992
      @astrobolt992 หลายเดือนก่อน +8

      Yes

  • @colindefant4911
    @colindefant4911 8 หลายเดือนก่อน +149

    This is extremely cool! You’re essentially something called a “permuton”. These have become a hot topic over the last several years, but I haven’t seen anyone look at the “bubble sort permuton”.

    • @LinesThatConnect
      @LinesThatConnect  8 หลายเดือนก่อน +69

      Thank you!!!
      I've been working on this for so long without having any idea what the proper words are, so I've been stumbling through the dark. This gives me a direction to explore in!

  • @tingwu_
    @tingwu_ 8 หลายเดือนก่อน +256

    This problem has been stuck in my head for a long time. You don't know how surprised and excited I was when I saw this video explaining the exact problem appears in the recommendation! Thank you so much for making this video.

    • @jamesking2439
      @jamesking2439 8 หลายเดือนก่อน +2

      Same.

    • @alexanderlake2691
      @alexanderlake2691 8 หลายเดือนก่อน +3

      Same

    • @Redditard
      @Redditard 8 หลายเดือนก่อน

      Sam

    • @JavedAlam-ce4mu
      @JavedAlam-ce4mu 8 หลายเดือนก่อน +1

      Why??? Why would you want to know a formula for the shape of the bubble sort curve?

    • @anderaginaga2
      @anderaginaga2 8 หลายเดือนก่อน +8

      ​@@JavedAlam-ce4muIt isn't that strange to see someone have curiosity for a random topic.

  • @Elesario
    @Elesario 8 หลายเดือนก่อน +112

    I think the intuitive element of why this shape forms will come from the fact in bubble sort all the larger values will tend to drift to the right more rapidly than the smaller values move left. As you say smaller values will only ever move left once per iteration, but any larger values prior to the largest unsorted value will make multiple moves until the next largest value is found.
    From this, because the shape we are perceiving comes from the larger values in any local area, then you'll always get a shape that rapidly climbs to start, and increases more gradually towards it's end.

    • @RobertShippey
      @RobertShippey 19 วันที่ผ่านมา

      Thank you for this

  • @pietersfilms5171
    @pietersfilms5171 8 หลายเดือนก่อน +44

    I love the math videos where its not for academic purposes and is just someone talking about and researching something they love. Just started the video but I know im gonna love it, good job

  • @Spiderfffun
    @Spiderfffun 8 หลายเดือนก่อน +115

    You went this far.. for a sorting algorithim?
    Absolutely insane. It was satisfying as hell watching the curve plotted against sorting.

    • @BaldurNorddahl
      @BaldurNorddahl 8 หลายเดือนก่อน +21

      he went this far for a sorting algorithm that nobody uses... but that fits exactly what I imagine mathematicians doing with their day.

    • @StevenGeibeise
      @StevenGeibeise 2 หลายเดือนก่อน +1

      The pursuit of truth is what makes the journey

  • @Wishbone1977
    @Wishbone1977 7 หลายเดือนก่อน +19

    Fantastic video. You found the solution to a "problem" which is utterly useless and would seem to have no practical applications, purely for the joy of discovery and knowledge. And you explained it in a way that even non-mathematicians (i.e. me) can (mostly) understand. Well done, sir. I salute you 🙂

    • @andrewferguson6901
      @andrewferguson6901 23 วันที่ผ่านมา

      Sigbovik criteria spotted in the wild

  • @FutureAIDev2015
    @FutureAIDev2015 8 หลายเดือนก่อน +91

    That final animation of the curve that you found matching the data so smoothly was...jaw-dropping. 😲

  • @AEastrolabe
    @AEastrolabe 8 หลายเดือนก่อน +46

    I have been asking myself this very question every now and then for years, but never took the time to look at it closely. I am so glad you made this video and that I found it. Loved it

    • @Gordy-io8sb
      @Gordy-io8sb 8 หลายเดือนก่อน

      The "curve" is just an artifact of how sorting algorithms work. There's nothing special about it.

    • @isavenewspapers8890
      @isavenewspapers8890 8 หลายเดือนก่อน +34

      ⁠​⁠@@Gordy-io8sb"The 'curve' is just an artifact of how sorting algorithms work."
      Evidently. Well, for this particular sorting algorithm, at least. Otherwise we wouldn't be talking about it.
      "There's nothing special about it."
      That's your opinion.

    • @pyrobola8715
      @pyrobola8715 8 หลายเดือนก่อน

      ​@@Gordy-io8sbEuler's constant is just an artifact of how exponential growth works. There's nothing special about it.

    • @thesecondderivative8967
      @thesecondderivative8967 8 หลายเดือนก่อน +11

      ​@@Gordy-io8sb I don't understand people who watch maths videos when they want to claim that everything they find is meaningless. It's interesting. That's enough of a reason.

    • @Gordy-io8sb
      @Gordy-io8sb 8 หลายเดือนก่อน

      @@thesecondderivative8967 Are you implying I'm one of those people? Let me tell you, those people are pseudo-intellectuals. I am above them.

  • @BadlyOrganisedGenius
    @BadlyOrganisedGenius 8 หลายเดือนก่อน +25

    Gorgeous. I always wondered what that curve was approximating, but imagined a proper derivation would be far more complicated than this. You're a smart guy, LTC. Keep it up

  • @StellarFireflyGaming-rm2xu
    @StellarFireflyGaming-rm2xu 8 หลายเดือนก่อน +27

    I absolutely love mathematics that are complex enough to be interesting yet simple enough to not require a degree to understand if explained in an engaging and informative way. And your excellent use of graphics and animation to demonstrate concepts that would otherwise be difficult to express verbally, that is just /chefskiss.

  • @epsilonthetalambda
    @epsilonthetalambda 8 หลายเดือนก่อน +36

    16:48 for anyone wanting to graph this in desmos, to turn it into a recreation of the optimised bubble sort:
    - add the equations "y = {0

    • @londonl.5892
      @londonl.5892 8 หลายเดือนก่อน +3

      If you have a link to a public Demos graph of this that would be great!

    • @haipingcao2212_.
      @haipingcao2212_. 8 หลายเดือนก่อน

      t_{n}

    • @DeJay7
      @DeJay7 8 หลายเดือนก่อน +3

      First line: y=\left\{0\le x\le1-t:\frac{x}{x+t}
      ight\}
      Second line: y=\left\{1-t

  • @play005517
    @play005517 8 หลายเดือนก่อน +64

    The assumption part should also address why you are ignoring the dips and only fitting a tarp-like shape. Because the shape is only apparent to a human eye constantly searching for a pattern if you are using bars.
    If you use a scatter plot to represent the same process, the "shape" a human eye are seeing will actually become a string instrument, an American football-shaped part before x, and a straight line pass x.

    • @xxgn
      @xxgn 8 หลายเดือนก่อน +23

      He does explain/define shapes a bit more rigorously in his blog post. His proof, linked in the blog post, formalizes a definition of shapes at the top of page 9 (definition 8).

  • @yurfwendforju
    @yurfwendforju 8 หลายเดือนก่อน +15

    Thank's man. You really made my night. I commit, I couldn't follow everything you said, but seeing the function draw it's graph was absolutely worth my time. Happy that you're back.

  • @coouragee
    @coouragee 8 หลายเดือนก่อน +19

    great video, and really smooth graphics! always interesting to see maths applied to subjects where it isn't necessary

  • @TearonQ
    @TearonQ 8 หลายเดือนก่อน +100

    YOOO lines that connect is back !!

  • @ahumanperson3649
    @ahumanperson3649 8 หลายเดือนก่อน +20

    Been a while! Glad to see you’re back.

  • @MelodiCat753
    @MelodiCat753 8 หลายเดือนก่อน +1

    Subscribed. When the music kicks in at 16:54, I got emotional. You do a good job of hinting that this function is recursively defined in nature, which leads to an explicit formula, similar to how some sequences can be solved.

  • @mitchellclark4377
    @mitchellclark4377 8 หลายเดือนก่อน +2

    All these years I've noticed that curve and wondered if there was a way of fitting it, but I lacked the mathematical fluency to step through the process you did. Nice.

  • @ntwede
    @ntwede 8 หลายเดือนก่อน +4

    Have you ever seen those memes that say "pick two: Fast, Cheap, Good"
    Well, I feel like you identified the equivalent for math proofs. "Pick two: Correct, Intuitive, Rigorous"
    Well, the choice is really which one to exclude. Excluding 'Correct' is not acceptable in math, or really ever, but the video you have provided combined with the long paper proof you worked out have provided all three to those who want it. It is inspiring how well you have found a clever way to explain this without the headache, and how well you have documented it in its most rigorous form in your blog. Thank you. I hope I can one day do work as good as this.

  • @SaidVSMath
    @SaidVSMath 8 หลายเดือนก่อน +5

    Just amazing. Love the “nice” moment. Please keep posting!!! Love your stuff!!!

  • @one_of_wav
    @one_of_wav 5 หลายเดือนก่อน +1

    Every time I watch a video about sorting algorithms, a question crosses my mind. There are so many people who have had the same thought as me, and among them, someone has delved deeply into the mathematics and created a video. TH-cam has accurately recommended exactly what I wanted. This is what makes math interesting.

  • @seanthebluesheep
    @seanthebluesheep 7 หลายเดือนก่อน +2

    Videos of people much smarter than me explaining solutions to problems I barely understand, well enough that by the end I think I can pretend I know what they've just said is my favourite genre of TH-cam video

  • @NobleBrains
    @NobleBrains 8 หลายเดือนก่อน +1

    Your videos are some of few where you can watch them an unlimited amount of time and still learn something new every time. Keep up the great work.

  • @cornonjacob
    @cornonjacob 6 หลายเดือนก่อน +2

    Explaining the shape is fairly straightforward with basically just: tall stuff moves back faster than short stuff moves forward. Short stuff starting in the middle/back takes a while to move forward, so average height there takes a while to drop, so the curve stays flatter while the front gets steep. However, that doesn't give the actual function at all, and I loved the whole explanation, verbal and visual, for how to reach the function

  • @adsoyad2607
    @adsoyad2607 8 หลายเดือนก่อน +2

    Really interesting concept to explore, the a-ha moment at 14:23 really did it for me. Awesome stuff!

  • @gONSOTE
    @gONSOTE 8 หลายเดือนก่อน +3

    this is just absolutely crazy. Every time you upload a video you keep surprising me with your everlasting increase in quality.
    The animations were incredibly smooth, at every single frame i had all the information i needed, no more, no less, and distributed THE best way possible.
    An incredible aesthetic, beautiful colors and design supporting an explanation that was precise and great.
    Please keep uploading videos of such quality, you are one the best math youtubers that have ever existed, no doubts at all.

  • @masterleon40
    @masterleon40 8 หลายเดือนก่อน +6

    I missed your videos, glad to see you again my guy

  • @karlwaugh30
    @karlwaugh30 7 หลายเดือนก่อน +2

    What I like about this is it's an almost frivolous question but then the answer is kinda down to "the internal symmetrys of the algorithm give rise to these shapes" which is kinda a deep thing

  • @yahyabenabdelkrim2131
    @yahyabenabdelkrim2131 6 หลายเดือนก่อน +1

    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

  • @MrMan-np9jg
    @MrMan-np9jg 6 หลายเดือนก่อน +4

    Bubble sort curve immediately makes sense
    It goes through the next if its short, and moves the next if its taller
    Bubble sort always starts at the beginning, so naturally it will form a curve of progressively taller one

    • @MrMan-np9jg
      @MrMan-np9jg 6 หลายเดือนก่อน +1

      Idk why youd want to know the math behind it. If you understand it and can make it, then thats all that matters

    • @LineOfThy
      @LineOfThy หลายเดือนก่อน

      @@MrMan-np9jg cuz math cool

  • @TheRecklessGamer3169
    @TheRecklessGamer3169 8 หลายเดือนก่อน +21

    You should do a whole video on the Euler-Mascheroni constant, would be really interesting in your style

    • @chaotickreg7024
      @chaotickreg7024 8 หลายเดือนก่อน +8

      Who would eat oiler maccaroni?

    • @PluetoeInc.
      @PluetoeInc. 8 หลายเดือนก่อน

      @@chaotickreg7024 oiled up mammamia

  • @DynestiGTI
    @DynestiGTI 8 หลายเดือนก่อน +2

    16:49 gave me goosebumps, seeing the curve match perfectly, combined with the beautiful piano piece, and just now knowing you made that song too… you are incredibly talented!

  • @NikUnknownGames
    @NikUnknownGames 8 หลายเดือนก่อน +2

    I just wanted to say that this is amazing. You provided not only an excellent video for TH-cam, but an entire paper with a mathematical proof for anyone interested in the topic. This is what educational TH-cam videos should be. Great work and please keep going, this is how popularizing math and computer science should look like! Also, the whole premise of this topic is so simple, yet so non-trivial to think about. I'm almost angry that I didn't think about this problem myself :)

  • @thekingoffidget52
    @thekingoffidget52 หลายเดือนก่อน +4

    4:57 reminds me of a show about sentient cubes that are counting and saying “diddly diddly doo”

    • @BlocPanda
      @BlocPanda วันที่ผ่านมา +1

      Numberblocks!! :D

    • @thekingoffidget52
      @thekingoffidget52 21 ชั่วโมงที่ผ่านมา

      @ yes!! :D

  • @boonyakornthanpanit7656
    @boonyakornthanpanit7656 8 หลายเดือนก่อน +1

    This is absolutely beautiful. For many math videos out there, I could guess where it’s heading just from the thumbnail/title. This one stunned me. I guessed that this might need some differential equations or some sort of series and end up with something like natural log. Turns out just a few weeks of Calculus 1 would do. Gorgeous!
    Edit: I usually don’t give a like to videos, but you deserved it.

  • @immoloiser6134
    @immoloiser6134 19 วันที่ผ่านมา

    I really like these videos :)
    I feel like your pacing and detail is pretty much perfect for me (as I think the equivalent of an American senior in high school that does maths) to follow so that I understand the steps you’re doing and don’t get lost.

  • @gamerpotato6667
    @gamerpotato6667 5 หลายเดือนก่อน +1

    I read some pages of the full proof in your description,
    and I think it is genius!
    using 3d pespective and shearing the Diagram is an unexpeted but elegant way to proof it.
    very satisfying work!

  • @DepressedGraduate
    @DepressedGraduate 8 หลายเดือนก่อน +1

    I literally just checked your channel last week for any new videos and thought "what a shame, looks like there's no more coming", and then you drop a new vid, let's go!

  • @Benseer
    @Benseer 7 หลายเดือนก่อน

    This is really good content. It reminds me of my favourite maths youtubers, complete with calm voiceover and helpful and captivating graphics. This really is 10/10 content. Keep up the good work!

  • @rivran
    @rivran 8 หลายเดือนก่อน

    This style is fantastic. I’m a community college dropout and I understood this entire video while stoned out of my body. Absolutely impressive work!!

  • @youtubeviewerxx
    @youtubeviewerxx 8 หลายเดือนก่อน

    THANK YOU! I have been thinking about this since one of the first times I watched a sorting algorithms video and, as you said, there isn't much information on the internet about this specific problem. This was so cool to watch, you're also a great storyteller.

  • @pattoner8398
    @pattoner8398 8 หลายเดือนก่อน +1

    Wonderful! Informative! Well presented, written, and recorded! Please continue doing this, keep up the excellent work

  • @davidstigant457
    @davidstigant457 8 หลายเดือนก่อน +1

    I’ve been wondering about this exact question for years. Thank you so much!

  • @josephmazor725
    @josephmazor725 หลายเดือนก่อน

    Perfect video to watch right before bed answering a question I’ve thought about and never bothered to answer myself

  • @oriyadid
    @oriyadid 8 หลายเดือนก่อน +4

    Never thought about this before, but the moment I saw the thumbnail I was intrigued!

  • @mathITA
    @mathITA 8 หลายเดือนก่อน

    This was gorgeous! Initially, I didn't know how you would have tackled the problem. As soon you brought out the similarity condition I had an enlightenment. Beautiful problem, beautiful solution, splendid explanation!

  • @avunz125
    @avunz125 8 หลายเดือนก่อน +1

    Amazing display of creativity. Congrats and thank you!

  • @Oscar-vs5yw
    @Oscar-vs5yw 8 หลายเดือนก่อน +2

    This was genuinely beautiful

  • @archerelms
    @archerelms 8 หลายเดือนก่อน

    This is the kind of content I love most, even if I don't end up watching them most. Excellent job!

  • @0xTJ
    @0xTJ 7 หลายเดือนก่อน

    I'm happy that I ended up watching one of your other videos, and then subscribed. I had previously seen this video recommended to me over and over, but thought it was one of those viral sorting algorithm videos and didn't watch it. I'm happy that I was wrong, this video is very interesting and well done!

  • @ktursts4088
    @ktursts4088 8 หลายเดือนก่อน

    this s the most satisfying thing i watched in recent days..... we need more videos from you.... amazing stuff.... i have become big fan of your work....

  • @Alex-jk2qy
    @Alex-jk2qy 8 หลายเดือนก่อน

    Finally, I thought for a second that no more videos would accur and yet, boom, here you are! Great to see you back!

  • @Normal_user61
    @Normal_user61 8 หลายเดือนก่อน +1

    One little addition to the graph: you picked the scale 1x1 so everything outside 0

  • @AvenDonn
    @AvenDonn 8 หลายเดือนก่อน +1

    The line fitting was essentially the climax of this video after all the edging, while the algebraic dance was the final most intense act

  • @BikeArea
    @BikeArea 8 หลายเดือนก่อน +1

    To say this content is as wonderfully illustrated and animated as the content of this one blue, three brown guy (or whatever his nickname is) wouldn't be an exaggeration. The presentation is nothing short of excellently executed and gives a masterclass in teaching. What a joy to join in and getting educated! Thanks a lot for all the enormous effort and time you put into this marvellous piece of edutainment! 😊

  • @snowfloofcathug
    @snowfloofcathug 5 หลายเดือนก่อน

    This keeps being recommended to me despite having already watched it multiple times, and yet I keep clicking it because it’s just that good a video

  • @vladyslavverteletskyi2677
    @vladyslavverteletskyi2677 8 หลายเดือนก่อน

    Incredible video! I first imagined that some stochastic techniques would be needed, but your parametric approach was simple, comprehensive, and beautiful at once.
    To generalize the result to non-uniform elements in the array, you can just say that you work with their quantiles.

  • @DrTorkal
    @DrTorkal 8 หลายเดือนก่อน

    What a great question to ask! I could've watched a dozen more examples of the curve perfectly matching a real sorting like 16:54

  • @quintinclaassen8861
    @quintinclaassen8861 8 หลายเดือนก่อน

    My favourite part about this video is not the bubble sort curve solution, but how harmoniously it illustrates that the *real* intellectual leap is figuring out how to formulate a problem into something one can hold on to and tackle in bits.

  • @dunnydunn500
    @dunnydunn500 2 หลายเดือนก่อน +4

    1:49 The speed of Merge sort actualy scared me

  • @fn9869
    @fn9869 7 หลายเดือนก่อน +1

    ive been thinking of investigating this myself! im so happy to see this video

  • @filmcase1683
    @filmcase1683 6 หลายเดือนก่อน

    Questions like these are why I decided to pursue a degree in mathematics. To be able to finally answer those little nagging questions that occur when looking at something the average person considers mundane. Amazing video! Time to re-watch the other 3!

  • @alexmcd378
    @alexmcd378 17 วันที่ผ่านมา

    I hope you make more videos. You made the topic interesting and understandable ❤

  • @DynestiGTI
    @DynestiGTI 8 หลายเดือนก่อน

    One of the most beautiful videos I’ve watched in a while, this is why I love maths.

  • @Dojan5
    @Dojan5 8 หลายเดือนก่อน +3

    Whoa. I’m not a maths person but what little I got was beautiful. I feel like I understand why people enjoy maths a bit better.

  • @라이라이-u9t
    @라이라이-u9t 3 หลายเดือนก่อน

    I knew you first with this video, thought you were a coding guy. You were an awesome math guy. Very impressed!

  • @AleeCarretero
    @AleeCarretero 3 หลายเดือนก่อน +1

    "This wouldn't leave me at peace, so to clear it up... I wrote a scientific article!". Well done, @LinesThatConnect... Well done...

  • @cameodamaneo
    @cameodamaneo 8 หลายเดือนก่อน

    Wow! This video is less than a day old and has less than 50k views? It seems like the kind of video I'd watch from some giant maths channel that came out several years ago and has amassed millions of views. This has instantly earned my sub

  • @mikebernard8535
    @mikebernard8535 6 หลายเดือนก่อน

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

  • @natsuzkan
    @natsuzkan 8 หลายเดือนก่อน

    I think I could watch hours of bubble sorts with the curve overlaid. That was so good.

  • @mafuchin
    @mafuchin 8 หลายเดือนก่อน

    Nice video. The derivation of the closed form was well established and you answered all key question I'd worry about.

  • @cheshire1
    @cheshire1 8 หลายเดือนก่อน +5

    I took the challenge to find the curve myself, and my central idea was this:
    For the bar height Y to end up at position X after T iterations, there need to have been exactly T bars before position X that were higher than Y.
    For ease of notation, let's instead talk about the normalized values x = X/N, y = Y/N and t = T/N, where N is the size of the array. The factors N would cancel out in the end anyway.
    The likelihood of there being exactly k bars higher than y before position x is given by a binomial distribution:
    P(k) = (1-y)^k * y^(x-k) * (x choose k). For larger N, this distribution contracts around its expected value until in the limit N -> infinity, all the probability mass is _at_ the expected value and we are certain that the condition is fulfilled at step t = (1-y) * x.
    This doesn't quite define the right curve yet, because the original condition neglected that the bars are moved one spot to the left when an iteration passes them. After t iterations, values are shifted a distance t to the left. We represent this by replacing x with (x+t) in the formula:
    t = (1-y) * (x+t)
    t = x + t - y * (x+t)
    y * (x+t) = x
    y = x / (x+t)
    There we go. If we want to include the already sorted bit, we can write y = max( x / (x+t), x ).

    • @LinesThatConnect
      @LinesThatConnect  8 หลายเดือนก่อน +1

      Bravo, I'm jealous of how quickly you came up with that! That's the gist of my rigorous approach, but it took me a crazy long time to think of it.

  • @monsterhunter8595
    @monsterhunter8595 8 หลายเดือนก่อน

    You're one of the clearest math youtubers out here!

  • @ruferd
    @ruferd 8 หลายเดือนก่อน +17

    I used to suggest 3b1b for math videos to all my math students, but now I suggest LTC, it's just pure magic to be honest.

    • @AlphaFX-kv4ud
      @AlphaFX-kv4ud 8 หลายเดือนก่อน +3

      Why not both?

  • @joltedjon
    @joltedjon 8 หลายเดือนก่อน

    After all the work to see the curve fit so well... perfection

  • @ausaramun
    @ausaramun 8 หลายเดือนก่อน +1

    Man I have been eagerly waiting on you. Glad to see you back :D

  • @hollisterlasers-ion8939
    @hollisterlasers-ion8939 2 หลายเดือนก่อน

    That was gorgeous, thank you for making this video!

  • @yobniares
    @yobniares 6 หลายเดือนก่อน

    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

  • @houmamkitet9555
    @houmamkitet9555 6 หลายเดือนก่อน

    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

  • @XxLeonardoPiresxX
    @XxLeonardoPiresxX 8 หลายเดือนก่อน

    One of the best videos about math an programing i have ever seem!

  • @bscutajar
    @bscutajar 8 หลายเดือนก่อน

    this is such an interesting application of functional equations, I love how we start with the conditions the functions must satisfy and somehow narrowing it down to one possible solution

  • @NekosForever
    @NekosForever 8 หลายเดือนก่อน +2

    Holy hell you’re back!

  • @pedroth3
    @pedroth3 8 หลายเดือนก่อน +1

    Amazing! Always like to find the limits of discrete processes. Thank you

  • @richtigmann1
    @richtigmann1 8 หลายเดือนก่อน

    This was honestly beautiful, an incredible example of the mathematical analysis that happens in computer science

  • @maxwellgrossman
    @maxwellgrossman 8 หลายเดือนก่อน +6

    I love your videos, so glad to see you're back!

  • @FalconX88
    @FalconX88 8 วันที่ผ่านมา

    In the first description of how it works with the visualization of 10 items you can already see how that curve forms. Pretty cool

  • @kman41822
    @kman41822 6 หลายเดือนก่อน

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

  • @smithrockford-dv1nb
    @smithrockford-dv1nb 8 หลายเดือนก่อน

    Wow, this videos has such high production quality!

  • @DavidLindes
    @DavidLindes 8 หลายเดือนก่อน

    Very nice exploration and explanation! Will now immediately check out your prior vids, and, very likely, subscribe. Good stuff!