Strategizing in the Bowl of Balls Game: Tips for Maximizing Your Chance of Winning

Mohammad Hatoum
3 min readDec 19, 2022

--

Photo by Clément Rémond on Unsplash

Are you a fan of strategy games that involve selecting and manipulating numbers? If so, you might want to give the Bowl of Balls (BOB) game a try. In this game, players select two balls from a bowl containing numbers from 1 to 50 and aim to achieve a difference between 5 and 15. But it’s not as simple as just picking any two balls — players have the option to discard one of the two balls and draw a new one up to three times before ending their turn. The player with the highest ball difference wins, and in the case of a draw, the player with the highest ball wins.

Saying that, what is the best strategy for this game? Should players always discard the minimum, maximum, or something else?

In order to analyze the optimal strategy for BOB, we used a Q-learning agent to simulate the game and collect data on the actions taken in different situations. After simulating 100K, 1 million, and 5 million episodes, the Q-learning agent produced a 50-by-50 array showing the actions taken for each possible pair of balls.

Here is the complete code:

And here are the results after displaying the values of the Q-table

Best Action for Each State after 100K, 1M, and 5M episodes

A bar plot with three bars for each action in the data, one for each data set. The x-axis will show the unique values (actions) and the y-axis will show the counts of each action in the data.

Bar plot for each unique action in the data

From the data, it appears that the most frequently taken action for a given pair of balls is to stand (value 2). This suggests that, in general, it is more advantageous for the player to keep their current pair of balls rather than discard one of them and get a new one.

However, there are some situations where it might be better to discard either the minimum or maximum ball. For example, if the difference between the two balls is less than 5 or greater than 15, then it might be advantageous to discard one of the balls and try to get a pair with a difference that is within the target range.

In order to determine which ball to discard in these situations, it might be helpful to consider the distribution of values in the bowl of balls. If the distribution is skewed towards one end or the other (i.e. there are more low or high-numbered balls), then it might be better to discard the ball that is more likely to be replaced with a ball of a more advantageous value.

In summary, the best course of action in the BOB game depends on the current ball values and difference, as well as the overall distribution of ball values. Discarding the minimum ball may be advantageous if the ball values are skewed towards the high end, while discarding the maximum ball may be beneficial if the values are skewed towards the low end. Standing may be the best option if the current difference is close to the desired range or if the ball values are relatively balanced.

So the next time you play the BOB game, keep these strategies in mind and see if you can come out on top!

--

--

Mohammad Hatoum

CTO | DevOps | Full Stack Development | Software Engineer | Machine and Deep Learning | Blockchain and Web3 developer | Business Development | Project Manager