Some time ago a friend shared the following with me. What I find interesting about this question is that it is ambiguous, with the ambiguity neither grammatical (structural) nor lexical. The question is, I think, pragmatically ambiguous.
A bit of background: Linguists, philosophers, and others have long discussed different sources of ambiguity in ordinary language. Lexical ambiguity is caused when two words have the same form (homonymy or homophony) or when a word has more than one meaning (polysemy).* A classic example of lexical ambiguity involves the word(s) bank.
1. I went to the bank.
Sentence 1 is ambiguous because the word bank can mean either a type of financial institution or an area of land next to a river.
Structural ambiguity results when an utterance might have more than one grammatical structure.
2. Flying planes can be dangerous.
Sentence 2, from Noam Chomsky’s (1965) Aspects of the Theory of Syntax, is ambiguous since the phrase flying planes might refer to the activity of flying or to the machines, planes, when they are flying. In the first case the sentence means nearly the same thing as “Flying planes is dangerous”, while in the second it means something like “While flying, planes are dangerous.” These two meanings reflect two different grammatical structures, but on the surface the sentences look and sound alike.
Jokes often exploit ambiguity. Linguist and humor scholar Victor Raskin, for example, includes homonymy/polysemy and syntactic ambiguity among the Semantic Mechanisms of Humor (1984). Often both words and syntactic structure are manipulated to force an ambiguous reading, as in the following (with apologies for the groans they will probably evoke).
How do you make a turtle fast?
Take away his food.
A: I saw a man-eating shark at the aquarium.
B: That’s nothing. I saw a man eating herring at the deli
(I’ll spare you the syntactic analysis. If you’re truly curious, you can see my 1997 MA thesis in which the jokes are mentioned.)
“Pragmatic ambiguity” is sometimes understood as a quality of utterances whose speech act (Austin 1962, PDF here) is unclear. Philosophers of language have also discussed pragmatic ambiguity in sentences whose truth value hinges on listener presupposition or speaker intent.
The joke my friend sent me features neither lexical nor structural ambiguity, yet the joke hinges on understanding the question in more than one way.
If the question is taken as literally and logically complete (a somewhat odd approach that is itself the subject of jokes), it cannot be answered. “If you choose an answer at random, what is your probability of being correct?” Given the nearly infinite number of potential answers to potential questions or problems, there is no way to calculate an answer.
But as philosopher H. Paul Grice (1975) pointed out, we don’t take utterances as logically complete; we assume that people we interact with are cooperating with us. Accordingly, we assume that the things they say are (among other things) relevant and complete. Thus a reasonable person might fill in the necessary limits from context and understand the question to mean, “If you choose an answer to this question at random from a list of four possible answers, what is your probability of being correct?” In that case, we can calculate an answer: 25%.
But wait! Two answers, A and D, are both “25%”. We could instead understand the question to mean, “If you choose an answer to this question at random from the list of four possible answers below in which “25%” appears twice, what is your probability of being correct?” In that case the correct answer is “50%”, but only if the correct answer is 25%. This is a paradox, and thus (potentially) humorous.
* It is difficult to say in principle whether a form and two meanings constitute one word or two. Attempts to define polysemy versus homophony are complex, as my friend Susan Windisch Brown illustrates (PDF here).