Sub topic 1
How consequences shape behavior: the law of effect
Prerequisites
This chapter assumes you know three things:
- What "behavior" and "learning" mean in psychology: behavior is anything an organism does that can be observed and measured, and learning is a lasting change in behavior due to experience.
- The high-level idea of classical (Pavlovian) conditioning, where a neutral stimulus comes to predict an important one.
- How to read a short Python snippet. The code in this chapter is optional, and it only illustrates the ideas.
The core idea
Operant conditioning is learning in which the consequences of a behavior change how likely that behavior is to happen again. A behavior followed by a consequence that matters to the organism becomes more likely in similar situations. A behavior followed by a different kind of consequence becomes less likely.
Behavior that is shaped this way is called operant behavior. The name comes from the fact that the behavior operates on the environment: it produces some change, and that change feeds back on the behavior. Pressing a lever, asking for help, checking a phone, and slamming a door are all operant behaviors.
Thorndike and the law of effect
The principle was first stated clearly by Edward Thorndike around 1898. He put hungry cats in "puzzle boxes". To get out and reach food, a cat had to pull a loop of string or press a pedal. Cats first clawed, pushed, and meowed at random. Eventually one of their actions opened the door by accident.
Across repeated trials, the time to escape fell gradually. There was no sudden insight. Actions that led to escape and food became more frequent, and the others faded.
Thorndike summarized this as the law of effect: responses followed by a satisfying outcome become more likely in that situation, and responses followed by an unsatisfying outcome become less likely. Modern terms replace "satisfying" with reinforcing, since satisfaction is a private feeling that can't be observed. We define the effect by what it does to behavior, not by how it is supposed to feel.
B. F. Skinner later built on this work. He developed the operant chamber (often called a "Skinner box") and recorded responses automatically. Because the chamber lets an animal respond freely at any moment, researchers could study the rate of responding as a direct measure of learning. Skinner also coined the term "operant".
Operant versus respondent behavior
Respondent behavior is elicited by a stimulus that comes before it. In classical conditioning, a puff of air to the eye produces a blink, and a conditioned stimulus can come to produce a similar response. Operant behavior is emitted. The organism does it, and the consequence that follows determines whether it is repeated.
| Feature | Respondent (classical) | Operant |
|---|---|---|
| What controls the behavior | The stimulus before it | The consequence after it |
| Typical behavior | Reflexes and emotional reactions | Voluntary, goal-related actions |
| Organism's role | Responds to events | Acts on the environment |
| Key relation learned | Stimulus predicts stimulus | Behavior produces consequence |
The two kinds of learning often occur together. A dog that hears a can opener may salivate (respondent) and also walk to the kitchen (operant). Treat the table as a guide to the main emphasis, not as a claim that real behavior always falls into one box.
How the process unfolds
The learning loop has three parts that repeat:
- The organism is in some situation and emits a behavior.
- The environment responds with a consequence.
- The consequence changes the probability that the behavior occurs in that situation next time.
Notice that the change is in probability, or frequency, not in a certainty. Operant learning is gradual and statistical. A single reinforcer does not guarantee that the behavior will recur.
Measuring the effect
Because the law of effect is about behavior change, you need a way to measure that change. Common measures include:
- Rate: responses per unit of time, such as lever presses per minute.
- Latency: the time from the start of a situation to the response.
- Frequency or count: how many times the behavior occurs in an observation period.
- Duration: how long the behavior lasts.
You can only say that a consequence worked if one of these measures moves in the expected direction. This is why the definitions in the next chapters rest on observed effects.
The sketch below simulates a simple version of the law of effect. An agent chooses between two actions. One action is followed by a reward and the other is not. After each reward, the chosen action gets a larger weight.
import random
random.seed(7)
weights = {"press_lever": 1.0, "groom": 1.0}
rewarded = {"press_lever"} # only this action produces a reinforcer
step = 0.5 # how much a reinforcer strengthens an action
def choose(weights):
actions = list(weights)
return random.choices(actions, weights=[weights[a] for a in actions])[0]
history = []
for trial in range(200):
action = choose(weights)
if action in rewarded:
weights[action] += step
history.append(action)
early = history[:50].count("press_lever") / 50
late = history[-50:].count("press_lever") / 50
print(f"Share of presses in first 50 trials: {early:.2f}")
print(f"Share of presses in last 50 trials: {late:.2f}")The share of lever presses rises across trials, as the law of effect predicts. The model is a toy. It shows the direction of the effect, but real learners are far more complicated.
Edge cases and common errors
Consequences are defined by their effect. A teacher may praise a student, intending to reward him. If the student then misbehaves more often in order to be singled out, the praise is not reinforcing the helpful behavior. It is reinforcing something else. What matters is what happens to the behavior, not what the person delivering the consequence intended.
The behavior must come first. A consequence only affects the behavior it follows. Payment before the work is a bribe or an advance, and it does not reinforce the work done afterward.
Timing matters. Consequences that follow a behavior immediately usually have the strongest effect. A delay lets other behaviors occur in between, and those may be strengthened instead. This is why a dog trainer marks the exact moment of the desired action, and why a reward given hours later is a weak teacher.
Accidental strengthening can occur. Skinner showed that pigeons given food at fixed intervals, regardless of what they did, often developed odd repeated actions such as turning in circles. He called this superstitious behavior: whatever the bird happened to be doing just before food arrived was strengthened by chance. Later work suggests that the details are debated, but the general point holds that a coincidental pairing can strengthen a behavior.
Learning is not always conscious. People may change their behavior because of consequences without being able to say why. Awareness helps in many cases, but the law of effect does not require it.
Not every behavior is operant. Reflexes, such as the knee jerk, and many emotional reactions are respondent. Biology also limits what can be learned. Animals learn some behavior-consequence links easily and others poorly, depending on their species' evolutionary history.
Why the law of effect matters
It gives a practical question for any behavior you want to understand: what follows it? Instead of asking what a person "wants" or what is "wrong" with them, you can look at what the behavior produces. A child who shouts at bedtime may be getting attention. An employee who skips a meeting may be avoiding an unpleasant discussion. The next chapters build a vocabulary for sorting these cases precisely: the three-term contingency, the four consequence types, and schedules.
Exercise
A rat presses a lever, and a food pellet drops into the tray. Over the next ten minutes, the rat's pressing rate climbs from 2 to 15 presses per minute. (a) Which part of this description is the behavior, which is the consequence, and what is the evidence that learning occurred? (b) Suppose the pellet were delivered 30 minutes after each press instead. Why would you expect weaker learning?
Show answer
(a) The behavior is the lever press. The consequence is the food pellet. The evidence of learning is the increase in response rate from 2 to 15 presses per minute after the consequence began following the behavior. (b) With a long delay, the rat would perform many other behaviors between the press and the food, so those other behaviors could be strengthened instead. The press would no longer be reliably tied to its consequence, so the effect on its rate would be weak or absent.
Exercise
A teacher gives a student a sticker every time he arrives early, and he starts arriving late more often. Does this contradict the law of effect? Explain.
Show answer
Not necessarily. The law of effect is defined by what happens to behavior. If arriving early became less frequent, the sticker was not functioning as a reinforcer for this student, at least for this behavior. Something else could be at work, such as embarrassment about stickers in front of peers, or late arrival producing a stronger consequence like extra attention. The next step is to check what actually follows each behavior.