Formal fallacies
A fallacy is an error in reasoning. Two of the inference rules described on the preceding page—modus ponens and modus tollens—closely resemble invalid argument forms called affirming the consequent and denying the antecedent. Confusing one of the latter forms with the former is a common logical error. Such a mistake is called a formal fallacy because the error involves mistaking an invalid logical form for a valid one. (Informal fallacies involve mistakes that do not depend simply on logical structure. We’ll discuss some informal fallacies later.) In order to recognize and avoid committing these fallacies, we must carefully distinguish their invalid forms from the valid inference rules they resemble.

Affirming the consequent is an invalid argument form in which one premise is a conditional and the other premise affirms the consequent of that conditional:
Here is an instance of the fallacy of affirming the consequent, where where
x =
(A ∨ B) and
y =
C:
((A ∨ B) ⊃ C) 
C 
∴ (A ∨ B) 
The above argument is invalid. In other words, it is possible for the conclusion to be false even when both premises are true.
This fallacy is easily mistaken for modus ponens (MP). A valid MP form, however, has the antecedent as its second premise, and its conclusion is the consequent. For comparison, here is modus ponens:

Denying the antecedent is an invalid argument form in which one premise is a conditional and the other premise denies the antecedent of that conditional:
Here is an instance of the fallacy of denying the antecedent, where where
x =
A and
y =
(B • C):
(A ⊃ (B • C)) 
~A 
∴ ~(B • C) 
The above argument is invalid.
This fallacy is easily mistaken for modus tollens (MT). A valid MT form, however, denies the consequent of the conditional, and its conclusion is the negation of the antecedent. For comparison, here is modus tollens:
As mentioned on the previous page, all instances of an inference rule (like modus ponens) are valid. However, not all instances of an invalid form are invalid! It is possible for an instance of affirming the consequent or denying the antecedent to be valid, because it is possible for an argument to be an instance of both an invalid form and a valid form at the same time! For example, here is an instance of affirming the consequent that is also a valid instance of modus ponens:
Whenever an argument is an instance of both an invalid form and a valid form at the same time, validity always wins: an argument is valid if it is an instance of at least one valid form, regardless of whether it is also an instance of an invalid form.