How to make Numeron AI

Basic Rules

Each player creates a three-digit number using three of the ten cards with numbers from 0-9. There are no duplicate cards, so you cannot use more than two of the same number, such as “550” or “377”.
The first player to attack guesses the opponent’s number and calls. The opponent compares the called number with his or her own number and announces how well the called number matches. If the number and digits are correct, it is called “EAT”; if the number is correct but the digits are not, it is called “BITE”.
As an example, if the opponent’s number is “765” and the called number is “746”, then “7” among the three digits is an EAT because the digit positions match, and “6” is a BITE because the digit positions are different although the numbers themselves match.
This is repeated by the first and second player, and the first player to completely guess the opponent’s number (or to make the opponent announce 3EAT if it is a 3-digit number) wins.


Source: Wikipedia, the free encyclopedia

There is nothing special to mention, so let’s move on.

How to create an AI
Policy
First of all, there are 720 possible combinations of numbers that the player can call in Numeron. This means that the AI will choose one number combination out of these 720 choices every turn.

So, we will calculate how much the opponent’s number candidates will be reduced by calling each of the 720 number combinations, and call the number combination with the lowest number.

Implementation
Preliminary preparations
Save a list of 720 number combinations that can be called by Numeron as candidates for the opponent’s numbers.

First turn
As a matter of course, on the first turn, all number combinations show the same expected value, so we call a random number.
Based on the result (combination of EAT and BITE), update your opponent’s number candidates.

After the second turn
For each combination of 720 numbers, we look at the expected value of the number of candidate numbers of the opponent that will remain as a result of calling that number.

As an example, let’s consider calling a certain number combination A when the opponent’s candidate number is 400.

(EAT,BITE) (0,0) (0,1) (0,2) ・・・ (3,0) Total
Number of candidates 120 200 300 1 720
Number of overlapping candidates X 20 40 80 1 400
Probability p 20/400 40/400 80/400 1/400 1
X x p 1 4 16 1/400 100


In this case, we calculate the number of candidates that can be returned as the result of each of the 9 combinations of (EAT, BITE). This is determined for all combinations of numbers, so the total number is 720.
Next, we calculate the number of candidates that overlap with the current opponent’s number candidates.
Since we want to find the expected value of A, we need to find the probability that each of the 9 (EAT, BITE) will be returned when we call A.
This is simply a matter of dividing the number of overlapping candidates by 400.
Since it is the number of overlapping candidates that we want to find, we multiply them by the probability p and add them all up.

In this case, 100 is the expected value of the number of candidates of the opponents’ numbers that will remain as a result when A is called.

After examining 720 combinations, we call the combination of numbers with the minimum expected value, and update the number of candidate numbers for the opponent based on the result (combination of EAT and BITE).

The nth turn
When the number of elements in the list becomes 1, it calls the number.
When the number of elements in the list reaches 2, call one of the numbers at random.
When the opponent is ahead and guesses the AI’s number, the AI calls a number from the list at random.

Results
I was able to guess the number in about 4-6 turns.

Translated with www.DeepL.com/Translator (free version)