Bogosort Sheds the Rhythm Changes Until it Sorts the List
Вставка
- Опубліковано 27 січ 2024
- Bogosort continues its journey through the jazz repertoire, this time shedding over the Rhythm Changes until it successfully sorts the list.
The Bogosort algorithm is as follows:
1. Randomly shuffle the list.
2. Check if the list is sorted.
3. If not, go back to 1.
For a list of n elements, there is a 1/n! chance that Bogosort successfully sorts the list on any given pass, since there are n! (n factorial) possible permutations of the list. So with six elements, the probability of the list being sorted on any given pass is 1/6! = 1/720 ≈ 0.00139.
In this instance, the algorithm took 545 passes to sort the list.
The six elements of the list are mapped to notes of a specific scale, depending on which chord is being played in the progression. The scales used include the major pentatonic, Phrygian dominant, natural minor, harmonic minor, altered scale, Mixolydian, and more.
The shuffling algorithm used is the Fisher-Yates Shuffle, from lowest index to highest. The note played is the value of the element at the current index in the outer for-loop of the shuffle algorithm.
________
Interested in learning more about algorithms and how to program? Here are some useful and/or classic textbooks that I recommend (these are affiliate links, if you buy one, I get a small commission):
▶ “Algorithms” (4th Edition) by Robert Sedgewick & Kevin Wayne: amzn.to/3uo25xR
▶ “Effective Java” (3rd Edition) by Joshua Bloch: amzn.to/3HOnYJL
▶ “Python Crash Course, 3rd Edition: A Hands-On, Project-Based Introduction to Programming” by Eric Matthes: amzn.to/481jQ43
▶ “Design Patterns: Elements of Reusable Object-Oriented Software” by Erich Gamma, Richard Helm, Ralph Johnson, & John Vlissides: amzn.to/49fpr7R
▶ “Discrete Algorithmic Mathematics” by Stephen B. Maurer & Anthony Ralston: amzn.to/4bmsOvG
#jazz #algorithm #altered #music #musictheory #solo #meme #rhythmchanges #igotrhythm #gershwin #improvisation #bogosort #sortingalgorithm #sorting #visualization #computerscience #programming #code #satisfying #asmr #scrollingscore #transcription #hypnotic #studymusic #focusmusic
**Moments of Interest**
"So close!" One adjacent element swap away from sorting the list (Kendall-Tau distance of 1):
1:52 (attempt 166)
2:53 (attempt 257)
3:02 (attempt 271)
3:26 (attempt 307)
5:18 (attempt 475)
At 0:11 (and possibly in other places), the list appears to be sorted momentarily. This is because the bogosort algorithm only checks for "sortedness" at the end of a complete shuffle of *all* the elements. Here the list happened to be in sorted order during an *intermediary* swap operation, which goes unnoticed by bogosort.
The closely related "bozosort" algorithm checks if the list is sorted after *every* swap operation.
What if you made bozo play some music? That'd make two adjacent attempts sound more similar...? idk if it's good or bad.
@@670839245 Imagine 2 bogosorts playing together until one completes
I like how it has to stop and recheck that it’s been has been solved. Almost like it can’t believe it and is in shock
Shed bogo, shed. Yeah man.
i love how this makes for perfect ambient music to just loop in the background
its random (by nature) but sounds good so you cant really make out its a loop or where it loops
I love how these parameters just make more jazz out of jazz.
I love how you can still pick out fragmentary melodies and even some full ass phrases, like why wouldnt you, ya know?
Great chord progression choice, really added a lot to the random noise of the sorting
I like the addition of the bass in this one. I think it might be interesting to use a list with some repeated elements, like instead of just having 1-6, have a list that's ten notes long with values 1-7 and duplicate 1s, 3s, and 5s. I know it would take *significantly* longer to sort but this shit goes really hard as ambient focus music so long videos aren't a problem IMO.
This was relatively average of bogo sort right? It had a 53.14% of terminating at then or before?
That's right! The probability of it finishing at or before the 545th attempt is 1 - ((6! -1) / (6!)) ^ 545
@@AlgoMotion what the
once thing this shreds inner urge we're all out of a gig
It’d be pretty cool to see a bit of rhythmic variation? Maybe two of the six values are related to rests?
Lol please make it so the shuffle uses an RNG seed when picking numbers.
It would be great to recreate different versions easily or make it a bogosort musicbox lmao
Sick linez
What standard is jazz is this?
High. It's a high standard of jazz.
Serial music is basically just a glorified version of this
do the coltrane changes next!!
How does the algorhithm decide in which octave to play the note in?
Is the code for this public? I'd love to be able to try this out with other progressions
not at the moment, but possibly at some point in the future!
Just saying this is your 69th video