for MATH MONDAYS

Tumblr ↗

posts every monday 8AM PST

Tag: cool

  • THE TRUTH ABOUT THE SPOTIFY SHUFFLE

    A very common feature of Spotify is the Shuffle, this puts songs from a certain album/playlist in a different order than they are usually in. The entire purpose of the shuffle is to be random, but what if i told you the shuffle uses a system that is much less random and more systematic, but makes it feel much more random.

    Lets take a simple example that shows the true meaning of randomness before we understand the shuffle system:
    If you asked anyone what the result would be if you randomly flipped a fair coin any given number of times, they would probably say an alternating sequence between heads and tails: HTHTHTHT……., and this would seem random. However, true randomness means you can constantly have consecutive heads or consecutive tails as every flip is independent to the one before it! Now lets take this same logic into the shuffle!

    Say I have a playlist with 100 songs, out of which 5 of them are made by Ed Sheeran. If the shuffle was truly random there is always a chance I will get all five of them in a row, but this wouldn’t feel random to an average listener, it would seem like a bug, and while this system is as random as it could get, it must be rigged to give variety and prevent such a situation from happening. Rather the system actually evenly splits certain genres or artists across the playlist. For example:
    Shuffle #1(One case for truly random, what listeners don’t like):
    Rock–>Pop–>Pop–>Pop–>Jazz
    Shuffle #2(Balanced and rigged, what listeners like):
    Pop–>Rock–>Pop–>Jazz–>Pop
    So if I have a case where 20% of my playlist is Country music, Spotify will map out the songs and space them exactly 5 spots apart, and will do this for all the other genres. The system I said would work, except for the fact that the shuffle on a certain playlist would be nearly identical everytime! The scientists who created this logic saw this through, so they introduced a tiny amount of random offset so the entire playlist isn’t completely in a pattern, so the country song could play in the 4th or 6th slot rather than exactly the 5th, ensuring a varied listening set everytime!

    So next time you listen to your favorite playlist using Shuffle, think back to the genius math behind it!

  • What’s the Weather Like?

    You look at your forecast. 30% chance of rain, that’s a bummer(unless you’re one of the rare people who like the rain). But what does this number really mean?

    Many assume this number means that 30% of the given town would rain or it will rain for 30% of the day, but what it actually means is far more interesting and uses a clever calculation not many are aware of. When the forecast shows 30% it means that there is a 30% probability(I love that word) that at least 0.01 inches of rain will hit any given surface in the town over a certain time period(usually one,twelve,or twenty four hours). So now that we know what a 30% chance of rain means, how is it calculated?

    The National Weather Service says the probability is calculated like this, where P=probability of rain, C=confidence of prediction, and A=percent area of town expected to receive rain:
    P=C*A
    I know its pretty surprising how simple that is, you were probably expecting some crazy formula, or applying Bayes theorem and finding the expected value, but no its just multiplying two values!

    So for example, if P=30%(I don’t know why I keep using that number), you could have the following extremes:
    1. You have small storms incoming on only a fraction of the area but the meteorologist is very confident that this event will occur
    2. You may get a large storm flooding your entire town but the meteorologist is not super confident this will occur
    These both will show the same number on your weather app but they are two very different types of storms and occurences.

    So next time you look through the rain probability always think what kind of confidence or area of rainstorm you could be encountering!