brain teaser: Mr. Honest, Mr. Liar, and Mr. Drunk There are 3 guys, Mr. Honest, that always give the truth answer; Mr. Liar, that always give the false answer; and Mr. Drunk, that gives a random number.
Now: allow you to ask 3 questions, each to be answered by one of them that you could pick up, and of course the questions shall be answerable by simple "Yes" or "No" -- to avoid a Turing machine dead loop.
How to design the 3 questions so you can distinguish them,  Mr. Honest, Mr. Liar, and Mr. Drunk?
 A: *

*Ask Person 1 "Is Person 2 more likely to be truthful that Person 3?" If the answer is "Yes" then Person 3 is not Mr Drunk, if "No" then Person 2 is not Mr Drunk.

*Identify this non-Drunk as ND1, and then ask ND1 a similar question about the other two to identify another non-Drunk ND2.  You now know which one is Mr Drunk by elimination.

*Ask ND2 "if I asked ND1 whether you are Mr Honest, what would he say?".  A "Yes" will tell you ND1 is Mr Honest and ND2 is Mr Liar, while a "No" will tell you ND2 is Mr Honest and ND1 is Mr Liar.     
A: Here is one way to really design the questions.  I am assuming that we can distinguish the three persons by sight, that the persons know each others' identities, and that a later question is allowed to depend on the answer of an earlier one.
Let's write $\;T(x)\;$ for "$\;x\;$ is Mr Honest" (who always speaks the Truth), and similarly $\;F(x)\;$ for Mr Liar and $\;R(x)\;$ for Mr Drunk.  And let's give the arbitrary names $\;a,b,c\;$ to the three men as we distinguish them.
The 'axioms' underlying this type of puzzle are:
\begin{align}
\newcommand{\says}[2]{#1\text{ says }\unicode{x201C}#2\unicode{x201D}}\newcommand{\cansay}[2]{#1\text{ can say }\unicode{x201C}#2\unicode{x201D}}
(0) \;\;\; & \says{x}{P} \;\Rightarrow\; \cansay{x}{P} \\
(1) \;\;\; & \lnot R(x) \;\Rightarrow\; (\cansay{x}{P} \;\equiv\; T(x) \;\equiv\; P) \\
\end{align}
Principle
First, a principle in many of such "knight-knave problems" is to ask someone a question, and even get information out of them if they are lying.  Suppose we want to know whether $\;P\;$ is true, what question $\;Q\;$ must we ask $\;x\;$, and how must we interpret the answer $\;r\;$?  Formally, we want to find a $\;Q\;$ such that
$$
\says{x}{Q \equiv r} \;\Rightarrow\; (P \equiv r)
$$
We avoid the difficult case of drunkenness by assuming $\;\lnot R(x)\;$.  Then
\begin{align}
& \says{x}{Q \equiv r} \;\Rightarrow\; (P \equiv r) \\
\Leftarrow & \;\;\;\;\;\text{"weaken using $(0)$ -- the only thing we know about $\;\says{\cdot}{\dots}\;$"} \\
& \cansay{x}{Q \equiv r} \;\Rightarrow\; (P \equiv r) \\
\equiv & \;\;\;\;\;\text{"by $(1)$ using $\;\lnot R(x)\;$"} \\
& (T(x) \equiv Q \equiv r) \;\Rightarrow\; (P \equiv r) \\
\Leftarrow & \;\;\;\;\;\text{"logic: weaken -- the simplest way to bring both sides together"} \\
& T(x) \equiv Q \equiv r \equiv P \equiv r \\
\equiv & \;\;\;\;\;\text{"logic: simplify; move $\;Q\;$ to the left -- we're solving for $\;Q\;$"} \\
& Q \equiv T(x) \equiv P \\
\equiv & \;\;\;\;\;\text{"by $(1)$ using $\;\lnot R(x)\;$" -- to make the question simpler"} \\
& Q \equiv \cansay{x}{P} \\
\end{align}
Substituting for $\;Q\;$ in the above equation, we've proved that for any $\;x\;$ with $\;\lnot R(x)\;$
$$
\says{x}{\cansay{x}{P} \equiv r} \;\Rightarrow\; (P \equiv r)
$$
In words: Ask any non-drunk person, "Can you say $\;P\;$?", and Yes ($\;r \equiv \text{true}\;$) means that $\;P\;$ is true, and No means that it is false.
The first question: determinism
In our first question, we want to find a non-drunk person, who answers deterministically, so that from the second question on we can apply the above principle.
Since asking Mr Drunk about himself will not generate any information, it seems we must ask one person about the other.  We arbitrarily decide to ask $\;a\;$ about $\;b\;$, trying to find out whether $\;b\;$ is Drunk or deterministic, so whether or not $\;R(b)\;$ is true.
Now, if we already know $\;\lnot R(a)\;$, then we can use the above principle to ask $\;a\;$, "Can you say that  $\;R(b)\;$?"  An answer of Yes means that $\;R(b)\;$, and that $\;c\;$ is therefore deterministic; and similarly an answer of No means that $\;b\;$ is deterministic.
And now the nice thing: in the other case, if $\;R(a)\;$, then both $\;b\;$ and $\;c\;$ are deterministic, so it does not matter who we choose.
Therefore we can just ask $\;a\;$, "Can you say that that person [we point to $\;b\;$ here] is Mr Drunk?"  On Yes, we know $\;c\;$ is deterministic, otherwise $\;b\;$ is.  Let's call this deterministic person $\;d\;$.
The second question: truth
For our second question, we'd like to know whether $\;d\;$ is Mr Honest or Mr Liar.  So we simply apply our principle, and ask $\;d\;$, "Can you say that you are Mr Honest?"  Yes means he is Mr Honest, No means he is Mr Liar.
The third question: randomness
For the third question, all that is left to know is the identity of Mr Drunk.  So we ask $\;d\;$, "Can you say that that person [we point to $\;a\;$ here] is Mr Drunk?" Yes -- again by our principle -- means $\;a\;$ is Mr Drunk, No means he is the 'opposite' of $\;d\;$.
With this, we know the identities of $\;d\;$ and $\;a\;$, and therefore the identity of the third person follows.
