Posts Tagged Music
The Perception of Randomness
Posted by Chris in Music, Programming on 26 August, 2020
How we perceive random events is interesting especially when you couple it with our ability to see patterns in everything, from shapes in clouds to faces in everything.
A few years ago I wrote a random album chooser application as a means to explore new .NET and C# language features. The idea was to pick a random album from my music collection and then play all the tracks in order. No music player I’d found could do that, they could shuffle tracks across an entire library, but I wanted to play albums in their entirety and in their original order.
Anyway, I made it and didn’t really use it much, I played perhaps one or two albums at a time and then didn’t use the application for weeks. Then 2020 happened and I started working from home and could more easily play music. I like to play music when doing other things, but don’t like wearing headphones as it makes me feel cut off from my surroundings. That’s OK in certain circumstances, but not, I feel, when you’re working.
I soon found some issues with how it chose albums. There were other issues where I’d made assumptions about the validity of tags etc, but that’s not what we’re discussing here. The first was that it could choose the same album twice in a row, which was easily fixed by simply comparing the new album against the current one and if it was the same just pick again. The next was that it could find an album I’d already played that day which isn’t desirable. Again relatively easily fixed by keeping a list of all albums found this session and making sure that the new album wasn’t on the list.
I must stress that there wasn’t anything wrong with my algorithm, picking something at random from a set without removing that item from the set can result in the same item being picked twice (or more) in a row and picked multiple times. That’s how randomness works, but the human brain doesn’t see it as “truly” random because we’re looking for patterns and if data has patterns it’s not random.
The clustering illusion is the tendency to erroneously consider the inevitable “streaks” or “clusters” arising in small samples from random distributions to be non-random.
https://en.wikipedia.org/wiki/Clustering_illusion
We don’t like patterns in our random data even though they’re acceptable and to be expected. It’s why when we see a cluster in random data we think there’s a pattern. If you don’t allow for this you can think that living near electricity pylons causes leukaemia when it’s just the clustering illusion at work.
Back with the album player. Now that I’m using the player every day for 8+ hours a day the problem I’m getting is that albums can repeat across days. While some albums can stand rapid repeat listening, others can’t, plus what I’m after is to move through my music library rediscovering albums and artists I’ve not played recently. Currently my application has no memory of what it played in previous sessions so this could become an annoying problem.
To solve this I’m considering adding history of the date and the number of times an album has been picked and played to the player so that I can skip albums that have been played recently (for a configurable value of recently) or have been played more than a certain (configurable) number of times.
All of which is interesting (to me at least) as it demonstrates the lengths we go to to make things “properly” random even though the result isn’t random at all. To humans “random” is almost synonymous with “even”. For example, if you throw a dice and it comes up 6, people often think that the chances of it coming up 6 again are reduces – when of course they’re not. This way we think is often exploited by the less honest in society to sucker us into making unwinnable bets so being aware of this can only be good for one’s financial health.
© 2020 – 2021, Chris. All rights reserved. If you republish this post can you please link back to the original post.