Slow sorting: Stooge sort and Bogo sort

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 พ.ย. 2024

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

  • @davineves8529
    @davineves8529 4 ปีที่แล้ว +5072

    Poor bubble sort, lost all rounds for being the slowest one, and when he is faster, rules change so he loses, the universe is truly unjust.

    • @ChillstoneBlakeBlast
      @ChillstoneBlakeBlast 4 ปีที่แล้ว +289

      Bubble Sort is sort of a meme in programming field. Is is barebone and not good for almost anything.

    • @kikololoi14
      @kikololoi14 4 ปีที่แล้ว +248

      Bubble sort is one of the easiest to code tho so it has that going for it

    • @TheDubbingLtdOrNotSamin
      @TheDubbingLtdOrNotSamin 4 ปีที่แล้ว +93

      Justice for bubble sort ✊✊✊📊

    • @TheAmericanFox
      @TheAmericanFox 3 ปีที่แล้ว +21

      @@rishiishere. so is insertion sort

    • @wheat2849
      @wheat2849 3 ปีที่แล้ว +45

      Bubble sort needs a hug

  • @carykh
    @carykh 4 ปีที่แล้ว +3465

    poor bogosort. I know that feeling of being the last person in class to be working on a test, and the teacher waiting solely on you, and the other students just want to go home for the day, and... ugh... bogosort if you need support im here man

    • @shroomy__rxcks
      @shroomy__rxcks 4 ปีที่แล้ว +55

      i didn't expect to see you here-

    • @alexkatakuna2615
      @alexkatakuna2615 4 ปีที่แล้ว +59

      okay bogosort kinnie

    • @Stephen14414
      @Stephen14414 4 ปีที่แล้ว +15

      Hello Cary

    • @noticeme6412
      @noticeme6412 4 ปีที่แล้ว +15

      my favorite 2D animator, love your content

    • @mariafe7050
      @mariafe7050 3 ปีที่แล้ว +13

      Bogo lives matter!

  • @huhneat1076
    @huhneat1076 2 ปีที่แล้ว +1277

    I love how there's casually a 30-minute interlude of Bogo and then the video resumes with content like nothing happened

    • @sisebutomenguivalez
      @sisebutomenguivalez ปีที่แล้ว +94

      Just like that video of howtobasic where he cooks a turkey with no cuts

    • @NguyenTrungHieu536
      @NguyenTrungHieu536 ปีที่แล้ว +2

      Lol

    • @consoot
      @consoot ปีที่แล้ว +35

      Bogo sort is actually a gigachad since it always have a chance to one-shot any lists, regardless of the length.

    • @brandonm1708
      @brandonm1708 7 หลายเดือนก่อน +15

      @@consootit’s got a minimum efficiency of O(1) and a maximum of O(infinity). Truly the best sorting algorithm I’ve ever seen

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

      ​@@brandonm1708 technically every sorting algorithm has a min efficiency of O(1) tho

  • @SKyrim190
    @SKyrim190 3 ปีที่แล้ว +567

    I like to think about stooge sort as a bubble sort that suffers from anxiety and is obsessed with the fear that the part of the list he already sorted is shuffled when he is not looking, so he is always double, triple or quadruple checking

    • @deleetiusproductions3497
      @deleetiusproductions3497 ปีที่แล้ว +28

      That’s quite a reasonable assessment. As the sort deals with larger and larger arrays, the vast majority of comparisons done become entirely redundant because it had already sorted that area and hasn’t touched it since.

  • @embeddedbastler6406
    @embeddedbastler6406 4 ปีที่แล้ว +12633

    If there are infinite universes, then there is a universe where Bogosort is right every single time and nobody knows why.

    • @rebca_
      @rebca_ 4 ปีที่แล้ว +1740

      God sort.

    • @hecko-yes
      @hecko-yes 4 ปีที่แล้ว +2689

      someone came up with quantum bogosort, which exploits that fact by destroying all the universes in which it's wrong

    • @ferdinandkraft857
      @ferdinandkraft857 4 ปีที่แล้ว +230

      You made my day.

    • @jontedeakin1986
      @jontedeakin1986 4 ปีที่แล้ว +1242

      There is also a universe where bogo sort gets everything right all the time until it is used mid flight on a plane

    • @WillToWinvlog
      @WillToWinvlog 4 ปีที่แล้ว +235

      There could also be infinite universes without any of them having that particular quality, though.

  • @asailijhijr
    @asailijhijr 2 ปีที่แล้ว +469

    I like how the bogo sort robot doesn't randomize the list himself, but has a machine to do it for him.

    • @drinks_mayo
      @drinks_mayo ปีที่แล้ว +68

      I think the animators would die before finishing this if bogo did that

    • @nodezsh
      @nodezsh ปีที่แล้ว +13

      ​@@drinks_mayoAnimating it is probably the easy part. There gets a point in a CGI animation crew's life where they can't hand craft the animation anymore and have to write some custom animation software code that can do the incredibly detailed stuff, so the animators can take care of the bigger picture instead.
      This could have four or five sets of animations that could be chained and dynamically switched between. Then some code would actually calculate a sort and record every step, and the animation software would copy that recorded scenario. The animators would make the code look pretty, but the code would piece everything together.
      It would take little time to animate 1000 balls.
      They could make the rendering last until the end of the universe if they wanted to. And they wouldn't have to give any input for more than the first 30 seconds of the animation, and then the last 30 seconds of the animation.
      Also, there is no way you could pay anyone to animate this video. They probably did code something that would chain these animations together, regardless of the ball shuffle animation.

    • @realcrazj1399
      @realcrazj1399 ปีที่แล้ว +2

      the robot's robot uprising

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

      bogosort w randomizing oracle

  • @KevinSiebert
    @KevinSiebert 4 ปีที่แล้ว +2862

    Ok that's why it's 40 minutes, we're waiting on bogo to finish

    • @pvic6959
      @pvic6959 4 ปีที่แล้ว +240

      ive seen other sorting videos and they never let bogo sort finish lol

    • @ouch9841
      @ouch9841 4 ปีที่แล้ว +34

      33 Minutes and 6 seconds accutally...

    • @ChadwickMann
      @ChadwickMann 4 ปีที่แล้ว +71

      I thought this was a joke at first...

    • @NStripleseven
      @NStripleseven 4 ปีที่แล้ว +58

      I actually find it somewhat weird to see a random scramble eventually sort a list.

    • @toddkes5890
      @toddkes5890 4 ปีที่แล้ว +39

      Imagine someone reporting this to TH-cam for restricted content, so the human moderator has to watch the whole thing

  • @subzeroelectronics3022
    @subzeroelectronics3022 3 ปีที่แล้ว +363

    I love how bogo sort occasionally looks at the camera after pushing the button like, “is it gonna work this time?”

  • @Huntracony
    @Huntracony 4 ปีที่แล้ว +5625

    Sure, Bogo sort is by far the slowest sorting algorithm on average, but if it gets lucky, it's the fastest possible sorting system around!

    • @MitruMesre
      @MitruMesre 4 ปีที่แล้ว +1145

      Quantum bogosort:
      Start with an unsorted array.
      Shuffle the elements randomly
      If it's solved, print the array.
      If it's unsolved, destroy the universe.
      All remaining universes will have had an instant sorting.

    • @ChillstoneBlakeBlast
      @ChillstoneBlakeBlast 4 ปีที่แล้ว +163

      Bogo Sort: Drawing all Exodia Pieces

    • @derekliu793
      @derekliu793 4 ปีที่แล้ว +142

      clearly you've never heard of bogobogo sort, a worse version of bogo sort (somehow), or worst sort, a worse version of bad sort (recursive).

    • @ChillstoneBlakeBlast
      @ChillstoneBlakeBlast 4 ปีที่แล้ว +92

      @@derekliu793 Isn't that the one which Randomizes like Bogo sort but instead of randomizing the whole thing, it randomizes one item at a time, and once the item is correct, it randomizes 2 items all until it reaches a point in randomizes items at a time?

    • @GRBtutorials
      @GRBtutorials 4 ปีที่แล้ว +142

      Slowest? You haven’t seen mine: check if it’s sorted, repeat. Eventually data will be sorted by random quantum fluctuations!

  • @sharpesttoolintheshed492
    @sharpesttoolintheshed492 4 ปีที่แล้ว +359

    Stooge sort be like:
    "okay this is done, next one"
    "hmm, done"
    "wait lemme make sure its done"
    "seems done"
    "hold on is everything done"
    "looks like it"
    "ok next one"
    "hmm done"

    • @sedmirnel7764
      @sedmirnel7764 2 ปีที่แล้ว +28

      It's the most human sorting algorithm xd

    • @proxy7598
      @proxy7598 2 ปีที่แล้ว +36

      Meanwhile bogosort is
      "Hmmm I'll gamble"
      "It's not perfect"
      "Gamble again!"

    • @drinks_mayo
      @drinks_mayo ปีที่แล้ว

      Who will right Shakespeare's hamlet first? One human with really bad ocd double checking everything or a monkey on typewriter that restarts after every mistake

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

      ​@@proxy7598 99% of all sorting algorithms stop before it's all sorted.

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

      @@proxy7598Let’s Go Gambling!
      *shuffle*
      *not sorted* Aw Dang It!

  • @mattjw16
    @mattjw16 4 ปีที่แล้ว +886

    I kind of feel bad for the Stooge Sort robot who just has to stand there for a half of an hour and wait patiently for Bogo Sort to finish sorting.

    • @idontwantanamethx
      @idontwantanamethx 4 ปีที่แล้ว +98

      And he still loses. That's insult to injury.

    • @progect3548
      @progect3548 4 ปีที่แล้ว +11

      @@idontwantanamethx its a battle of which is slower.
      **whoooosh shield activated**

    • @idontwantanamethx
      @idontwantanamethx 4 ปีที่แล้ว +29

      @@progect3548 Yeah. And?

    • @davidkonevky7372
      @davidkonevky7372 4 ปีที่แล้ว +27

      @@progect3548 he still doesn't deserve to go through all this crap

    • @posthistoricdino422
      @posthistoricdino422 4 ปีที่แล้ว +16

      I feel bad for the bogo bot. It's using bogo sort.

  • @IgnisWings
    @IgnisWings 4 ปีที่แล้ว +715

    *Sorting robot gambles for 30 minutes straight as his companion helplessly watches (ASMR)*

    • @Waterwolf221
      @Waterwolf221 3 ปีที่แล้ว +46

      Its unironically pleasant to listen to the balls shuffling

    • @jivejunior8753
      @jivejunior8753 3 ปีที่แล้ว +9

      Good title. I'd watch that as an ASMR video

    • @Ihaveagasmask
      @Ihaveagasmask 2 ปีที่แล้ว +8

      @@Waterwolf221 🤨📸

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

      jesus christ 😂😂😂

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

      ​​@@Ihaveagasmask🔵 🔴 🟡 🟢 🟣 🟠 sort them

  • @lagcom
    @lagcom 4 ปีที่แล้ว +1673

    However the difference between stooge and bogo is that if they are both fed with an already-sorted list, stooge will still waste your time, but not bogo

    • @myssangela4872
      @myssangela4872 4 ปีที่แล้ว +462

      Bogo: My job here is done
      Me: But you didn't do anything
      Bogo: *dramatic cape twist *

    • @AriTheMothQueen
      @AriTheMothQueen 4 ปีที่แล้ว +215

      @@myssangela4872 that reminds me of
      Bogo: i have connected the two dots
      All the other algorythms: you didnt connect shit
      Bogo: i have connected them

    • @aa01blue38
      @aa01blue38 2 ปีที่แล้ว +118

      Bogosort also destroys any other program in terms of memory usage efficiency.

    • @jetison333
      @jetison333 2 ปีที่แล้ว +11

      @@aa01blue38 surely bubble sort or similar would be better? Or at least the same.

    • @zezus001
      @zezus001 2 ปีที่แล้ว +12

      But that could be said for almost any other algorithm, like Quicksort, bubble sort, merge sort, heap sort, insertion sort, radix sort...

  • @hydroxa4330
    @hydroxa4330 4 ปีที่แล้ว +156

    As much of a silly joke Bogo sort is, I feel like there still is something you can learn from it and other terribly slow algorithms. By learning about how they operate, you can see their design and thus avoid similar mistakes, such as unnecessary looping or relying on a mechanism that isn't reliable. I've seen such mistakes a lot, and it can greatly impact the performance of code, as demonstrated here (In extremes, but still), so taking note of what joke algorithms do that make them a joke can help you not do those things when you're trying to make serious code

    • @airmanon7213
      @airmanon7213 ปีที่แล้ว +7

      Very good point there! Your comment should have more likes in my opinion!

  • @organicpumpkin2147
    @organicpumpkin2147 4 ปีที่แล้ว +3428

    The funniest part is that bogo sort, unlike other sorts, it has a time range of *0* to *Infinity*

    • @Gh0sdeeri
      @Gh0sdeeri 4 ปีที่แล้ว +275

      That both is really interesting but also absolutely ridiculous. I mean on one hand it'd make sense considering how bogo sort works, but on the other hand the fact its time range is from 0 to infinity is bewildering.

    • @paper2222
      @paper2222 4 ปีที่แล้ว +93

      nah, it's probably like 6⁶
      edit idk what i was smoking don't reply to me pls

    • @minetech4898
      @minetech4898 4 ปีที่แล้ว +221

      @@paper2222 it's actually best case O(1), average case O(n!), and worst case O(infinity)

    • @imadhamaidi
      @imadhamaidi 4 ปีที่แล้ว +196

      @@minetech4898 false. it still has to check if the pairs are sorted even if it is given an all sorted pair. so the best case is O(n-1).

    • @minetech4898
      @minetech4898 4 ปีที่แล้ว +86

      @@imadhamaidithat's true, I never actually considered the isSorted to be part of the algorithm for some reason.

  • @Blargel
    @Blargel 2 ปีที่แล้ว +59

    I like how the stooge sort bot is just looking around mindlessly while waiting for bogo sort to finish, but it's been established already that they have incredibly poor eyesight so he's not really seeing anything.

  • @malkistdev
    @malkistdev 4 ปีที่แล้ว +3572

    the only reason the channel's hiatus took so long is because they had to animate bogo sort lol

    • @kajwbidonajdowlem5013
      @kajwbidonajdowlem5013 4 ปีที่แล้ว +163

      i feel bad for the guy who had to animate all that honestly

    • @fleshchild
      @fleshchild 4 ปีที่แล้ว +331

      I'm sure that the animation is automated in some way

    • @erikbullon5511
      @erikbullon5511 4 ปีที่แล้ว +10

      XD

    • @kajwbidonajdowlem5013
      @kajwbidonajdowlem5013 4 ปีที่แล้ว +53

      @@fleshchild shush

    • @tripphenderson8499
      @tripphenderson8499 3 ปีที่แล้ว +50

      @@kajwbidonajdowlem5013 it is quite literally a video about *automated* sorting

  • @debblez
    @debblez 3 ปีที่แล้ว +287

    Notes:
    The expected number of comparisons that this bogo sort will make to sort 10 balls is 12,829,490,
    Adding one more ball brings this number all the way to 152,369,679 !
    Also:
    The robot in this video got lucky, as on average six balls will take bogo sort 1734 comparisons!

    • @ME0WMERE
      @ME0WMERE 2 ปีที่แล้ว +16

      and 720 trials

    • @debblez
      @debblez 2 ปีที่แล้ว +6

      @debblez
      who asked

    • @debblez
      @debblez 2 ปีที่แล้ว

      @debblez
      for ten it will take on average 6,235,300 comparisons
      for eleven 68,588,311
      you werent even close you absolute buffoon

    • @hecko-yes
      @hecko-yes 2 ปีที่แล้ว +31

      ​@@debblez i asked

    • @debblez
      @debblez 2 ปีที่แล้ว +13

      @@hecko-yes aw thanks

  • @davistoa
    @davistoa 4 ปีที่แล้ว +4318

    This might be the first time I've seen a bogo sort actually succeed.

    • @FoxDren
      @FoxDren 4 ปีที่แล้ว +436

      Statistically BOGO sort is guaranteed to succeed eventually

    • @englishmotherfucker1058
      @englishmotherfucker1058 4 ปีที่แล้ว +209

      @@FoxDren given a large enough list (not too long, just a phone book or something) then it could, maybe, succed.
      not in my lifetime tho

    • @TheNaturalnuke
      @TheNaturalnuke 4 ปีที่แล้ว +141

      Technically speaking, BOGO sort has the smallest possible sort number.
      ... and the highest, whoo! rAnDOm¡

    • @uwakii2967
      @uwakii2967 4 ปีที่แล้ว +2

      Yea, the first and last time lmao

    • @magnusrx
      @magnusrx 4 ปีที่แล้ว +8

      Worst Case Scenario: If there are n items, then there will be n! (n factorial=1x2x3x4x...x(n-1)x n)
      permutations until he finds the correct one! If there are 170 items, then he will have more than 1.80x10^308 permutations

  • @AexisRai
    @AexisRai 3 ปีที่แล้ว +418

    36:51
    Bogo actually looks at every ball here. I think it would be sufficient to swap just the last two, maybe three.
    But no. Bogo must bogo on.

    • @airmanon7213
      @airmanon7213 3 ปีที่แล้ว +34

      Sounds like an optimization, but I don't think it will make much of a difference on average.

    • @Mitilda77
      @Mitilda77 2 ปีที่แล้ว +28

      @@airmanon7213 the 33th comparison was basically the 577th comparison.

    • @airmanon7213
      @airmanon7213 ปีที่แล้ว +5

      @vacuum sealed garfield Looking back 6 months later, I see your point makes sense.

    • @Underpantswher
      @Underpantswher ปีที่แล้ว +3

      also happens at 7:27

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

      @@Mitilda77Thirty-thith?

  • @loopiloop
    @loopiloop 4 ปีที่แล้ว +2636

    POV: you are the stooge sort robot and want to go home.

  • @SirBroadsword
    @SirBroadsword 3 ปีที่แล้ว +94

    I know you were skeptical about doing a video on Bogosort back when, but the visualization you came up with for it is honestly amazing, and the fact that you went to the trouble to animate over 30 minutes of footage of just Bogosort shuffling the sequence over and over again is doubly amazing. Perhaps you just feel like you caved to what the mob wanted, but honestly? I say bloody good show and if you ever did another one it could be literally anything and you'd have absolutely nothing to prove.
    Also, fun fact - the probability of randomly getting a six-object sequence in its correct order at least once after randomizing the sequence 345 times is only around 38%. So for those who joke that Bogo is the fastest sort if it gets lucky, consider that what you see in this video is actually _pretty good_ by Bogosort standards. You need around 3,315 trials before you have a greater than 99% chance of the sorted sequence appearing at least once.

  • @somekek6734
    @somekek6734 4 ปีที่แล้ว +1783

    30 minutes of Bogo Sort to study/relax to.

    • @thiendu250
      @thiendu250 4 ปีที่แล้ว +8

      OK I wanna make a video

    • @thiendu250
      @thiendu250 4 ปีที่แล้ว +8

      Make more list: sleep, shower

    • @Manny73211
      @Manny73211 ปีที่แล้ว +2

      honestly this 30 minute section is more fun (and uses way less stackoverflow questions) than actually coding up a better sorting animation.

    • @goatbeef
      @goatbeef ปีที่แล้ว +1

      I mean hey I fell asleep to this

    • @daryantsns3448
      @daryantsns3448 ปีที่แล้ว

      @@antirogue825 He’s just standing there… MENACINGLY!

  • @Romanticoutlaw
    @Romanticoutlaw 2 ปีที่แล้ว +42

    I'm loving the way stooge sort just looks around, politely trying not to stare at bogo sort as the minutes crawl by

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

      I'd love it if stooge sort randomly started re-examining the sort it did. Considering how the algorithm works and all

  • @Iam1Person
    @Iam1Person 4 ปีที่แล้ว +2086

    My goodness. You actually rendered half an hour of Bogo Sort.

    • @huyphamuc6372
      @huyphamuc6372 4 ปีที่แล้ว +125

      I can smell the smoke that come out from udiprod's pc

    • @GeorgeCowsert
      @GeorgeCowsert 4 ปีที่แล้ว +179

      I hope they used something to automate the animation because I'm willing to bet at least 5 animators shot themselves before they even managed to convince someone to animate it.

    • @Muhammad-sx7wr
      @Muhammad-sx7wr 4 ปีที่แล้ว +22

      @@GeorgeCowsert
      Or maybe it was made to look completely random but in fact it wasn't.

    • @moonsun1473
      @moonsun1473 3 ปีที่แล้ว +14

      @@Muhammad-sx7wr if you have seen all the video then you would have seen something that proves it was in the middle.

    • @primekrunkergamer188
      @primekrunkergamer188 3 ปีที่แล้ว +21

      @@GeorgeCowsert It was definetly automated

  • @AriTheMothQueen
    @AriTheMothQueen 4 ปีที่แล้ว +106

    Bogo when all the colors look right but then the last ball is darker than the rest: **UNIMAGINABLE ROBOTIC RAGE**

  • @Mindofthebrick
    @Mindofthebrick 4 ปีที่แล้ว +1898

    The only youtuber who's animations look like they were made today, and at the same time in 2003

  • @maximonkey1
    @maximonkey1 4 ปีที่แล้ว +93

    Speedrunners : My RNG is not that good.
    *gets the right pair first try as bogo sort robot*

  • @quiggsy8571
    @quiggsy8571 4 ปีที่แล้ว +607

    Even when bubble sort wins, it loses

    • @JetFalcon710
      @JetFalcon710 4 ปีที่แล้ว +50

      It's won, but at what cost?

    • @asdasf8817
      @asdasf8817 2 ปีที่แล้ว +10

      task failed successfully

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

      567th like

  • @animewaifulover1337
    @animewaifulover1337 2 ปีที่แล้ว +43

    Bogosort was my first introduction to why time complexity really matters. With a small number of elements, it doesn't matter if you use bubble sort or quick sort or whatever, but you try a bogosort on just 15 elements and you might as well just sort them yourself lol.

  • @pedrogomes5796
    @pedrogomes5796 4 ปีที่แล้ว +692

    Bogo sort should do a little "eww" emote everytime he sees an unsorted pair

    • @archerdude11
      @archerdude11 4 ปีที่แล้ว +93

      (Shuffle shuffle shuffle) eww...
      (Shuffle shuffle shuffle) eww...
      (Shuffle shuffle shuffle) eww...
      (Half an hour later)
      (Shuffle shuffle shuffle) yay I did it!

    • @mariafe7050
      @mariafe7050 4 ปีที่แล้ว +24

      eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww eww

    • @XPForever
      @XPForever 3 ปีที่แล้ว +20

      Insert ew x452

    • @jkid1134
      @jkid1134 3 ปีที่แล้ว +21

      Or perhaps a disappointed sigh

    • @airmanon7213
      @airmanon7213 3 ปีที่แล้ว +7

      I thought Bogosort was shaking its head each time it saw one out of order. Guess I was mistaken.

  • @mike_dft1267
    @mike_dft1267 2 ปีที่แล้ว +37

    Quantum bogosort is a hypothetical sorting algorithm based on bogosort, created as an in-joke among computer scientists. The algorithm generates a random permutation of its input using a quantum source of entropy, checks if the list is sorted, and, if it is not, destroys the universe. Assuming that the many-worlds interpretation holds, the use of this algorithm will result in at least one surviving universe where the input was successfully sorted in O(n) time.

  • @spiralhalo
    @spiralhalo 4 ปีที่แล้ว +556

    I was thinking "they wouldn't let bogo sort finish would they?" Then I saw the length of the video..

    • @timothymclean
      @timothymclean 2 ปีที่แล้ว +14

      Genuinely surprised this wasn't an April Fool's special.

    • @Bigassboya
      @Bigassboya 2 ปีที่แล้ว +32

      If there was an additional ball for bogo to sort this video would probably be 5 hours long

  • @HmmmmmLemmeThinkNo
    @HmmmmmLemmeThinkNo 7 หลายเดือนก่อน +3

    I wish more people would show algorithms like this. It makes so much more sense than bars moving around

  • @anxez
    @anxez 4 ปีที่แล้ว +228

    >sees Bogo sort start.
    >sees the video length.
    That's the kind of quality content I like.

  • @whimsy5623
    @whimsy5623 4 ปีที่แล้ว +14

    Bogosort extends the video by half an hour. What a champ.

  • @_1derscore
    @_1derscore 4 ปีที่แล้ว +530

    solid 30+ mins of Bogo trying to get all 6 to line up perfectly

    • @lucashoffses9019
      @lucashoffses9019 3 ปีที่แล้ว +23

      Imagine the pain he feels at 7:35 where the list is almost sorted

    • @KingBobXVI
      @KingBobXVI 3 ปีที่แล้ว +15

      @@lucashoffses9019 - And it was only 4 comparisons behind bubble too, so, so close...

  • @crimsonDestroyer
    @crimsonDestroyer ปีที่แล้ว +3

    You have to admit, the sound of Stooge Sort solving a bunch of subdivisions at the same time in this video is pretty satisfying.

  • @citricdolphin
    @citricdolphin 4 ปีที่แล้ว +252

    I'm so glad you chose to show bogosort in such long time. It really demonstrates how astronomically inefficient it is.

    • @lifinale
      @lifinale ปีที่แล้ว +6

      orrr it could be extremely efficient!

    • @84updown
      @84updown ปีที่แล้ว +3

      @@lifinale Tbh I can't think of any circumstance where you'd want to use bogo sort. Except in this instance to demonstrate how long it takes lol

    • @Maniac_l23
      @Maniac_l23 ปีที่แล้ว +6

      @@84updown bogo sort is very resource efficient, if you give it the time to work its magic.

    • @Kokurorokuko
      @Kokurorokuko ปีที่แล้ว +3

      ​@@84updownI work in aviation-related field and bogo sort is literally sorted there all the time. The reason behind it is that embedded systems like planes need to preserve memory.

  • @flakeobsidian
    @flakeobsidian 2 ปีที่แล้ว +14

    I found myself thinking “bogo’s not going to like that” every time I saw the inevitable flaw in each shuffled pattern

    • @0LoneTech
      @0LoneTech ปีที่แล้ว

      They're not inevitable; just 719/720 odds. Every time.

  • @eurovisioncyan9550
    @eurovisioncyan9550 4 ปีที่แล้ว +656

    GUYS OUR PETITION WORKED
    Edit: Ofc thanks to Udiprod for listening to our requests and putting so many resources and effort into this 40 minute video, we all appreciate you Udiprod!

    • @udiprod
      @udiprod  4 ปีที่แล้ว +327

      Thanks a lot! Yes, I was influenced by requests in this video. But it was an interesting challenge too.

    • @_fluffyy1028
      @_fluffyy1028 4 ปีที่แล้ว +45

      @@udiprod -now do bogobogosort-

    • @want-diversecontent3887
      @want-diversecontent3887 4 ปีที่แล้ว +16

      _fluffyy
      It’ll be hard to visualise copies.
      By the way, on the off chance someone thinks I don’t get the joke, I get the joke.

    • @_fluffyy1028
      @_fluffyy1028 4 ปีที่แล้ว +5

      Want - Diverse Content I mean you don't have to copy it to check it

    • @kingcobraarchie
      @kingcobraarchie 4 ปีที่แล้ว +25

      @@udiprod nice Easter egg at 26:10. Also love these sorting videos.

  • @sebastiansimon7557
    @sebastiansimon7557 4 ปีที่แล้ว +7

    Love the little waiting animations on the robots; love the fact that the “audience” are just wooden dolls.

  • @MarkusSchaber
    @MarkusSchaber 4 ปีที่แล้ว +219

    I honestly feel with the poor "stooge sort" guy who has to hold his arms in a really uncomfortable position. Please give him a chair and let him rest!

    • @bathbombman
      @bathbombman 4 ปีที่แล้ว +13

      they probably dont have legs, they just slide on the floor

    • @NStripleseven
      @NStripleseven 3 ปีที่แล้ว +1

      .O
      < >
      |

  • @Syz_gy
    @Syz_gy 4 ปีที่แล้ว +10

    Okay, so, A. This series has been incredibly I formative. Now I can enjoy those random recommendations of visualized sorts on a whole new level, since I actually know what some of them do.
    B. You absolute *madlad,* you could not have driven the point more perfectly home with bogosort. I saw Stooge win, watched for maybe three more minutes, and then it *properly* dawned on me how the math worked out. And then I checked the video length, and burst out laughing. Absolutely amazing. Keep doing what you're doing, I'm gonna go watch the rest of your vids.

  • @BlueBeBlue
    @BlueBeBlue 4 ปีที่แล้ว +135

    omg 40 minutes of pure bogo sorting, that's all i needed

  • @ts4gv
    @ts4gv 2 ปีที่แล้ว +9

    I can’t believe the video resumes after Bogosort’s 35 minute race as if nothing happened

  • @Encarvlucas
    @Encarvlucas 4 ปีที่แล้ว +392

    At 7:34, it was so close 😭
    If only the last pair was swapped...

    • @__bean
      @__bean 4 ปีที่แล้ว +62

      It happens again #330 trial 36:50 lol

    • @englishmotherfucker1058
      @englishmotherfucker1058 4 ปีที่แล้ว +64

      so yall just watching half an hour of uninterrupted bogosort because...

    • @Praisethefab
      @Praisethefab 4 ปีที่แล้ว +36

      @@__bean it's even the same two balls at the end, incredible

    • @jackywong9504
      @jackywong9504 4 ปีที่แล้ว +5

      Right when his number of comparisons surpasses stooge sort

    • @huyphamuc6372
      @huyphamuc6372 4 ปีที่แล้ว +2

      Those destroyed my heart

  • @redm91
    @redm91 2 ปีที่แล้ว +3

    This is the most patient audience I've ever seen in my life
    and probably ever will see

  • @pepperonipizza8200
    @pepperonipizza8200 4 ปีที่แล้ว +168

    Friend: What is it doing?
    Me: Its best.

    • @PedroKing19
      @PedroKing19 4 ปีที่แล้ว +5

      It's not even trying bro it's just letting the machine do the work

    • @spacedanceretefira7237
      @spacedanceretefira7237 3 ปีที่แล้ว +2

      @@PedroKing19 It is the machine

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

      lego island 2 moment

  • @Fauix
    @Fauix 3 ปีที่แล้ว +1

    Holy cow, I remember the comments requesting this years ago, so nice to see this pop back on my feed!

  • @reuppbee8872
    @reuppbee8872 4 ปีที่แล้ว +337

    Dad: are ya winning son ?
    Bogo sort: well no but actually no

    • @eantropix
      @eantropix 4 ปีที่แล้ว +17

      Well no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually yes

    • @anawesomepet
      @anawesomepet 4 ปีที่แล้ว +8

      One of the Worst case scenarios
      Well no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually no but actually yes.

    • @encozine
      @encozine 4 ปีที่แล้ว +4

      bogo actually won right after before stooge finished sorting

    • @theskydomain3794
      @theskydomain3794 4 ปีที่แล้ว +2

      SPSheep that hurts my eyes, good man

    • @studiousboy644
      @studiousboy644 3 ปีที่แล้ว +2

      @@anawesomepet
      His dad would have left the room, left the house for milk and then actually come back by the time he sorts the balls.

  • @KaeraNeko
    @KaeraNeko ปีที่แล้ว +2

    bogo is my favourite sorting algorithm. I'm convinced that whoever first thought of it chuckled at themselves.

  • @ChillstoneBlakeBlast
    @ChillstoneBlakeBlast 4 ปีที่แล้ว +586

    26:10 has an easter egg.

  • @the1stwing
    @the1stwing 3 ปีที่แล้ว +7

    I think my favorite part of this is how Bubble just looks around awkwardly like it never expected to finish first

  • @yuvaldolev7969
    @yuvaldolev7969 4 ปีที่แล้ว +257

    My favorite sort algorithm is one I call thermodynamic sort:
    Background:
    Physics show that the universe likely will reach a time where its energy is evenly distributed everywhere, and thus, nothing happens - time is frozen, forever. This is known as the heat death of the universe.
    Algorithm:
    1. Define some time span T
    2. Wait for T time
    3. Check if universe has reached its heat death. If so, you're finished. If not, return to step 2 (you can also return to step 1 and redefine T, the algorithm's correctness remains)
    Proof:
    By the time the algorithm halts, the universe has reached its heat death and no form of intelligent life exists. With no brains to think it, the concept of "comparison" ceases to exist and thus no element is less than a preceding one. The list is ordered.

    • @jakethewolfie119
      @jakethewolfie119 4 ปีที่แล้ว +28

      However, there would also be no way for the algorithm to continue existing as no one could actually check if the heat death has occured, as if it did then there would be no minds to proccess that it occured.

    • @englishmotherfucker1058
      @englishmotherfucker1058 4 ปีที่แล้ว +46

      if you just destroy your computer then there will be no more data
      no data means an empty set, which is sorted
      plus, given that destroying a computer does not take more/less time depending on list length this algorithm should take O(1) time.

    • @groszak1
      @groszak1 4 ปีที่แล้ว +1

      @@englishmotherfucker1058 sorting files in a folder would delete the folder

    • @jacobw1780
      @jacobw1780 4 ปีที่แล้ว +2

      😒

    • @ferociousfeind8538
      @ferociousfeind8538 2 ปีที่แล้ว +8

      Ahh, finally, a timely sorting algorithm. This one operates in constant time!

  • @lolallday08
    @lolallday08 ปีที่แล้ว +1

    This actually calmed me from the most traumatic event I've had thus far in 26 years of living. I honestly might start liking math now...

  • @noyz-anything
    @noyz-anything 4 ปีที่แล้ว +107

    I feel like Stooge should have shut down halfway through Bogo's tomfoolery.

  • @ilicythings
    @ilicythings 4 ปีที่แล้ว +4

    I saw a comment on an earlier video from about 5 years back about Bogo sort and I thought that I would never be able to see the glorious inefficiency of it rendered in an udiprod video.
    I was wrong, and I'm so glad I was.
    (Now I just want an endless live stream of miracle sort!!)

  • @KanarisTM
    @KanarisTM 4 ปีที่แล้ว +202

    Bubble sort (10 balls): 36 comparisons
    Stooge sort (10 balls): *_81 cOmPaRiSoNs_*
    Stooge Sort (6 balls): 27 comparisons
    Bogo Sort (6 balls): *_6 0 5 C O M P A R I S O N S_*

    • @groszak1
      @groszak1 4 ปีที่แล้ว +2

      *9

    • @thiendu250
      @thiendu250 4 ปีที่แล้ว +1

      OK I will copy

    • @KanarisTM
      @KanarisTM 4 ปีที่แล้ว +1

      @@groszak1 Ah okay I didn't realise.

    • @XPForever
      @XPForever 4 ปีที่แล้ว +1

      Now do same but 100 balls

  • @linguicaguy
    @linguicaguy ปีที่แล้ว +1

    That introduction part literally looks just like a freaky dream I had when I was a really young child, with the blue gradient background and the weirdly moving humanoid characters.

  • @kilerkai
    @kilerkai 4 ปีที่แล้ว +101

    I am amazed how "comlicated" things like sorting algorithms can be explained in a way that even i child could understand them.

    • @Dougiewoof
      @Dougiewoof 4 ปีที่แล้ว +12

      With the right person and the right methods you can explain anything to even the youngest of children.

    • @Huntracony
      @Huntracony 4 ปีที่แล้ว +6

      @@Dougiewoof I'm not so sure anyone could by any method explain string theory to a baby.

    • @theteddychannel8529
      @theteddychannel8529 4 ปีที่แล้ว +5

      @@Huntracony yeah I think the minimum requirement for being able to learn anything is a fully developed brain.

    • @loreleihillard5078
      @loreleihillard5078 4 ปีที่แล้ว +6

      @@theteddychannel8529 not fully developed, since that doesn't happen until around age 25, but definitely partially developed

    • @theteddychannel8529
      @theteddychannel8529 4 ปีที่แล้ว +1

      @@loreleihillard5078 I don't know man, maybe 25 IS the minimum, simply because I'm including all "normal" people (meaning without mental disabilities) which means very dumb people are part of the equation.

  • @thealtrik3051
    @thealtrik3051 4 ปีที่แล้ว +6

    when i clicked on this video i was like " is this really gonna be a 40 minute video about bad sorting algorithms.
    its just an elaborate troll of bogo sorting

  • @lxxwie9407
    @lxxwie9407 4 ปีที่แล้ว +179

    I was really hoping bogo sort would get lucky and finish in less than 310 but oh well

    • @derekliu793
      @derekliu793 4 ปีที่แล้ว +13

      *360, so he did get lucky i think
      tbf as permutationso can repeat you should expect 720

    • @lxxwie9407
      @lxxwie9407 4 ปีที่แล้ว +3

      @@derekliu793 yeah I somehow messed up the math lol because I knew the probability was 6! I just halved it wrong

    • @adrihooijer536
      @adrihooijer536 4 ปีที่แล้ว +4

      A probability of 6? I thought that a probability was always a number between 0 and 1.

    • @ikercalderon163
      @ikercalderon163 4 ปีที่แล้ว +6

      @@adrihooijer536 the probability is 1/6! (6x5x4x3x2x1), but a lot of time in probability you use cases as probability and in the other way (because probability is the inverse of the cases (when all the cases are equally possible and only 1 case wins))

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

    I love how Bogo sort has two extreme cases.
    - It randomizes the list once and is instantly correct.
    - It literally takes an infinite number of attempts to be correct.
    Mathematically, both of these are technically possible outcomes.

  • @hauslerful
    @hauslerful 4 ปีที่แล้ว +413

    He's back. Probably did a bogo sort by hand...

    • @anawesomepet
      @anawesomepet 4 ปีที่แล้ว +9

      Wait, She's a HE?

    • @moved8575
      @moved8575 4 ปีที่แล้ว +5

      @@anawesomepet ??

    • @manmeetsingh4719
      @manmeetsingh4719 3 ปีที่แล้ว +3

      @@anawesomepet I need to know.

  • @Y337n3ss
    @Y337n3ss 3 ปีที่แล้ว +9

    with most other sorting algorithms, there is usually some way, some arrangement of items you can use to maximize swaps, such as giving Stooge Sort a list that's inverted. but Bogosort goes through the same motions regardless of what it's trying to sort, meaning every configuration is simultaneously the best, and worst case scenario

  • @knorke3549
    @knorke3549 4 ปีที่แล้ว +36

    Also Bogosort could (theoretically) take infinite tries to finish if you get infinitely unlucky, and as we all know potentially infinite runtime is something everyone would want in an algorithm :P

    • @0LoneTech
      @0LoneTech ปีที่แล้ว

      Significantly, it's using independent tries. That means no matter how long it has run, it's no more likely to finish soon.
      For comparison, consider a bubbly bogosort: If the first shuffled item is in the correct place, lock it. Shuffle only the remaining list. Still may take infinite time, but has some chance of making progress (until it's down to a coin toss).

  • @soup9242
    @soup9242 2 ปีที่แล้ว +6

    I like how Bubble sort often looks over at Stooge sort after they finish, and Stooge sort does the same to Bogo sort, as if they’re thinking, “Are they done yet?”

  • @Heligoland360
    @Heligoland360 4 ปีที่แล้ว +41

    The mad lads actually did Bogo sort 👌

  • @ErzengelDesLichtes
    @ErzengelDesLichtes 4 ปีที่แล้ว +14

    3:20 LOL, I love bubble sort bot’s just like “wait, what? I finished first?”

  • @snowstorm9310
    @snowstorm9310 4 ปีที่แล้ว +28

    These people straight up animated a robot going back and forth 609 unique times, and everything else that goes with contextualizing the sort properly...

  • @renomiz2373
    @renomiz2373 2 ปีที่แล้ว +3

    There's something so funny about this, just realizing that the video is 40 minutes and its just this awkward robot trying its best

  • @Rickety3263
    @Rickety3263 4 ปีที่แล้ว +56

    22:09 Definitely worth the wait for this part

  • @주하늘-y5j
    @주하늘-y5j 3 ปีที่แล้ว +20

    O look, I got the exact arrangement I wanted, except the last two balls changed places. What do I do?
    Quicksort: Change their places.
    Insertion sort: Take the last ball; put it where it belongs.
    Bogosort: 7:35

  • @benjaminbrady2385
    @benjaminbrady2385 4 ปีที่แล้ว +47

    For those wondering: the probability of a given list of n items being sorted on a random shuffle is 1 in n!.
    As an example, the 6 item list had 6! = 720 combinations so the odds of a given shuffle being correct were 1 in 720.
    Thus, bogo had a slightly higher than 50% chance of being correct after 479 permutations.
    The formula for finding the odds of success after t trials given n items using bogo sort is (1 - 1/n!)^t.
    The average amount of excess comparisons would have been 3. So we have (3 * 479) + 5 comparisons for a slightly higher than 50% chance of success = 1442.
    The formula for the amount of comparisons for a probability p of success with n items using bogo sort is n/2 log_(1-1/n!) (p) + n - 1.
    This formula works generally: if you have a random chance C(n) of being correct on a given trial and need to check the list to see if you're correct, then the average amount of comparisons needed is given by n/2 log_(1-C(n)) (p) + n - 1.

    • @Da_Rivulet
      @Da_Rivulet 2 ปีที่แล้ว

      isnt n! in math like n+n-1+n-2...n-(n-1) or does it go to n-n aka 0?

    • @Da_Rivulet
      @Da_Rivulet 2 ปีที่แล้ว

      or is it multiply

    • @mrgoldengraham027
      @mrgoldengraham027 2 ปีที่แล้ว

      @@Da_Rivulet nah n! = n*(n-1)*(n-2)*... until (n-x)=1

  • @dreamhollow
    @dreamhollow 2 ปีที่แล้ว +3

    Bogo Sort is like if a sorting algorithm had a terrible gambling addiction.

  • @sinom_00
    @sinom_00 4 ปีที่แล้ว +21

    Bogo sort actually reached 5 in order in only 30 or so comparisons, which is way better than the average 120

  • @Kihanacloudy
    @Kihanacloudy 4 ปีที่แล้ว +7

    I'm glad they gave Bogosort a little hat, he deserves it. He's trying his best

  • @leoncruz9757
    @leoncruz9757 4 ปีที่แล้ว +6

    This channel doesn't update that frequently, but I can assure you that every single episode is of top quality👍

  • @romualdgarcia7236
    @romualdgarcia7236 4 ปีที่แล้ว +2

    This video is pure gold, thanks for letting bogo sort until the end

  • @dennistra1633
    @dennistra1633 4 ปีที่แล้ว +86

    THE RETURN
    Also, can you do gnome sort/optimized gnome sort and bad sort? I think of them as similar but it always seems that gnome sort is just more efficient and I don’t know why

    • @andrewcheng1948
      @andrewcheng1948 4 ปีที่แล้ว +4

      What's bad sort?

    • @PaulFisher
      @PaulFisher 3 ปีที่แล้ว +1

      It’s described on the Wikipedia page for bogosort, but I am having a hard time following its explanation.

    • @musicexams5258
      @musicexams5258 2 ปีที่แล้ว +3

      Gnome Sort is basically Insertion Sort that went on a bender and is currently hung over

  • @tonyhakston536
    @tonyhakston536 2 ปีที่แล้ว +2

    I half expected Bubble to get impatient and start helping.

  • @UndercoverDog
    @UndercoverDog 2 ปีที่แล้ว +3

    Shoutout to the person who animated fucking 40minutes of a robot shuffling and checking bowling balls

  • @FacuA0
    @FacuA0 ปีที่แล้ว +1

    Stooge sort is like an exaggerated version of a human looking up if the door was properly closed.

  • @bhaskar08
    @bhaskar08 4 ปีที่แล้ว +4

    This channel is a gem, keep it alive!

  • @DioJeans
    @DioJeans 2 ปีที่แล้ว +4

    37:07 the fact that it was literally one off from being correct and it just shuffles them all around again

  • @twixerclawford
    @twixerclawford 4 ปีที่แล้ว +32

    Alright, that was great! See you all again in 2022 when udiprod uploads again!

    • @neonblade8591
      @neonblade8591 4 ปีที่แล้ว +2

      he's taking another long hiatus to animate bogobogosort

    • @twixerclawford
      @twixerclawford 2 ปีที่แล้ว +1

      Wow, apparently I was... half right

  • @alexanchannel
    @alexanchannel 4 ปีที่แล้ว +1

    OMG you actually did the animation! I've been waiting 3 years to see that! You are the MVP udiprod !

  • @c3p0worksatburgerking35
    @c3p0worksatburgerking35 4 ปีที่แล้ว +23

    Anyone else watching stooge sort do its thing at the start and being like “your doing great honey!”

  • @TheRadicalOneNG
    @TheRadicalOneNG 2 ปีที่แล้ว +3

    I loved Bubble sort just standing there, awkwardly waiting for Stooge sort to finish and being unsure of what to do.

  • @dr.johnsmittersmidt7644
    @dr.johnsmittersmidt7644 4 ปีที่แล้ว +4

    Me at night : Quick sort
    Me at math test : Bogo sort

  • @kibbypawbs
    @kibbypawbs ปีที่แล้ว +3

    everyone's talking about bogo sort but man i feel bad for bubble sort
    he was finally gonna win one but was left with confusion while waiting 2 minutes for stooge sort to finish and eventually win

  • @therealcyndaquil8312
    @therealcyndaquil8312 4 ปีที่แล้ว +31

    you know videos about sorting algorithm is gonna be interesting if it exceeds 5-7 minutes

  • @GimmeMyHandleBack
    @GimmeMyHandleBack 4 ปีที่แล้ว +1

    These are so addicting... I don’t even need to learn this but I appreciate forgetting about it for about a year and coming back to this new one!

  • @electromika
    @electromika 4 ปีที่แล้ว +16

    i cant believe i just watched over 20 minutes of bogosort on my own volition

  • @katlicks
    @katlicks 4 ปีที่แล้ว +2

    Stooge Sort looks like it's anxious and has to keep double checking what it just sorted.

  • @garr_inc
    @garr_inc 4 ปีที่แล้ว +19

    I would very much like to see the cocktail shaker sort featured on one of these videos!

    • @airmanon7213
      @airmanon7213 3 ปีที่แล้ว +5

      Would be cool if the Cocktail Shaker sort robot is dressed like a bartender as a nod to the name. What do you think @udiprod ?

  • @4kleidisc
    @4kleidisc ปีที่แล้ว +2

    i love how bubble sort just waits so patiently

  • @Pingwn
    @Pingwn 4 ปีที่แล้ว +7

    FINALLY, the sorting algorithm we've all been waiting for!!!

  • @LieseFury
    @LieseFury 2 ปีที่แล้ว +3

    "I must apologize for BOGO sort. He is an idiot. We have purposely trained him wrong, as a joke."