20个问题能猜出你所想,人工智能离我们越来越近。

没玩过这个游戏的可以在这个网站上体验一下,看看它是否可以在20个问题以内猜出你所想。

http://20q.net/

我用绿豆做的实验,在我模糊的回答后,23个问题后成功猜出绿豆。

引用网友的一段解释:

You can think of it as the Binary Search Algorithm. In each iteration, we ask a question, which should eliminate roughly half of the possible word choices. If there are total of N words, then we can expect to get an answer after log2(N) questions.

With 20 question, we should optimally be able to find a word among 2^20 = 1 million words.

One easy way to eliminate outliers (wrong answers) would be to probably use something like RANSAC. This would mean, instead of taking into account all questions which have been answered, you randomly pick a smaller subset, which is enough to give you a single answer. Now you repeat that a few times with different random subset of questions, till you see that most of the time, you are getting the same result. you then know you have the right answer.

Of course this is just one way of many ways of solving this problem.

决策树在人工智能中用的很多,很多相关算法。

A decision tree supports this kind of application directly. Decision trees are commonly used in artificial intelligence.

A decision tree is a binary tree that asks "the best" question at each branch to distinguish between the collections represented by its left and right children. The best question is determined by some learning algorithm that the creators of the 20 questions application use to build the tree. Then, as other posters point out, a tree 20 levels deep gives you a million things.

A simple way to define "the best" question at each point is to look for a property that most evenly divides the collection into half. That way when you get a yes/no answer to that question, you get rid of about half of the collection at each step. This way you can approximate binary search.

关于20个问题的算法和原理可以参考wiki。

https://en.wikipedia.org/wiki/Twenty_Questions

https://en.wikipedia.org/wiki/Random_sample_consensus

https://stackoverflow.com/questions/887533/how-do-20-questions-ai-algorithms-work

http://en.wikipedia.org/wiki/Decision_tree_learning

http://en.wikipedia.org/wiki/Decision_tree

Wikipedia: k-Nearest Neighbor Algorithm

发表评论