Steve Ballmer's incorrect binary search interview question
Steve Ballmer's interview question about a guessing game has been criticized for miscalculating expected value. Analysis shows the game's expected value is positive, highlighting the importance of accurate calculations in game theory.
Read original articleSteve Ballmer's interview question regarding a guessing game based on binary search has been critiqued for its flawed expected value calculation. In the game, candidates guess a number between 1 and 100, receiving monetary rewards based on the number of guesses taken. Ballmer asserts that players should decline to play due to the negative expected value and the potential for him to choose numbers that complicate the guessing process. However, analysis reveals that if Ballmer selects numbers randomly, the expected value of the game is actually positive, at $0.20. This discrepancy arises from the way the game is structured, particularly the payouts associated with each guess. The binary search strategy, which is optimal for guessing, would yield a positive outcome for the player in many scenarios. The discussion highlights the importance of accurately calculating expected values in game theory and the implications of incomplete information in strategic decision-making. Ballmer's assertion may stem from a misunderstanding of the game's mechanics, particularly if he intended to imply that he could change his chosen number during the game.
- Ballmer's interview question involves a guessing game with monetary rewards.
- He claims the expected value is negative, but analysis shows it is actually positive.
- The game structure and guessing strategy significantly affect outcomes.
- The discussion emphasizes the relevance of accurate expected value calculations in game theory.
- Misunderstandings in game mechanics can lead to incorrect conclusions about strategy.
Related
HAMURABI.BAS and Its Dystopian Lessons
The article explores the game HAMURABI.BAS from 1973, highlighting financial and political lessons. Strategies involve resource management, disaster response, and controlled starvation for wealth. Automated testing led to a 99% win rate, emphasizing wise investments and strategic decisions in the game.
Is Steve Ballmer the Most Underrated CEO of the 21st Century?
Steve Ballmer, former Microsoft CEO, is reconsidered as underrated. Criticized during his tenure, he showed revenue growth, launched Xbox and Skype, and chose successor Satya Nadella. Ballmer's strategic decisions benefited Microsoft long-term.
Book Review: On the Edge, Nate Silver
Nate Silver's book "On the Edge" contrasts risk mindsets, discusses his 2016 election forecast, explores gambling analytics, and emphasizes expected value in decision-making, blending personal stories with influential profiles.
The shortest, strangest engineering interview I've ever done
Daniel Brain describes an unusual interview with candidate Adam, who preferred online assessments over structured interviews. The encounter ended abruptly, highlighting mismatched expectations and prompting critical follow-up communication from Adam.
Perplexing the Web, One Probability Puzzle at a Time
Mathematician Daniel Litt's engaging probability puzzles reveal misconceptions in mathematical intuition, with only 22% answering correctly. His work fosters discussions and insights among mathematicians and enthusiasts, promoting a supportive online community.
However, if the interviewee assumes that Ballmer is being adversarial, then you can pick a different value as your initial guess, which causes the probabilities to shift. Even the OP assumes that the interviewee will start guessing with 50, but, because of the way binary search works, you can select an initial guess that is offset from 50 (with a randomized offset each time) to defeat trivial adversarial attacks that attempt to game the heuristic, while still mostly reaping the benefits of binary search.
I'd be interested to see someone do the analysis of what the optimal random-offset-selection algorithm would be to counter trivial adversarial choices.
Honestly, I don't want to work in an environment like that, it was a large US bank and where their biggest problems are not product innovation or focusing on customer but production failures! An area I have rescued several large companies in, apart from payments expertise and made sure I communicated this. But sometimes you get lucky and don't have to find out the hard way that this place is not pleasant.
Absolutely yes. I like games. The purpose of games is to have fun. This seems like a fun game for like the first $20, a sum I can afford to play a fun game for 10 minutes.
Then at the end, I get to say "I once lost $20 to Steve Balmer playing binary search", which is a fun sentence I can dine out on, and is worth more than $20 to me.
I feel like perhaps this is why MS under Balmer lost relevance. Too busy looking at the technical and not the human.
For example, recently a colleague had a problem with a rendering tool for Figma, of which we don't have the source code. The tool would take too long exporting a specific design. The team mate tried changing things randomly for days to no avail. Each try would take hours and sometimes crashed the browser.
The solution I gave him was to remove half of the elements and check how that affects the exporting time. Then keep repeating for the groups that still failed. In a matter of hours he found the element that caused a seemingly infinite loop.
Sort of an opposite impostor syndrome?
Turns out he was using this one question to reject people his whole career.
It was a humbling experience to all of us, to recheck everything before we asked questions. Most of the candidates you interview are perfect hires. Some times its you who is wrong.
Which is not surprising, because she's a professional journalist! It's amazing that Ballmer (like so many technical interviewers) is so pleased with this question that he couldn't help bringing it up, even though it's not really that relevant to Chang's question.
from itertools import count
from statistics import mean
INITIAL_PAYMENT = 5 # dollars paid if first guess is correct, minus 1 for each incorrect guess
RANGE = range(1, 101) # the range of numbers to guess from
def simulate_guess(target):
low = min(RANGE)
high = max(RANGE)
for bad_guesses in count():
match guess := (low + high) // 2:
case _ if guess < target:
low = guess + 1
case _ if guess > target:
high = guess - 1
case target:
return INITIAL_PAYMENT - bad_guesses
average_payout = mean(map(simulate_guess, RANGE))
print(f"\nExpected value per game: ${average_payout:0.2f}")
Absolutely. Best case I can tell everyone I beat Steve Ballmer in a bet. Worst case I tell him to take his winning dollars out my first paycheck...
Eg. Can I stop at any time? If yes, I will stop before I go into the negative. If I cannot stop but must continue the game until I guessed the right number, I will most likely lose money. Then go into a simple computation of XY terms where X is the probability and Y is the payout or loss for maybe a dozen terms.
Ballmer states the question as "I'm thinking of a number between 1 and 100." He does not state that the number is an integer. If he's thinking of anything other than an integer, you're unlikely to be successful in finding it via binary search.
What if you combine binary search and game theory?(knowing that he’s trying to beat me and that binary search is my best strategy I have information reducing the randomness of the selection. I know Ballmer is going to choose worst case numbers like 58)
begin with binary search to narrow down the range, then within the range guess the binary search worst case answers. It’s still not guaranteed to win, but might be fun for the chance of taking his money.
Although leading by telling him that the worst case for the optimal algorithm of binary search on n=100 also gets you the job at Microsoft which is worth more than the two bucks you might earn playing the game.
Nice write-up anyway, and yes, Ballmer is wrong.
> Ballmer states that the answer is "No" for two reasons: firstly, because he can pick numbers that'll be the most difficult for you...
The article goes on to show that there are numbers where a binary search always has the guesser paying $1
Deep down we all know what programming, was supposed to be about, which is when you drop the ego and channel your childlike creative curiosity to create something you love, or to find like truth. People who know how to reliably find this state and enjoy it will become an “intelligent” person regardless of their original IQ. When I hire a full time role now, I look for people who are best able to channel this in the context of our team and our mission.
The problems come in when the creative output of the programming is being managed in a capitalistic system. If you take capital with the plans to build something and make money, then you have an entirely new set of constraints. You committed to a deadline so now you lose the ability to say “no”. Most programmers hate scrum/agile with a passion because these processes are basically the manifestation between the conflicts and misunderstandings that happen between shareholders and creators.
To which he literally has no answer: "I learned you need to step back and really ask if you're going to make money on this thing".. uh, okay Steve. Cool. Thanks for your contribution to possibly the worst technical hiring practices in just about any professional field. The technicals are less interesting than seeing even he himself has no real justification for this kind of intellectual hazing.
With that said, I wanted to share the following. Perhaps it will spur discussion.
Our leadership -- whether in our professional circumstances, in our sovereign and communal circumstances, or in our choice to lead ourselves; perhaps it is in these leaders that a view, or a decision, or a proclamation -- perhaps it is in these impulses that the world is changed.
Can you assign truth to an impulse? Is it a communication for consideration? Is it a demand for compliance?
I assert that you can do so. The words were spoken. Thus, the impulse was true.
If you desire to do so, please consider.
Related
HAMURABI.BAS and Its Dystopian Lessons
The article explores the game HAMURABI.BAS from 1973, highlighting financial and political lessons. Strategies involve resource management, disaster response, and controlled starvation for wealth. Automated testing led to a 99% win rate, emphasizing wise investments and strategic decisions in the game.
Is Steve Ballmer the Most Underrated CEO of the 21st Century?
Steve Ballmer, former Microsoft CEO, is reconsidered as underrated. Criticized during his tenure, he showed revenue growth, launched Xbox and Skype, and chose successor Satya Nadella. Ballmer's strategic decisions benefited Microsoft long-term.
Book Review: On the Edge, Nate Silver
Nate Silver's book "On the Edge" contrasts risk mindsets, discusses his 2016 election forecast, explores gambling analytics, and emphasizes expected value in decision-making, blending personal stories with influential profiles.
The shortest, strangest engineering interview I've ever done
Daniel Brain describes an unusual interview with candidate Adam, who preferred online assessments over structured interviews. The encounter ended abruptly, highlighting mismatched expectations and prompting critical follow-up communication from Adam.
Perplexing the Web, One Probability Puzzle at a Time
Mathematician Daniel Litt's engaging probability puzzles reveal misconceptions in mathematical intuition, with only 22% answering correctly. His work fosters discussions and insights among mathematicians and enthusiasts, promoting a supportive online community.