If you’re a relatively avid YouTube user like myself, you may have noticed more small channels recommended to you recently. I’m not talking about small in terms of “only” a few hundred thousand subscribers and a couple brand deals; these are channels with less than a graduating-class's worth of views.
This is refreshing, but unfortunately not always the most fruitful for the YouTube algorithm. I rarely watch these videos, whether because they look uninteresting to me or purely the lack of peer review inherent in the low view count.
Today, however, I came across something seemingly rare. A recommended channel with less than 200 subscribers (I was the 159th) and some novel content: applying sorting algorithms to jazz standards.
Ignoring the low-hanging fruit of the YouTube algorithm serving itself by offering me a video on algorithms, it was almost shocking to me that this channel had so little attention. I’ve seen videos devoted to this general concept to varying degrees of success, but this was new - quick, unadorned, and easily digested. The algorithm Bogosort dutifully runs its iterations until it comes to a hilariously abrupt halt, freeze-tagged on a half-diminished chord when it finally finishes its sorting task.
Dan Tepfer and Ben Wendel’s recording of the Lennie Tristano contrafact1 Line Up sprang to mind. Aside from the obvious link of a Rhodes/Rhodes-like synth over quick bop changes, the acrobatic passages in this recording somehow parallel those of Bogosort. Both Tristano’s original recording and Tepfer’s reimagining feature a somewhat modern marvel: solos were recorded in half time, and sped up in post-production for the final product.
This use of technology results in some fascinating lines that I can’t imagine Tristano, Tepfer, or Wendel would have came up with had they not been recording at half-speed. This is not to say they couldn’t have, more just to emphasize the unique quality of improvisation that results when you have double the time to think about each note. You’re more free to physically move around the instrument, allowing more jumps and disjunct phrasing. While Tristano still plays fairly linearly, Tepfer and Wendel blaze up and down their range in leaps and bounds.
And the parallel technology, Bogosort? Well, Bogosort tries its best. Video creator Algomotion calls Bogosort “possibly the dumbest sorting algorithm in existence”, which is not really an insult: Bogosort essentially shuffles a deck of cards, checks if it’s perfectly in order, and reshuffles if it’s not, ad infinitum. In this rousing rendition of Donna Lee, we have 6 “cards”, and we want to sort them from lowest to highest. It takes Bogosort 1962 valiant tries.
As objectively sterile and robotic as it is, I can’t help but appreciate Bogosort’s Pollock-jazz. I think most musicians could listen to this and find some sort of curious satisfaction in the results when Bogosort fails to put these scales together in the correct order for 20 minutes.2 No one is going to play transcriptions of its musings (or no one has, yet). But I challenge you to listen, either at full speed or slowed down, and think about how its lines could be understood if in the hands and feel of a human.
Witnessing Bogosort stumble through its scales, I thought of another YouTube rabbit hole I tend to fall down: educational chess content, usually from titled chess players streaming on Twitch. These creators often record themselves playing games online, and voice their thought processes and techniques as they play live.
If you’ve spent any time online this may not be surprising to you, but a favorite pastime among Internet users is winning. Arguments are the main outlet and games play a close second; thus, many cheaters exist. Press around cheating through modern methods has plagued the over-the-board (offline) chess world as of late, and online cheating and scandals are as rampant as ever. Streamers often come across these cheaters online, to the great benefit of their content production.
My interest, however, is in how these players are able to spot cheaters. I’m an amateur chess player, and I can at most see one move ahead before getting overwhelmed by the possibilities in the next position (and even then, I mess up). Chess grandmasters may be seeing many more moves in the future, or may have prepared extended lines based on the best possible calculated moves in each scenario. Chess engines, the preparation tool of honest players and the weapon of choice for most cheaters, look much deeper: they analyze many possible “trees” of moves in any given position, evaluating each piece’s value, the pieces’ positions, and the possible responses in order to settle on the best move.3 Stockfish and AlphaZero, the leading chess engines, and their predecessors have routinely and handily beaten the best human chess players.
Cheaters usually blindly follow these engines, with the occasional blunder thrown in to approximate humanity.4 Even if they’re not able to spot the exact issues, good chess players can recognize when their opponent’s rhythm is inconsistent or spot an oddball move. Engines may suggest entirely un-human and seemingly illogical moves, despite being based on the deepest logic possible. They may ignore taking initiative against obvious blunders by an opponent, instead opting towards a move that gives a guaranteed win many moves later. The engine is too well equipped to appear human.

And Bogosort? Bogosort is too poorly equipped to appear human. It climbs an endless wall until we decide where the top is, without really learning anything by the end. Bogosort is not AI, nor a neural network, nor an engine analyzing “trees”: it it is a three-step process of shuffle, check, repeat. No one would listen to Bogosort’s Serenade and think that a human wrote, let alone performed it. We all understand that the product as a whole is un-human and seemingly illogical.
But I still listened to its trials, and I found some beauty. Once the engine shows you the path, the queen sacrifice above, too, is beautiful. Whether watching a three-step process sort a half-scale, or watching multi-faceted artificial intelligence cheat at games online, my one-move-ahead brain is able to unearth some joy.
Does that make us mediators, or the lowest common denominator? I don’t know. But maybe in the future, some higher being will permit us as generous a description as Wikipedia offers Bogosort: “It is not considered useful for sorting, but may be used for educational purposes, to contrast it with more efficient algorithms.”
Is it a contrafact if just improvising over the changes, without a new melody? Is the “commonly accepted melody” still the melody, or are you just playing a well-known transcription? Place your votes now.
We allow Bogosort the gutter rails of a select few notes, with a select scale per chord. This may seem unfairly benevolent to the algorithm: can we really call this “generating music”? It’s essentially equivalent to assigning 6 random unknown variables to the algorithm and letting it play with them until they’re in an order that humans deem correct. I choose to still find interest in this concept: the tag team of technology and our brains is a unique and powerful thing.
I have a very surface-level understanding of chess and chess engines (and algorithms, and music!), so this is an extremely broad perspective on the topic. Check out this video from one of my favorite YouTube channels for a Bogosort-like approach to other types of chess engines.
You can copy me but get a few wrong so the teacher doesn’t get suspicious!
This is so genius!!! mind blown #bogosort