What is the Origin of the idiom 20 questions?

There is a game of Twenty Questions. One person decides on a secret thing or person to think of. The other has 20 chances to ask yes;no questions to narrow down and guess the answer.