Can generalized twenty questions be solved by a greedy algorithm? The game of twenty questions can be generalized in the following way.

Let $\Omega$ be a finite set and $\mathcal Q$ a collection of subsets of $\Omega$, called the questions. A point $x\in\Omega$ is chosen unknown to the player, who then has the ability to iteratively choose a set $Q\in\mathcal Q$ and be told whether or not $x\in Q$. The player's goal is to determine $x$.
In order for the game to be solvable, $\mathcal Q$ is assumed to have the property that every $x\in\Omega$ can be realized as the intersection of some collection of elements of $\mathcal Q$ or their complements.

What we want is a strategy to solve this game with optimal worst-case running time.
At any point in the game, we can assign to each question a pair of integers - the number of possibilities that will remain depending on whether the answer is yes or no. Assign to each question a score which is the larger of these two integers, and always pick the question with minimal score. This is the &quot;greedy&quot; strategy.
Does the greedy strategy always have optimal worst-case running time?
No. There's a huge literature on the topic, called combinatorial search theory, you can read more about these types of questions there.
The simplest example that I could think of is the following.

Suppose that you want to find an edge of a graph, and you can ask whether a given vertex is incident to the hidden edge, or not.
Now take the following bipartite graph.
It contains a perfect matching on $100+100$ vertices.
Moreover, it also contains $10$ degree $10$ vertices that are connected to $10$ different vertices each, all on the same side.
So one side of the graph has $100$ vertices, all degree $2$, the other $110$, of which $100$ have degree $1$, the other $10$ degree $10$.

In this case, the greedy algorithm would first query the degree $10$ vertices, and then the rest, taking about $110$ steps.
If instead it started with querying the $100$ vertices of degree $2$, it would be done in $101$ steps.