Post hoc ergo propter hoc (Latin: "after this, therefore because of this") is a logical fallacy (of the questionable cause variety) that states "Since event Y followed event X, event Y must have been caused by event X." It is often shortened to simply post hoc fallacy. It is subtly different from the fallacy cum hoc ergo propter hoc ("with this, therefore because of this"), in which two things or events occur simultaneously or the chronological ordering is insignificant or unknown. Post hoc is a particularly tempting error because temporal sequence appears to be integral to causality. The fallacy lies in coming to a conclusion based solely on the order of events, rather than taking into account other factors that might rule out the connection.
The following is a simple example:
The rooster crows immediately before sunrise; therefore the rooster causes the sun to rise.
The form of the post hoc fallacy can be expressed as follows:
When B is undesirable, this pattern is often extended to the inverse: Avoiding A will prevent B.