this post was submitted on 17 Jan 2026
818 points (99.4% liked)

Programmer Humor

28517 readers
1893 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
 
top 36 comments
sorted by: hot top controversial new old
[–] howrar@lemmy.ca 15 points 1 day ago

What you want is a distribution-aware contextual binary search. With whatever information you have (appearance, personality, vocabulary, etc), you can come up with a probability distribution in the space of possible ages and start your guess with the value at the 50th percentile. Then depending on whether the true age is higher or lower, your next guess will be either the 25th or 75th percentile. Rinse and repeat.

In reality, the way most people intuitively do agree guessing is already an approximation of this procedure.

[–] 18107@aussie.zone 132 points 1 day ago (3 children)

My partner is non-binary, so this search wouldn't work on them.

Quantum partner.

[–] anton@lemmy.blahaj.zone 6 points 1 day ago

While your partner can't be found by it, they can be approximated to an arbitrary degree of precision.

[–] HexaBack@lemmy.blahaj.zone 5 points 1 day ago (1 children)
[–] Ziglin@lemmy.world 1 points 15 hours ago
[–] marcos@lemmy.world 98 points 1 day ago (2 children)

Yes, people some times live up to 120 years. You should start at 60.

[–] SanctimoniousApe@lemmings.world 57 points 1 day ago* (last edited 1 day ago) (1 children)

With the limits of longevity still being pushed, I'd suggest sticking with the OP binary search theme and start at 64.

[–] marcos@lemmy.world 20 points 1 day ago (2 children)

Well, round numbers will indeed make the math easier.

[–] Ziglin@lemmy.world 1 points 15 hours ago

So 64 is absolutely perfect being 1000000 in binary, then all you need to do is go one bit a time for a binary search.

[–] FuglyDuck@lemmy.world 20 points 1 day ago (2 children)

If you like round numbers, 69 is all curves.

[–] LadyMeow@lemmy.blahaj.zone 6 points 1 day ago

What a sexy, sexy number

[–] Klear@quokk.au 1 points 1 day ago

There was something familiar about the number on the desk. The handwriting was all pretty curves.

[–] Goodeye8@piefed.social 5 points 1 day ago (1 children)

And for obvious reasons I think the minimum age has to be 18 so really you should start at 69 (heh, nice).

[–] lefaucet@slrpnk.net 1 points 1 day ago

You have won at the Internet today! Well done!

[–] GreenBeanMachine@lemmy.world 18 points 1 day ago

Yes, do it in reverse. Ask her if she's 25 first, then if she's 50

[–] Someonelol@lemmy.dbzer0.com 9 points 1 day ago (1 children)

There's no right answer to that question. The only winning move is not to play.

[–] davetortoise@reddthat.com 12 points 1 day ago

Jokes on you, refusing to play is also a losing move. The only winning move is to guess 2-3 years less than the correct answer, by sheer luck.

[–] Randelung@lemmy.world 25 points 1 day ago (1 children)

What, and then go 37.5? 24 and 48 are right there.

[–] Alcoholicorn@mander.xyz 6 points 1 day ago (1 children)

32 is half human life expectancy, and a power of 2.

[–] mogranja@lemmy.eco.br 1 points 23 hours ago

Gets my vote

[–] AnarchoEngineer@lemmy.dbzer0.com 53 points 1 day ago* (last edited 1 day ago)

Abbott: “So say you’re 40 and you like a girl that’s 10. Well you’re really too old for her because you’re 4x her age. So let’s say you wait 5years. Now you’re 45 and she’s 15, so you’re only 3x as old as her, but that’s still a bit much, so you wait another 15years and now you’re 60 and she’s 30. Only half your age now.

How long do you have to wait till you’re both the same age?”

Costello: “Well 4 then 3 then 2… at this rate she’d better be willing to wait for me too.”

Abbott: “what do you mean?”

Costello: “Going like this, eventually she’ll be older than me and she better wait for me to catch up.”

Abbott: “Why would she wait for you?”

Costello: “WELL I WAITED FOR HER!”

[–] Jankatarch@lemmy.world 6 points 1 day ago

If she is 101 binary search will fail. Stay woke.

[–] SpaceCowboy@lemmy.ca 17 points 1 day ago

Gotta follow Price is Right rules. Closest without going over.

[–] JasonDJ@lemmy.zip 41 points 1 day ago (1 children)

If she is not 64 then she is 32.

If she is not 32 then she is 16.

overthere.sit(self)

[–] SanctimoniousApe@lemmings.world 48 points 1 day ago (1 children)

At 16, she was FAT. At 32, she was still FAT32. But by 64, she was exFAT.

[–] Dudewitbow@lemmy.zip 32 points 1 day ago

the mistake was assuming the upper limit ended at 100

[–] qjkxbmwvz@startrek.website 25 points 1 day ago (1 children)

Obviously you should use an exponential search, assuming you don't know the age of the oldest human.

[–] capuccino@lemmy.world 4 points 1 day ago

lol I just realized that everytime I play guessing numbers I do this

[–] MonkderVierte@lemmy.zip 6 points 1 day ago (1 children)

What now. "Don't ask a girl her age" but if a girl asks her own age it's also dangerous?

[–] zerofk@lemmy.zip 15 points 1 day ago (1 children)
[–] darklamer@lemmy.dbzer0.com 3 points 1 day ago

They have cooties.

binary search still works fine, you just need a function probability then you cut at the median, and then rucurse into the slices

[–] xxce2AAb@feddit.dk 7 points 1 day ago