Sub topic 5
Repetition and the habit strength curve
This chapter explains how repeating an action in the same context builds habit strength, and why that growth is a curve that levels off rather than a switch that flips on a set day. It assumes you have read the earlier chapters on what a habit is and on cue-response links. You should be comfortable with the idea that a context (a place, a time, a preceding action) can trigger a response. Short Python snippets appear, but you can follow the chapter without running them.
What "strength" means here
In habit research, habit strength is the strength of the learned link between a context and a response. A strong link means the context brings the action to mind with little deliberate thought. A weak link means you still have to decide each time.
Strength is not the same as how often you do the action. You can do something often because you are highly motivated, and that is goal-directed behavior. You can also have a strong habit that you rarely get to use, because its context rarely occurs. Strength describes how automatically the context triggers the action.
Repetition builds this strength through a simple process. Each time you perform the action in its usual context, the cue-response association is reinforced. Over many repetitions the association comes to do the work that your intention did at the start.
Why repetition has to happen in a context
Doing something many times is not enough. The repetitions must occur in a reasonably stable context, so that the same cue is present each time. Suppose you stretch once at home in the morning, once at work at lunch, and once in a hotel at night. You have practiced the action three times, but you have not tied it to any one cue. Each performance still depends on remembering and deciding.
A stable context gives the learning something to attach to. The cue can be a time of day, a location, a preceding action, or a mix of these. The same cue should be present for most repetitions.
The shape of the curve
Studies that track self-reported automaticity over weeks tend to find a pattern. Early repetitions add a lot of strength each. Later repetitions add less. The curve rises steeply at first, then flattens toward a ceiling, called an asymptote. This is the general shape of many learning curves.
The diagram below shows a typical curve from the simple model used later in this chapter. The values are illustrative, not measured data.
Two practical points follow from the shape:
- The early days matter most for the link, but they feel hardest. Strength is growing fastest when the action still takes the most effort, so progress is easy to miss.
- Later repetitions have diminishing returns. Once the habit is strong, extra repetitions add little. The goal then shifts from building the habit to keeping its context stable.
A simple model you can run
The first snippet is deliberately simple. Each repetition closes a fixed fraction of the remaining gap between current strength and the maximum of 1. The fraction is the rate.
def update_strength(strength, performed, rate=0.05):
"""Return the new habit strength (0 to 1) after one day.
Strength rises only when the action is performed in its usual context.
Each repetition closes a fixed fraction of the remaining gap to 1.
"""
if performed:
return strength + rate * (1 - strength)
return strength
strength = 0.0
for day in range(1, 8):
strength = update_strength(strength, performed=True)
print(day, round(strength, 3))Running it prints these values:
| Day | Strength |
|---|---|
| 1 | 0.05 |
| 2 | 0.098 |
| 3 | 0.143 |
| 4 | 0.185 |
| 5 | 0.226 |
| 6 | 0.265 |
| 7 | 0.302 |
The daily gain shrinks, from 0.05 on day 1 to about 0.037 on day 7. That shrinking increment produces the flattening curve. After n consecutive repetitions the strength is 1 - (1 - rate) ** n, which is where the chart values above come from.
Why there is no fixed number of days
The rate parameter shows why habit formation time varies. The second snippet counts the days needed to reach a chosen strength.
def days_to_threshold(threshold=0.95, rate=0.05, max_days=1000):
strength = 0.0
for day in range(1, max_days + 1):
strength += rate * (1 - strength)
if strength >= threshold:
return day
return None
print(days_to_threshold(0.95, 0.05)) # 59
print(days_to_threshold(0.95, 0.02)) # a slower learner needs more daysWith a rate of 0.05 the threshold is crossed on day 59. With a rate of 0.02 it takes 149 days, about two and a half times longer. Nothing about the shape of the curve changed. Only its steepness did.
Real data show the same spread. In a well-known study by Lally and colleagues, 96 volunteers chose a new daily behavior, such as eating a piece of fruit with lunch or running for 15 minutes after dinner, and rated its automaticity over 12 weeks. Among participants whose data fit a rising curve, the time to reach about 95% of their own plateau ranged from 18 to 254 days, with a median of 66 days. Simpler behaviors tended to become automatic sooner than more demanding ones. The popular claim that habits form in 21 days is not supported by this research, and the next chapter looks at that claim in detail.
Several factors plausibly change the rate:
- Complexity of the action. Drinking a glass of water is quicker to automate than a 30-minute workout.
- Consistency of the cue. A cue that is the same each day gives faster learning than one that varies.
- Rewards. Outcomes that feel good soon after the action help the link form, as the previous chapter described.
- Individual differences and the person's starting point. Prior routines and personality can speed up or slow down learning.
What happens when you miss a day
The simple model above does nothing on a missed day: strength stays where it was. That matches one finding from the Lally study, where missing a single opportunity did not noticeably disrupt the overall growth of automaticity. It does not mean misses cost nothing. Missing many days means missing the repetitions that build strength, and long gaps may let the link weaken.
You can extend the model to include a small loss on missed days. The code below adds a decay parameter. It is a modeling choice for exploring the idea, not an estimate from data.
def update_with_decay(strength, performed, rate=0.05, decay=0.01):
"""Gain on performed days, lose a small fraction on missed days."""
if performed:
return strength + rate * (1 - strength)
return strength * (1 - decay)
def run(schedule, rate=0.05, decay=0.01):
strength = 0.0
for performed in schedule:
strength = update_with_decay(strength, performed, rate, decay)
return strength
steady = [True] * 30
one_miss = [True] * 14 + [False] + [True] * 15
long_gap = [True] * 10 + [False] * 10 + [True] * 10
print(round(run(steady), 3))
print(round(run(one_miss), 3))
print(round(run(long_gap), 3))The three schedules each last 30 days. The steady schedule ends highest. The single miss costs very little, because it removes one gain and applies one small decay. The ten-day gap costs the most, because it removes ten gains. The exact numbers depend on the parameters you pick, so treat the ordering as the lesson.
Common errors when reasoning about repetition
- Counting repetitions in unstable contexts. Fifty repetitions spread across five different cues do not add up to one strong link. Count repetitions per cue.
- Expecting steady progress. Because gains shrink, the habit will feel less different from week to week as it matures. A flat feeling at week 8 does not mean nothing is happening. It may mean the habit is near its plateau.
- Treating a plateau as completion for every behavior. A plateau is the ceiling for that learner, behavior and context. A habit that has plateaued is still tied to its context and can still be disrupted when the context changes.
- Reading one missed day as failure. The evidence suggests an occasional miss is a small setback. Dropping the routine altogether after a miss is the larger risk.
- Confusing frequency with strength. Doing something daily through willpower builds the habit only if the context is stable. Strength shows up as reduced effort and reduced need to think about it, not as a count of days.
Putting it together
Repetition builds habit strength when the same action follows the same cue. Early repetitions add the most strength, later ones add less, and the curve levels off at a ceiling. How fast you climb depends on the behavior, the person and the consistency of the cue, so no single number of days applies to everyone. A model like the one in this chapter is useful for understanding that shape and for seeing that a rate difference alone produces very different timelines.
Exercise
Using the model strength + rate * (1 - strength), a learner starts at 0 and has a rate of 0.10. Without running code, is the strength after one day larger or smaller than for a rate of 0.05, and does the gain on day 2 exceed the gain on day 1? Explain why.
Show answer
After one day the strength is 0.10, which is larger than 0.05 for the slower rate. The gain on day 2 is smaller than the gain on day 1. Day 1 adds 0.10 (1 - 0) = 0.10. Day 2 adds 0.10 (1 - 0.10) = 0.09. Each repetition closes a fixed fraction of a gap that is getting smaller, so the increments shrink and the curve flattens.
Exercise
A person does ten minutes of reading every day, but some days it is after breakfast at the kitchen table, some days on the train, and some days before bed. After eight weeks the reading still feels like something they must remember. Using this chapter's account of repetition, give the most likely reason and one change.
Show answer
The repetitions do not share a stable cue or context, so the learning has nothing consistent to attach to. Repetition builds strength per cue, and the effort of remembering and deciding remains. The fix is to pick one cue, for example "after I pour my evening tea, I read at the kitchen table", and repeat the action there each day so the repetitions all strengthen the same link.
Exercise
Study A reports that a group of learners reached a plateau of automaticity in a median of 66 days, with individual times ranging from 18 to 254 days. A friend says this proves habits take 66 days. What is wrong with that conclusion?
Show answer
A median describes the middle of a wide spread, not a rule that applies to each person. Times ranged from 18 to 254 days, and they differed by behavior, learner and context. Any single learner could need far less or far more time, so no fixed number of days can be promised.