Skip to main content
Home
plus.maths.org

Secondary menu

  • My list
  • About Plus
  • Sponsors
  • Subscribe
  • Contact Us
  • Log in
  • Main navigation

  • Home
  • Articles
  • Collections
  • Podcasts
  • Maths in a minute
  • Puzzles
  • Videos
  • Topics and tags
  • For

    • cat icon
      Curiosity
    • newspaper icon
      Media
    • graduation icon
      Education
    • briefcase icon
      Policy

      Popular topics and tags

      Shapes

      • Geometry
      • Vectors and matrices
      • Topology
      • Networks and graph theory
      • Fractals

      Numbers

      • Number theory
      • Arithmetic
      • Prime numbers
      • Fermat's last theorem
      • Cryptography

      Computing and information

      • Quantum computing
      • Complexity
      • Information theory
      • Artificial intelligence and machine learning
      • Algorithm

      Data and probability

      • Statistics
      • Probability and uncertainty
      • Randomness

      Abstract structures

      • Symmetry
      • Algebra and group theory
      • Vectors and matrices

      Physics

      • Fluid dynamics
      • Quantum physics
      • General relativity, gravity and black holes
      • Entropy and thermodynamics
      • String theory and quantum gravity

      Arts, humanities and sport

      • History and philosophy of mathematics
      • Art and Music
      • Language
      • Sport

      Logic, proof and strategy

      • Logic
      • Proof
      • Game theory

      Calculus and analysis

      • Differential equations
      • Calculus

      Towards applications

      • Mathematical modelling
      • Dynamical systems and Chaos

      Applications

      • Medicine and health
      • Epidemiology
      • Biology
      • Economics and finance
      • Engineering and architecture
      • Weather forecasting
      • Climate change

      Understanding of mathematics

      • Public understanding of mathematics
      • Education

      Get your maths quickly

      • Maths in a minute

      Main menu

    • Home
    • Articles
    • Collections
    • Podcasts
    • Maths in a minute
    • Puzzles
    • Videos
    • Topics and tags
    • Audiences

      • cat icon
        Curiosity
      • newspaper icon
        Media
      • graduation icon
        Education
      • briefcase icon
        Policy

      Secondary menu

    • My list
    • About Plus
    • Sponsors
    • Subscribe
    • Contact Us
    • Log in
    • sun behind a cloud

      An almighty coincidence

      Rob Eastaway
      John Haigh
      1 December, 2007

      Coincidences can crop up in the strangest places. While Peter Hughes, an accountant from Birkenhead, was at a church service, his eye fell on the board showing the list of hymn numbers for the service. They were 16, 37, 428 and 590.

      Mathematicians naturally look on numbers as a goldmine for distraction, maybe seeking to combine them to form an equation, or noting how many are primes. In this case, Peter observed something particularly curious: all ten digits appear exactly once! How likely is that, he wondered? His initial back-of-the-envelope estimate indicated that the chance might be about 1 in 6,000. He then sought our comments.

      Working out the odds: start with common sense

      This is a nice example of a coincidence from everyday life. Whenever you attempt to work out the chance of such a coincidence, it's necessary to make a number of common sense assumptions, and then to build a mathematical model to come up with a sensible answer. Here, the chance will depend on how many hymns are available, how many are chosen, and what the selection process is. Hymns are generally numbered consecutively from 1 to N. Let's suppose for simplicity that N was about 1,000; in fact it helps the calculations below if we take N=999, and we know that, on this occasion, exactly four hymns were chosen for the service.

      That latter condition is central: fewer than four hymns makes Peter's observation impossible if N<1000, while more than four hymns would make it overwhelmingly likely that they would contain more than ten digits. So it was fortunate that Peter was at a four-hymn service, or he might never have happened upon this coincidence at all — though as we'll see, what he witnessed was still exceptionally unusual.

      Do the calculations

      The hymn lottery &mdash; what are the odds?

      The hymn lottery — what are the odds?

      Now for the calculations. First, we need to estimate the chance that the four hymn numbers contain exactly ten digits. Then we need to work out the chance that every digit is different.

      In our book of 999 hymns, every number will have either one, two or three digits. The only combinations that give a total of ten digits are {1,3,3,3} and {2,2,3,3}. If the hymns are chosen at random, the chances of a hymn number having 1, 2 or 3 digits will be 9/999, 90/999 and 900/999 respectively. Swallow hard, assume all four selections are made independently, and it emerges that the two combinations noted have respective chances 0.0263 and 0.0395, meaning that the overall chance of exactly ten digits is around 0.066, about 1 in 15. (Got stuck? Find out how this was worked out).

      Given the hymns have ten digits in total, what is the chance they are all different? If all digits were equally likely, the chance of them all being different would be 10!/1010, where 10! stands for 10×9×...×1. This is approximately equal to 0.00036. (Stuck again? Here's the answer.) We'll call this quantity D, so D=0.00036. Putting the two calculations together, our first estimate for the overall chance is 0.066×D, in round figures 1 in 40,000. So Peter's back-of-the-envelope figure looks like a substantial underestimate!

      Refining the model

      Our simple model has obvious deficiencies. For example:

      1. The number zero will arise less frequently than other digits, maybe 2/3 as often;
      2. Some hymns are far more, or less, popular than others;
      3. Christmas carols, doubtless numbered consecutively in a hymnbook, will never be selected for most of the year. Other blocks of hymns will be used only at baptisms, Easter, Harvest etc.;
      4. For hymnbooks in which N≠999, the frequencies of 1, 2 or 3 digit numbers will be different from those assumed;
      5. The numbers chosen can't be completely independent, as they are drawn from a finite population without replacement — and other factors may affect the independence assumption too.

      Point 3 is a reminder that we should explicitly assume that the service in question is a standard Sunday service, and not at Christmas, for example.

      The impacts of these refinements do not all work in the same direction! Whenever the digits are not all equally likely, that reduces the chance that they are all different. For example, as well as there being fewer zeros, if the carols are numbered (say) 425 to 488, then removing them from the selection available to the vicar would dramatically decrease the frequency of digit 4. On the other hand, if there are fewer than 999 hymns, or if that block of carol numbers is cast aside, the frequency of three-digit numbers will decrease, making it more likely that four hymns will have exactly ten digits. Selecting all the hymns from one short section of the book would make Peter's observation virtually impossible, but deliberately spreading them uniformly over the book would increase the chance.

      So suppose the true frequency that digit i is selected is pi. Then each number pi lies between 0 and 1, and the pi sum to 1. To make our calculations easier, we write pi=0.1(1+xi), where the numbers xi sum to 0.

      Now, selecting ten digits independently, the chance they are all different is 10!×(p0×p2×...×p9)=D×((1+x0)×(1+x1)×...×(1+x9)), which we write as D∏(1+xi). After a bit of manipulation this approximates well to D(1−0.5(x02+x12+...+x92)), which we will write as D(1−0.5∑xi2).

      How much does it affect the answer if the ten digits are not equally likely? Take N=999 and assume hymn numbers are chosen at random. For each digit, calculate its frequency among numbers with one, two or three digits respectively, and weight these appropriately: for all digits except zero, the frequency is pi=(9999×19)+(90999×19180)+(900999×2802700)=6235994, while for zero we have p0=(90999×9180)+(900999×1802700)=3875994. (Here is some help on this.) Thus x0=−2124/5994, and xi=236/5994 for i≠0, so that 1−0.5∑xi2≈0.93, reducing the estimate of the chance we seek by some 7%. The impact of zero being less frequent than the other digits is much less than you might suppose!

      What's Christmas times Easter minus baptism?

      What's Christmas times Easter minus baptism?

      Now suppose that 100 of the three-digit numbers are eliminated, either because they are carols or hymns for other special occasions like Easter or baptism, or because the book has fewer than 999 hymns. The chances of the hymn numbers having 1, 2 or 3 digits are then 9/899, 90/899 and 800/899, which leads to the chances of the two combinations having exactly ten digits, on the same assumptions as before, being increased to 0.0282 and 0.0476. The overall chance of four hymns having ten digits is estimated as 0.076, about 15% higher than before!

      Overall, unless the number of hymns is radically different from 1000, or a substantial number of them would be selected only on special occasions, the joint impact of these refinements is very little: we still offer 1 in 40,000 as the ball-park chance of Peter's observation for a random Sunday.

      Simulations

      There is another way of estimating the chance of a coincidence such as this one, namely to do a computer simulation. Select four hymns at random with the carols deleted, and repeat the exercise ten million times.

      We chose the Methodist Hymnbook (1933), which has N=984 hymns, with the Carols numbered 117 to 143; and on just 245 occasions in that simulation, all ten digits appeared exactly once. So our estimate of the chance from this simulation is about 1 in 40,800, gratifyingly close to the earlier calculations.

      This suggests that, if you attend 40 "ordinary" services per year, you might expect to wait about 1000 years before sharing Peter's experience. That's a heck of a lot of sermons to sit through!

      More coincidences

      There's bound to be a coincidence in here, somewhere.

      There's bound to be a coincidence in here, somewhere.

      There is a different way of looking at coincidence questions such as this one. Peter's email would have seemed just as interesting if he had said: "All four hymns were prime numbers" (the chance of this is actually about 1 in 1,000, depending on the hymnbook). And it might have been even more interesting if the hymn numbers had been 11, 22, 111 and 222 for example. So while the chance of one particular interesting coincidence was 1 in 40,000, the chance of some unspecified interesting coincidence in the numbers will be considerably higher, and impossible to calculate.

      Indeed, as David Wells' famous Dictionary of curious and interesting numbers makes clear, the vast majority of numbers between 1 and 1,000 are curious or interesting in their different ways, making the chance of a mathematician finding something of interest in next Sunday's hymn list something close to 100%!


      About the authors

      John Haigh teaches maths at Sussex University, and Rob Eastaway is currently President of the Mathematical Association. Their book, subtitled The hidden mathematics of sport was republished under its new title Beating the Odds in August 2007.

      • Log in or register to post comments

      Read more about...

      coincidence
      probability
      statistics
      University of Cambridge logo

      Plus is part of the family of activities in the Millennium Mathematics Project.
      Copyright © 1997 - 2025. University of Cambridge. All rights reserved.

      Terms