this post was submitted on 15 Jul 2025
1096 points (99.5% liked)

Programmer Humor

25425 readers
983 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] tetris11@feddit.uk 7 points 2 weeks ago* (last edited 2 weeks ago) (6 children)

Genuine Question:

if you could split the month names into 3, how would you split them to maximise their choice overlap?

  • "em" is a good overlap for nov/sept/dec
  • "uar" is good for jan/febr
[–] lugal@lemmy.dbzer0.com 3 points 2 weeks ago (5 children)

I assume the post is the maximum. I wonder if there is an algorithm for that

[–] tetris11@feddit.uk 13 points 2 weeks ago* (last edited 2 weeks ago) (4 children)

hierarchical letter clustering would be my guess, or graph-based clustering using ngrams of 2-4 as nodes and maximising for connections.

Or using an optimized Regex and printing out the DFA?

Edit: Quick N-gram analysis (min=3, max=num letters in that month)

R-code

library(ngram)

tmonths = c("january", "february", "march",
           "april", "may", "june", "july",
           "august", "september", "october",
           "november", "december")

zzz = lapply(tmonths, function(mon){
  ng = ngram::ngram_asweka(paste(unlist(strsplit(mon, split="")), collapse=" "), min=3, max=nchar(mon))
  return(gsub(" ", "", ng))
})
res = sort(table(unlist(zzz)))
res[res > 1]

This gives the following 9 ngram frequencies greater than 1:

  ary   uar  uary   emb  embe ember   mbe  mber   ber 
    2     2     2     3     3     3     3     3     4 

As you can see two longest most common motifs are "em-ber" and "uar-y"

Using this I propose the following graph

Mermaid

stateDiagram
    direction LR
    sept --> em
    nov --> em
    dec --> em
    em --> ber
    oc --> to
    to --> ber
    feb --> uar
    uar --> y
    jan --> uar
    ju --> ne
    ju --> l
    l --> y
    ma --> r
    ma --> y
    r --> ch
    
    a --> p 
    p --> r
    r --> il
    a --> u
    u --> gust

[–] UnrepententProcrastinator@lemmy.ca 4 points 2 weeks ago (1 children)

Thanks for saving me time, my head was already spinning on the previous comment but you made it stop.

[–] tetris11@feddit.uk 1 points 2 weeks ago (1 children)

I'm really disappointed by June, April and August. Without these months, everything would be so neat and orderly

[–] UnrepententProcrastinator@lemmy.ca 3 points 2 weeks ago* (last edited 2 weeks ago)

Freaking romans with their gods and emperors, they couldn't go from unember to duodecember

load more comments (2 replies)
load more comments (2 replies)
load more comments (2 replies)