[HN Gopher] Covering All Birthdays
       ___________________________________________________________________
        
       Covering All Birthdays
        
       Author : the_origami_fox
       Score  : 38 points
       Date   : 2024-07-27 09:44 UTC (4 days ago)
        
 (HTM) web link (liorsinai.github.io)
 (TXT) w3m dump (liorsinai.github.io)
        
       | Andrex wrote:
       | Aren't there 366 birthdays, not 365?
       | 
       | Are leap-day births unpersons?
        
         | paulddraper wrote:
         | No but they rarely have birthdays
        
           | upon_drumhead wrote:
           | If we're going off of rarity, December 25 has 6,574 average
           | yearly births and September 9 has almost double at 12,301
           | average yearly births.
           | 
           | Taking a look at Feb 29th, it has 10467 average yearly births
           | (for years that have a Feb 29th).
           | 
           | So what is the level of rarity that makes a day not worth
           | calculating?
           | 
           | https://github.com/fivethirtyeight/data/blob/master/births/U.
           | ..
        
             | paulddraper wrote:
             | > it has 10467 average yearly births (for years that have a
             | Feb 29th)
             | 
             | do you see it?
        
               | hnbad wrote:
               | To spell it out: leap years happen less than every four
               | years, so the average birth rate over four years is
               | actually closer to 2,616 - quite outside the range of
               | 6,574 - 12,301.
        
         | wrs wrote:
         | "I will leave out extra material from the original including
         | [...] accounting for leap years"
        
         | illusive4080 wrote:
         | I wonder if most celebrate March 1 or February 28 most of the
         | time? March 1 is more accurate time-wise but February 28 keeps
         | within the same month.
        
           | paulddraper wrote:
           | Most do March 1. That comports withs the legal recognition of
           | age.
           | 
           | But some will do Feb out of consistency of month.
        
             | hnbad wrote:
             | Some cultures (not the US apparently) consider wishing an
             | early birthday bad luck so I'd expect them never to
             | celebrate on Feb 28. I know this is a thing in Central
             | Europe, not sure how common it is. It was a big culture
             | clash in a company I know when they moved HQ from Germany
             | to the US because the Germans would get offended by
             | Americans wishing them happy birthday when their birthdays
             | were on the weekend or a bank holiday.
        
         | brudgers wrote:
         | The Islamic calendar has 354 or 355 days.
         | https://en.wikipedia.org/wiki/Islamic_calendar
         | 
         | File under "Falsehoods programmers believe about time."
        
           | ronsor wrote:
           | There are approximately 3651/4 days in a standard solar year.
        
       | contravariant wrote:
       | If you're going to write conditional probabilities with big
       | parentheses don't forget to make the \vert big as well. You can
       | use \middle if you want to automatically match \left and \right.
       | 
       | Also conditional probabilities aren't really the right tool when
       | all you want is to set a parameter, but it works I guess.
        
       | mxwsn wrote:
       | The cover of Bayesian Data Analysis 3 shows that empirically,
       | birthdays are not uniformly distributed. The fall has 10-20% more
       | births than other months, and holidays are significantly
       | underrepresented.
       | 
       | https://lh3.googleusercontent.com/proxy/OZtu7ACWp4X283a4e5Pg...
        
         | madrox wrote:
         | Was going to mention this myself. The nuance of this problem is
         | fascinating! Always check your assumptions on the underlying
         | distributions.
        
       | throwaway211 wrote:
       | I'm curious why the author thought it necessary to default to
       | simulate a numerical distribution.
       | 
       | Perhaps maths is not taught or appreciated in CS much now.
        
         | tantalor wrote:
         | Sometimes simulation is your only option, so this is a good
         | skill to have in that case. This is meant to show both
         | approaches.
        
         | lmpdev wrote:
         | Applied mathematics and computational science are both just
         | simulation a lot of the time
         | 
         | Often analytic solutions aren't required for sufficient insight
         | into most problems, despite their parsimoniousness/prettiness
        
         | hipadev23 wrote:
         | just wait til you find out how LLMs work
        
         | qingcharles wrote:
         | Because my maths is far weaker than my coding skills, I would
         | have chosen simulation to give me a rough figure, rather than
         | no answer; so the OPs simulation fascinated me when compared to
         | the mathematical answer.
        
       | fardo wrote:
       | Nice, this problem is isomorphic to the probability/graph theory
       | problem "hunters and rabbits" from Matousek's discrete math
       | textbook, except with the slight modification that instead of "n
       | hunters with perfect accuracy each randomly and simultaneously
       | shoot one rabbit among a set of m rabbits", it's "n birthday
       | havers each simultaneously have a birthday among m=365 days"
       | 
       | There is a closed form solution to this problem's expectation for
       | arbitrary n and m, which I've linked below:
       | 
       | https://math.stackexchange.com/questions/610250/a-question-o...
        
       ___________________________________________________________________
       (page generated 2024-07-31 23:01 UTC)