AlgoMotion | Bogosort Sheds Giant Steps Until it Sorts the List (Using Major Pentatonic of the V) @AlgoMotion | Uploaded December 2023 | Updated October 2024, 9 hours ago.
Bogosort sheds the Giant Steps changes.
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.001389.
In this instance, the algorithm took 2005 passes to sort the list.
The six elements of the list are mapped to the notes of a major pentatonic scale (with the root of the scale present twice). The scale used is always the major pentatonic a perfect 5th above the current key center (F# major pentatonic over B major, D major pentatonic over G major, and Bb major pentatonic over Eb major). This leads to the algorithm randomly playing the 2, maj3, 5, maj6, and maj7 of the current key center for a reasonably musical result.
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.
The colors used to represent the three keys of the Coltrane changes are inspired loosely by Scriabin's note-to-color mapping:
• B major ↔ blue or pearly blue
• G major ↔ orange
• Eb major ↔ flesh (glint of steel)
________
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 #music #coltrane #giantsteps #improvisation #bogosort #sortingalgorithm #sorting #visualization #computerscience #programming #code
Bogosort sheds the Giant Steps changes.
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.001389.
In this instance, the algorithm took 2005 passes to sort the list.
The six elements of the list are mapped to the notes of a major pentatonic scale (with the root of the scale present twice). The scale used is always the major pentatonic a perfect 5th above the current key center (F# major pentatonic over B major, D major pentatonic over G major, and Bb major pentatonic over Eb major). This leads to the algorithm randomly playing the 2, maj3, 5, maj6, and maj7 of the current key center for a reasonably musical result.
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.
The colors used to represent the three keys of the Coltrane changes are inspired loosely by Scriabin's note-to-color mapping:
• B major ↔ blue or pearly blue
• G major ↔ orange
• Eb major ↔ flesh (glint of steel)
________
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 #music #coltrane #giantsteps #improvisation #bogosort #sortingalgorithm #sorting #visualization #computerscience #programming #code