# An algorithm for identifying a fruit with words

Let's say a person picked up a fruit and wanted to identify it.

The person knows certain features about the fruit, such as its color and where it was plucked from, but not its name. They also have knowledge that's relevant for identifying the fruit, but they're not aware that it's relevant (such as the color of the soil below them).

What algorithm could you use to narrow the space of possible answers, such that you could identify the fruit with questions and facts alone?

For an example of how an algorithm/software might work:

Question One

"Is this fruit red?"

Yes / No

Question Two

"Did you find this fruit in May?"

Yes / No

Question Three

"Does this fruit taste sour?"

Yes / No

Question Four

"Does the fruit feel hard?"

Yes / No

A bit like the game of 20 Questions, except in this case, the person does not know what the answer may be—only certain characteristics of the answer.

Is there any algorithm or approach that might work to solve this problem in this particular way?

• I thought about decision trees. Do you think something like that might work? Or did you try something but got stuck?
– Juho
Commented Apr 23, 2020 at 18:59
• I haven't tried decision trees yet, but I have read briefly about them. I'm a novice and unfamiliar with algorithms in general, so I wasn't sure whether it was a good approach for this kind of problem, but I'm willing to try if that's where I should start. Commented Apr 23, 2020 at 19:04
• @Dante I am specifically thinking of dichotomous trees (usually used in biology). It's pretty much a specialized decision tree. Commented Apr 23, 2020 at 19:16