The famous behavioral scientist B. F. Skinner believed that, in order to experimentally analyze human and animal behavior, each behavioral act can be broken down into three key parts. These three parts constitute his three-term contingency: discriminative stimulus, operant response, and reinforcer/punisher. The three-term contingency is fundamental to the study of operant conditioning.
To illustrate the operation of behavioral analysis, the behavior of leaving class when the school day is over can be broken down into the parts of the three-term contingency. The bell, which serves as the discriminative stimulus, is sounded at the end of the school day. When the bell rings, students exit the classroom. Exiting the classroom is the operant response. Reinforcement of leaving the classroom at the proper time results from the other behaviors in which students can engage now that the school day is over.
But, if the same behavior of exiting the classroom occurs prior to the bell's ring (that is, in the absence of the discriminative stimulus), a student now faces punishment. Punishment of leaving class early would result because this behavior violates school rules and leads to a variety of adverse consequences, like staying after school.