Maths in Real Life

Is Your Music Shuffle Really Random? The Maths of Surprise

EuclidCurve Smart Team · 2026-11-11 · 6 min read

For young mathematicians in the UK, USA, UAE, Singapore and Hong Kong

You press shuffle, and two songs by the same artist play back to back. Then it happens again. Is the shuffle broken, or are we bad at recognising randomness?

Guess first: How many people do you need in a room for a better-than-even chance that two share a birthday?

  • About 183
  • About 70
  • Just 23

Just 23. With 23 people there are 253 different pairs, and each pair is a chance for a match. The probability of at least one shared birthday is about 50.7%.

Coincidences are not rare, they are expected

The trick is to count pairs, not people. With n people there are (n(n-1))/(2) pairs. The chance that nobody shares a birthday is (365)/(365) × (364)/(365) × (363)/(365) × …, and by 23 people it falls below one half.

Your playlist works the same way. If a few artists dominate it, a truly random order will put two of their songs side by side surprisingly often. Shuffle the playlist below and count the repeats.

[Interactive tool: open this page in a browser to try it.]

Why apps make shuffle less random

Music apps have said that listeners complained random shuffle did not feel random, so some changed it to spread each artist's songs out. The result is less random, but feels more random to us. Our brains expect randomness to look evenly spread, and real randomness is clumpy.

Your turn

You flip a fair coin 3 times. What is the probability of getting at least one head? Give your answer as a decimal.

Solution: P(no heads) = (1)/(8), so P(at least one head) = 1 - (1)/(8) = (7)/(8) = 0.875.

Where this shows up in exams: IB Maths AA HL

Probability appeared in 76% of the 21 IB Maths AA HL Paper 1 papers we analysed (May 2021 to May 2026). The 'at least one' trick from the challenge is one of the most useful ideas in the topic.

Explore IB Maths AA

Try it at home: the birthday experiment

  1. Ask everyone in your class or family group chat for their birthday (day and month only).
  2. Write them in a list and look for any match.
  3. With 23 or more people, the chance of a match is over 50%.
  4. With 30 people it is about 71%, and with 50 people about 97%.
  5. Bonus: how many pairs can 30 people make? Use n(n − 1) ÷ 2.

Practice: master counting and probability

Guess first: Practice 1: With 5 people in a room, how many different pairs can compare birthdays?

  • 5
  • 10
  • 25

Pairs = (n(n-1))/(2) = (5 × 4)/(2) = 10.

Your turn

Practice 2: How many different pairs are there among 23 people?

Solution: (23 × 22)/(2) = 253 pairs: that is why 23 people are enough for a shared birthday to be more likely than not.

Guess first: Practice 3: A playlist has 3 songs. In how many different orders can they be shuffled?

  • 3
  • 6
  • 9

3! = 3 × 2 × 1 = 6 orders.

Your turn

Practice 4: You roll a fair die twice. What is the probability of at least one 6? Give a decimal to 3 decimal places.

Solution: P(no 6) = (\frac56)² = (25)/(36), so P(at least one 6) = (11)/(36) ≈ 0.306.

Your turn

Practice 5: A fair coin is flipped 4 times. What is the probability of getting no heads? Give a decimal.

Solution: (\frac12)^4 = (1)/(16) = 0.0625.

Quick questions

What is the birthday paradox?

In a group of just 23 people, the probability that at least two share a birthday is about 50.7%. It feels surprising because we think about people, but the number of pairs (253) is what matters.

Is music shuffle truly random?

A truly random shuffle often puts songs by the same artist next to each other, which listeners feel is not random. Some apps therefore spread artists out, which is less random but feels more random.

Written by the EuclidCurve Smart Team. We are the maths and physics tutors behind EuclidCurve. We teach IB, AMC, ESAT and TMUA students in the UK, USA, UAE, Singapore and Hong Kong, and we write about the maths hiding in everyday life.

Keep exploring

Book a free class · Try today's IMO problem