Say I have a finite collection of objects with certain properties, and I want to write software (preferably in Python) that will identify a yes/no question about these properties whose answers are each compatible with approximately half the objects, use the answer to narrow the candidates and then ask another question etc. This binary search algorithm (I don't mean this kind, which searches a sorted array) is famous for its utility in Guess Who, and a larger-scale version for famous and fictional people.
Now for a similar but more complicated problem: I want to use answers to yes/no questions to update probability estimates for each object (e.g. survey questions for a person might make Bayesian inferences about a person's aptitudes, based on a stored probability model), then choose a suitable follow-up yes/no question to learn approximately 1 new bit of information about this probability distribution regardless of the answer. Again, is there a package in Python or any other mainstream data science language that can address this?