Fallacy of the undistributed middle
The fallacy of the undistributed middle is a formal fallacy, that is committed when the middle term in a categorical syllogism is not distributed in either the minor premise or the major premise. It is thus a syllogistic fallacy.
Classical formulation 
In classical syllogisms, all statements consist of two terms and are in the form of "A" (all), "E" (none), "I" (some), or "O" (some not). The first term is distributed in A statements; the second is distributed in O statements; both are distributed in E statements; and none are distributed in I statements.
The fallacy of the undistributed middle occurs when the term that links the two premises is never distributed.
In this example, distribution is marked in boldface:
- All Z is B
- (All) y is B
- (All) y is Z
B is the common term between the two premises (the middle term) but is never distributed, so this syllogism is invalid.
Also, a related rule of logic is that anything distributed in the conclusion must be distributed in at least one premise.
- All Z is B
- Some Y is Z
- All Y is B
The middle term - Z - is distributed, but Y is distributed in the conclusion and not in any premise, so this syllogism is invalid.
The fallacy of the undistributed middle takes the following form:
- All Z is B
- Y is B
- Therefore, Y is Z
This can be graphically represented as follows:
where the premises are in the green box and the conclusion is indicated above them.
Here, B is the middle term, and it is not distributed in the major premise, "all Z is B".
It may or may not be the case that "all Z is B," but this is irrelevant to the conclusion. What is relevant to the conclusion is whether it is true that "all B is Z," which is ignored in the argument. The fallacy is similar to affirming the consequent and denying the antecedent. However, the fallacy may be resolved if the terms are exchanged in either the conclusion or in the first co-premise. Indeed, from the perspective of first-order logic, all cases of the fallacy of the undistributed middle are, in fact, examples of affirming the consequent or denying the antecedent, depending on the structure of the fallacious argument.
The middle term is the one that appears in both premises — in this case, it is the class of backpack carriers. It is undistributed because neither of its uses applies to all backpack carriers. Therefore it can't be used to connect students and my grandfather — both of them could be separate and unconnected divisions of the class of backpack carriers. Note below how "carries a backpack" is truly undistributed:
- grandfather is someone who carries a backpack; student is someone who carries a backpack
Specifically, the structure of this example results in affirming the consequent.
However, if the latter two statements were switched, the syllogism would be valid:
- All students carry backpacks.
- My grandfather is a student.
- Therefore, my grandfather carries a backpack.
In this case, the middle term is the class of students, and the first use clearly refers to 'all students'. It is therefore distributed across the whole of its class, and so can be used to connect the other two terms (backpack carriers, and my grandfather). Again, note below that "student" is distributed:
- grandfather is a student and thus carries a backpack
See also 
- Undistributed Middle entry in The Fallacy Files