Binary Search Is Efficient, But Never Guess Her Age With It
Description
A dark-mode Twitter/X screenshot from Wise (verified, @trikcode, with a lightning bolt badge and Subscribe button). The tweet reads: 'Dear programmers, While binary search is very efficient, if a girl asks you to guess her age, don't say 50 and then 25.' Posted 13:46, 09 Jan 26, with 516K views, 747 reposts, 64 quotes, 22.9K likes, 865 bookmarks. The joke maps the classic O(log n) bisection algorithm onto a social situation where the worst-case first probe (the midpoint of a 0-100 range) is catastrophically offensive - a clean collision of algorithmic optimality and social optimality
Comments
12Comment deleted
Linear search from 18 upward is O(n), but it's the only age-guessing algorithm where every comparison is a compliment
O(log n) guesses, O(1) chance of a second date.
so if the usual life expectancy in Europe and the US in women is 80-ish, isn't it a trisection? should we start with 40 and then 20? Comment deleted
And since one is usually able to tell if a woman is 60+, we could start with 30 (and then 18 instead of 15) Comment deleted
guess 32.00000000004 Comment deleted
All the real ones start with 0 (When doing binary search) Comment deleted
FBI, open up Comment deleted
starting with 50 is too optimistic anyway Comment deleted
Why would a sane person ever start binary search with a non-power-of-2 initial guess?! 🤓 Comment deleted
truth nuke Comment deleted
Ofc not. Go the other way around. Comment deleted
Use ternary search instead. It's less efficient though Comment deleted