I’m thinking about writing a program that asks the user to think of an object(a physical one) and then it asks questions about the object and tries to figure out what the user was thinking. (Similar to http://20q.net)
I tried to do it in Python but figured my approach was naive and would be very inefficient. How would you guys do this?
Doing this efficiently requires a somewhat advanced method in probability called Kullback-Liebler Divergence. Applied to decision trees (which is what you want to do) it is often called Information Gain.
But don’t let that stop you! Do some searches for implementation samples of decision trees and start from there. I’d write a much simpler program before you go about solving 20 Questions.
Also, take a look at http://www.20q.net/ . Click “Think in English” then “Classic 20Q”. It’s scary good, sometimes.