While a monkey is used as a mechanism for the thought experiment, it would be unlikely to ever write Hamlet.
The infinite monkey theorem states that a monkey hitting keys independently and at random on a typewriter keyboard for an infinite amount of time will almost surely type any given text, including the complete works of William Shakespeare. More precisely, under the assumption of independence and randomness of
each keystroke, the monkey would almost surely type every possible
finite text an infinite number of times. The theorem can be generalized
to state that any infinite sequence of independent events whose
probabilities are uniformly bounded below by a positive number will
almost surely have infinitely many occurrences.
In this context, "almost surely" is a mathematical term meaning
the event happens with probability 1, and the "monkey" is not an actual
monkey, but a metaphor for an abstract device that produces an endless random sequence
of letters and symbols. Variants of the theorem include multiple and
even infinitely many independent typists, and the target text varies
between an entire library and a single sentence.
There is straightforward proof of this theorem. As an introduction, recall that if two events are statistically independent,
then the probability of both happening equals the product of the first
and second events' probabilies. For example, if the chance of rain in Moscow on a particular day in the future is 0.4, and the chance of an earthquake in San Francisco
on any particular day is 0.00003, then the chance of both happening on
the same day is 0.000012 simply by multiplying the probabilities
together, assuming that they are indeed independent.
Let us consider the probability of typing the word banana on a
typewriter with 50 keys. Suppose that the keys are pressed independently
and uniformly at random, meaning that each key has an equal chance of
being pressed regardless of what keys had been pressed previously. The
chance that the first letter typed is 'b' is 1/50, and the chance that
the second letter typed is 'a' is also 1/50, and so on. Therefore, the
probability of the first six letters spelling banana is:
The result is less than one in 15 billion, but not zero.
From the above, the chance of not typing banana in a given block of 6 letters is 1 − (1/50)6. Because each block is typed independently, the chance Xn of not typing banana in any of the first n blocks of 6 letters is:
As n grows, Xn gets smaller. For n = 1 million, Xn is roughly 0.9999, but for n = 10 billion Xn is roughly 0.53 and for n = 100 billion it is roughly 0.0017. As n approaches infinity, the probability Xnapproaches zero; that is, by making n large enough, Xn can be made as small as is desired, and the chance of typing banana approaches 100%. Thus, the probability of the word banana appearing at some point in an infinite sequence of keystrokes is equal to one.
The same argument applies if we replace one monkey typing n consecutive blocks of text with n monkeys each typing one block (simultaneously and independently). In this case, Xn = (1 − (1/50)6)n is the probability that none of the first n monkeys types banana correctly on their first try. Therefore, at least one of infinitely many monkeys will (with probability equal to one) produce a text using the same number of keystrokes as a perfectly accurate human typist copying it from the original.
Infinite strings
This can be stated more generally and compactly in terms of strings, which are sequences of characters chosen from some finite alphabet:
Given an infinite string where each character is chosen independently and uniformly at random, any given finite string almost surely occurs as a substring at some position.
Given an infinite sequence of infinite strings, where each character
of each string is chosen independently and uniformly at random, any
given finite string almost surely occurs as a prefix of one of these
strings.
Both follow easily from the second Borel–Cantelli lemma. For the second theorem, let Ek be the event that the kth string begins with the given text. Because this has some fixed nonzero probability p of occurring, the Ek are independent, and the below sum diverges,
the probability that infinitely many of the Ek
occur is 1. The first theorem is shown similarly; one can divide the
random string into nonoverlapping blocks matching the size of the
desired text and make Ek the event where the kth block equals the desired string.
Probabilities
However, for physically meaningful numbers of monkeys typing for
physically meaningful lengths of time the results are reversed. If there
were as many monkeys as the amount of atoms in the observable universe typing extremely fast for trillions of times the life of the universe, the probability of the monkeys replicating even a single page of Shakespeare is unfathomably small.
Ignoring punctuation, spacing, and capitalization, a monkey
typing letters uniformly at random has a chance of 1 in 26 of correctly
typing the first letter of Hamlet. It has a chance of one in 676 (or 26×26) of typing the first two letters. Because the probability shrinks exponentially, at 20letters it already has only a chance of one in 2620—almost 2×1028, or 20octillion. In the case of the entire text of Hamlet, the probabilities are so vanishingly small as to be inconceivable. The text of Hamlet contains approximately 130,000letters. Thus, there is a probability of one in 3.4 × 10183,946
to get the text right at the first trial. The average number of letters
that needs to be typed until the text appears is also 3.4 × 10183,946, or including punctuation, 4.4 × 10360,783.
Even if every proton in the observable universe (which is estimated at roughly 1080) were a monkey with a typewriter, typing from the Big Bang until the end of the universe (when protons might no longer exist), they would still need a far greater amount of time – more than three hundred and sixty thousand orders of magnitude longer – to have even a 1 in 10500 chance of success. To put it another way, for a one in a trillion chance of success, there would need to be 10360,641 observable universes made of protonic monkeys. As Kittel and Kroemer put it in their textbook on thermodynamics, the field whose statistical foundations motivated the first known expositions of typing monkeys, "The probability of Hamlet
is therefore zero in any operational sense of an event ...", and the
statement that the monkeys must eventually succeed "gives a misleading
conclusion about very, very large numbers."
In fact, there is less than a one in a trillion chance of success
that such a universe made of monkeys could type any particular document
a mere 79 characters long.
The probability that an infinite randomly generated string of text
will contain a particular finite substring is 1. However, this does not
mean the substring's absence is "impossible", despite the event having a
prior probability of 0. For example, the immortal monkey could
randomly type G as its first letter, G as its second, and G as every
single letter, producing an infinite string of Gs; at no point must the
monkey be "compelled" to type anything else (to assume otherwise implies
the gambler's fallacy).
However long a randomly generated finite string is, there is a small
but nonzero chance that it will turn out to consist of the same
character repeated throughout; this chance approaches zero as the
string's length approaches infinity. There is nothing special about such
a monotonous sequence except that it is easy to describe; the same fact
applies to any nameable specific sequence, such as "RGRGRG" repeated
forever, or "a-b-aa-bb-aaa-bbb-...", or "Three, Six, Nine, Twelve…".
If the hypothetical monkey has a typewriter with 90 equally
likely keys that include numerals and punctuation, then the first typed
keys might be "3.14" (the first three digits of pi) with a probability of (1/90)4,
which is 1/65,610,000. Equally probable is any other string of four
characters allowed by the typewriter, such as "GGGG", "mATh", or "q%8e".
The probability that 100 randomly typed keys will consist of the first
99 digits of pi (including the separator key), or any other particular sequence of that length, is much lower: (1/90)100. If the monkey's allotted length of text is infinite, the chance of typing only the digit of pi is 0, which is just as possible (mathematically probable) as typing nothing but Gs (also probability 0).
The same applies to the event of typing a particular version of Hamlet followed by endless copies of itself; or Hamlet immediately followed by all the digits of pi; these specific strings are equally infinite in length, they are not prohibited by the terms of the thought problem, and they each have a prior probability of 0. In fact, any
particular infinite sequence the immortal monkey types will have had a
prior probability of 0, even though the monkey must type something.
This is an extension of the principle that a finite string of random text has a lower and lower probability of being
a particular string the longer it is (though all specific strings are
equally unlikely). This probability approaches 0 as the string
approaches infinity. Thus, the probability of the monkey typing an
endlessly long string, such as all of the digits of pi in order, on a
90-key keyboard is (1/90)∞ which equals (1/∞) which is essentially 0. At the same time, the probability that the sequence contains
a particular subsequence (such as the word MONKEY, or the 12th through
999th digits of pi, or a version of the King James Bible) increases as
the total string increases. This probability approaches 1 as the total
string approaches infinity, and thus the original theorem is correct.
Correspondence between strings and numbers
In a simplification of the thought experiment, the monkey could have a
typewriter with just two keys: 1 and 0. The infinitely long string
thusly produced would correspond to the binary digits of a particular real number
between 0 and 1. A countably infinite set of possible strings end in
infinite repetitions, which means the corresponding real number is rational.
Examples include the strings corresponding to one-third (010101...),
five-sixths (11010101...) and five-eighths (1010000...). Only a subset
of such real number strings (albeit a countably infinite subset)
contains the entirety of Hamlet (assuming that the text is subjected to a numerical encoding, such as ASCII).
Meanwhile, there is an uncountably infinite set of strings that do not end in such repetition; these correspond to the irrational numbers. These can be sorted into two uncountably infinite subsets: those that contain Hamlet and those that do not. However, the "largest" subset of all the real numbers is that which not only contains Hamlet,
but that also contains every other possible string of any length, and
with equal distribution of such strings. These irrational numbers are
called normal.
Because almost all numbers are normal, almost all possible strings
contain all possible finite substrings. Hence, the probability of the
monkey typing a normal number is 1. The same principles apply regardless
of the number of keys from which the monkey can choose; a 90-key
keyboard can be seen as a generator of numbers written in base 90.
History
Statistical mechanics
In one of the forms in which probabilists now know this theorem, with its "dactylographic" [i.e., typewriting] monkeys (French: singes dactylographes; the French word singe covers both the monkeys and the apes), appeared in Émile Borel's 1913 article "Mécanique Statique et Irréversibilité" (Static mechanics and irreversibility), and in his book "Le Hasard" in 1914. His "monkeys" are not actual monkeys; rather, they are a metaphor for
an imaginary way to produce a large, random sequence of letters. Borel
said that if a million monkeys typed ten hours a day, it was extremely
unlikely that their output would exactly equal all the books of the
richest libraries of the world; and yet, in comparison, it was even more
unlikely that the laws of statistical mechanics would ever be violated,
even briefly.
The physicist Arthur Eddington drew on Borel's image further in The Nature of the Physical World (1928), writing:
If I let my fingers wander idly
over the keys of a typewriter it might happen that my screed made an
intelligible sentence. If an army of monkeys were strumming on
typewriters they might write all the books in the British Museum. The
chance of their doing so is decidedly more favourable than the chance of
the molecules returning to one half of the vessel.
These images invite the reader to consider the incredible
improbability of a large but finite number of monkeys working for a
large but finite amount of time producing a significant work and compare
this with the even greater improbability of certain physical events.
Any physical process that is even less likely than such monkeys' success
is effectively impossible, and it may safely be said that such a
process will never happen. It is clear from the context that Eddington is not suggesting that the
probability of this happening is worthy of serious consideration. On the
contrary, it was a rhetorical illustration of the fact that below
certain levels of probability, the term improbable is functionally equivalent to impossible.
Origins and "The Total Library"
In a 1939 essay entitled "The Total Library", Argentine writer Jorge Luis Borges traced the infinite-monkey concept back to Aristotle's Metaphysics. Explaining the views of Leucippus,
who held that the world arose through the random combination of atoms,
Aristotle notes that the atoms themselves are homogeneous and their
possible arrangements only differ in shape, position and ordering. In On Generation and Corruption, the Greek philosopher compares this to the way that a tragedy and a comedy consist of the same "atoms", i.e., alphabetic characters. Three centuries later, Cicero's De natura deorum (On the Nature of the Gods) argued against the Epicurean atomist worldview:
Is it possible for any man to
behold these things, and yet imagine that certain solid and individual
bodies move by their natural force and gravitation, and that a world so
beautifully adorned was made by their fortuitous concourse? He who
believes this may as well believe that if a great quantity of the
one-and-twenty letters, composed either of gold or any other matter,
were thrown upon the ground, they would fall into such order as legibly
to form the Annals of Ennius. I doubt whether fortune could make a single verse of them.
Borges follows the history of this argument through Blaise Pascal and Jonathan Swift, then observes that in his own time, the vocabulary had changed. By
1939, the idiom was "that a half-dozen monkeys provided with typewriters
would, in a few eternities, produce all the books in the British
Museum." (To which Borges adds, "Strictly speaking, one immortal monkey
would suffice.") Borges then imagines the contents of the Total Library
which this enterprise would produce if carried to its fullest extreme:
Everything would be in its blind volumes. Everything: the detailed history of the future, Aeschylus' The Egyptians, the exact number of times that the waters of the Ganges have reflected the flight of a falcon, the secret and true name of Rome, the encyclopedia Novalis would have constructed, my dreams and half-dreams at dawn on August 14, 1934, the proof of Pierre Fermat's theorem, the unwritten chapters of Edwin Drood, those same chapters translated into the language spoken by the Garamantes, the paradoxes Berkeley invented concerning Time but didn't publish, Urizen's books of iron, the premature epiphanies of Stephen Dedalus, which would be meaningless before a cycle of a thousand years, the Gnostic Gospel of Basilides, the song the sirens
sang, the complete catalog of the Library, the proof of the inaccuracy
of that catalog. Everything: but for every sensible line or accurate
fact there would be millions of meaningless cacophonies, verbal
farragoes, and babblings. Everything: but all the generations of mankind
could pass before the dizzying shelves – shelves that obliterate the
day and on which chaos lies – ever reward them with a tolerable page.
Borges' total library concept was the main theme of his widely read 1941 short story "The Library of Babel",
which describes an unimaginably vast library consisting of interlocking
hexagonal chambers, together containing every possible volume that
could be composed from the letters of the alphabet and some punctuation
characters.
Actual monkeys
In 2002, lecturers and students from the University of Plymouth MediaLab Arts course used a £2,000 grant from the Arts Council to study the literary output of real monkeys. They left a computer keyboard in the enclosure of six Celebes crested macaques in Paignton Zoo in Devon, England from May 1 to June 22, with a radio link to broadcast the results on a website.
Not only did the monkeys produce nothing but five total pages largely consisting of the letter "S", the lead male began striking the keyboard with a stone, and other monkeys followed by urinating and defecating on the machine. Mike Phillips, director of the university's Institute of Digital Arts
and Technology (i-DAT), said that the artist-funded project was
primarily performance art,
and they had learned "an awful lot" from it. He concluded that monkeys
"are not random generators. They're more complex than that.[...]
They were quite interested in the screen, and they saw that when they
typed a letter, something happened. There was a level of intention
there."
Despite the original mix-up, monkey-and-typewriter arguments are now common in arguments over evolution. As an example of Christian apologetics Doug Powell argued that even if a monkey accidentally types the letters of Hamlet, it has failed to produce Hamlet
because it lacked the intention to communicate. His parallel
implication is that natural laws could not produce the information
content in DNA. A more common argument is represented by Reverend John F. MacArthur,
who claimed that the genetic mutations necessary to produce a tapeworm
from an amoeba are as unlikely as a monkey typing Hamlet's soliloquy,
and hence the odds against the evolution of all life are impossible to
overcome.
Evolutionary biologistRichard Dawkins employs the typing monkey concept in his book The Blind Watchmaker to demonstrate the ability of natural selection to produce biological complexity out of random mutations. In a simulation experiment Dawkins has his weasel program produce the Hamlet phrase METHINKS IT IS LIKE A WEASEL,
starting from a randomly typed parent, by "breeding" subsequent
generations and always choosing the closest match from progeny that are
copies of the parent with random mutations. The chance of the target
phrase appearing in a single step is extremely small, yet Dawkins showed
that it could be produced rapidly (in about 40 generations) using
cumulative selection of phrases. The random choices furnish raw
material, while cumulative selection imparts information. As Dawkins
acknowledges, however, the weasel program is an imperfect analogy for
evolution, as "offspring" phrases were selected "according to the
criterion of resemblance to a distant ideal target." In
contrast, Dawkins affirms, evolution has no long-term plans and does not
progress toward some distant goal (such as humans). The weasel program
is instead meant to illustrate the difference between non-random cumulative selection, and random single-step selection. In terms of the typing monkey analogy, this means that Romeo and Juliet could be produced relatively quickly if placed under the constraints of a nonrandom, Darwinian-type selection because the fitness function
will tend to preserve in place any letters that happen to match the
target text, improving each successive generation of typing monkeys.
A different avenue for exploring the analogy between evolution
and an unconstrained monkey lies in the problem that the monkey types
only one letter at a time, independently of the other letters. Hugh
Petrie argues that a more sophisticated setup is required, in his case
not for biological evolution but the evolution of ideas:
In order to get the proper analogy,
we would have to equip the monkey with a more complex typewriter. It
would have to include whole Elizabethan sentences and thoughts. It would
have to include Elizabethan beliefs about human action patterns and the
causes, Elizabethan morality and science, and linguistic patterns for
expressing these. It would probably even have to include an account of
the sorts of experiences which shaped Shakespeare's belief structure as a
particular example of an Elizabethan. Then, perhaps, we might allow the
monkey to play with such a typewriter and produce variants, but the
impossibility of obtaining a Shakespearean play is no longer obvious.
What is varied really does encapsulate a great deal of already-achieved
knowledge.
James W. Valentine,
while admitting that the classic monkey's task is impossible, finds
that there is a worthwhile analogy between written English and the metazoan
genome in this other sense: both have "combinatorial, hierarchical
structures" that greatly constrain the immense number of combinations at
the alphabet level.
Zipf's law
Zipf's law states that the frequency of words is a power law function of its frequency rank:where
are real numbers. Assuming that a monkey is typing randomly, with fixed
and nonzero probability of hitting each letter key or white space, then
the text produced by the monkey follows Zipf's law.
Literary theory
R. G. Collingwood argued in 1938 that art cannot be produced by accident, and wrote as a sarcastic aside to his critics,
[...]some[...] have denied this proposition, pointing out that if a monkey played with a typewriter[...] he would produce[...]
the complete text of Shakespeare. Any reader who has nothing to do can
amuse himself by calculating how long it would take for the probability
to be worth betting on. But the interest of the suggestion lies in the
revelation of the mental state of a person who can identify the 'works'
of Shakespeare with the series of letters printed on the pages of a book[...]
What Menard wrote is simply another
inscription of the text. Any of us can do the same, as can printing
presses and photocopiers. Indeed, we are told, if infinitely many
monkeys... one would eventually produce a replica of the text. That replica, we maintain, would be as much an instance of the work, Don Quixote, as Cervantes' manuscript, Menard's manuscript, and each copy of the book that ever has been or will be printed.
In another writing, Goodman elaborates, "That the monkey may be
supposed to have produced his copy randomly makes no difference. It is
the same text, and it is open to all the same interpretations." Gérard Genette dismisses Goodman's argument as begging the question.
For Jorge J. E. Gracia, the question of the identity of texts leads to a different question, that of author. If a monkey is capable of typing Hamlet,
despite having no intention of meaning and therefore disqualifying
itself as an author, then it appears that texts do not require authors.
Possible solutions include saying that whoever finds the text and
identifies it as Hamlet is the author; or that Shakespeare is the
author, the monkey his agent, and the finder merely a user of the text.
These solutions have their own difficulties, in that the text appears
to have a meaning separate from the other agents: What if the monkey
operates before Shakespeare is born, or if Shakespeare is never born, or
if no one ever finds the monkey's typescript?
Simulated and limited conditions
In 1979, William R. Bennett Jr., a professor of physics at Yale University,
brought fresh attention to the theorem by applying a series of computer
programs. Dr. Bennett simulated varying conditions under which an
imaginary monkey, given a keyboard consisting of twenty-eight
characters, and typing ten keys per second, might attempt to reproduce
the sentence, "To be or not to be, that is the question." Although his
experiments agreed with the overall conclusion that even such a short
string of words would require many times the current age of the universe
to reproduce, he noted that by modifying the statistical probability of
certain letters to match the ordinary patterns of various languages and
of Shakespeare in particular, seemingly random strings of words could
be made to appear. But even with several refinements, the English
sentence closest to the target phrase remained gibberish: "TO DEA NOW
NAT TO BE WILL AND THEM BE DOES DOESORNS CAI AWROUTROULD."
Random document generation
The theorem concerns a thought experiment
which cannot be fully carried out in practice, since it is predicted to
require prohibitive amounts of time and resources. Nonetheless, it has
inspired efforts in finite random text generation.
One computer program run by Dan Oliver of Scottsdale, Arizona, according to an article in The New Yorker,
came up with a result on 4 August 2004: After the group had worked for
42,162,500,000 billion billion monkey-years, one of the "monkeys" typed,
"VALENTINE. Cease toIdor:eFLP0FRjWK78aXzVOwm)-‘;8.t" The
first 19 letters of this sequence can be found in "The Two Gentlemen of
Verona". Other teams have reproduced 18 characters from "Timon of
Athens", 17 from "Troilus and Cressida", and 16 from "Richard II".
A website entitled The Monkey Shakespeare Simulator, launched on 1 July 2003, contained a Java applet
that simulated a large population of monkeys typing randomly, with the
stated intention of seeing how long it takes the virtual monkeys to
produce a complete Shakespearean play from beginning to end. For
example, it produced this partial line from Henry IV, Part 2, reporting that it took "2,737,850 million billion billion billion monkey-years" to reach 24 matching characters:
RUMOUR. Open your ears; 9r"5j5&?OWTY Z0d
Due to processing power limitations, the program used a probabilistic model (by using a random number generator
or RNG) instead of actually generating random text and comparing it to
Shakespeare. When the simulator "detected a match" (that is, the RNG
generated a certain value or a value within a certain range), the
simulator simulated the match by generating matched text.
Questions about the statistics describing how often an ideal monkey is expected to type certain strings translate into practical tests for random-number generators; these range from the simple to the "quite sophisticated". Computer-science professors George Marsaglia and Arif Zaman report that they used to call one such category of tests "overlapping m-tuple
tests" in lectures, since they concern overlapping m-tuples of
successive elements in a random sequence. But they found that calling
them "monkey tests" helped to motivate the idea with students. They
published a report on the class of tests and their results for various
RNGs in 1993.
The infinite monkey theorem and its associated imagery is considered a
popular and proverbial illustration of the mathematics of probability,
widely known to the general public because of its transmission through
popular culture rather than through formal education. This is helped by the innate humor stemming from the image of literal
monkeys rattling away on a set of typewriters, and is a popular visual
gag.
Science fiction author R. A. Lafferty used this idea as the basis for his 1970 short story "Been a Long, Long Time"
in which a group of immortal monkeys are tasked with typing randomly to
write the complete works of Shakespeare. After several billion cycles
of the universe expanding, contracting, and repeating the Big Bang, they nearly complete the task.
A quotation attributed to a 1996 speech by Robert Wilensky stated, "We've heard that a million
monkeys at a million keyboards could produce the complete works of
Shakespeare; now, thanks to the Internet, we know that is not true."
The enduring, widespread popularity of the theorem was noted in
the introduction to a 2001 paper, "Monkeys, Typewriters and Networks:
The Internet in the Light of the Theory of Accidental Excellence". In 2002, an article in The Washington Post
said, "Plenty of people have had fun with the famous notion that an
infinite number of monkeys with an infinite number of typewriters and an
infinite amount of time could eventually write the works of
Shakespeare". In 2003, the previously mentioned Arts Council−funded experiment involving real monkeys and a computer keyboard received widespread press coverage. In 2007, the theorem was listed by Wired magazine in a list of eight classic thought experiments.
In 2015 Balanced Software released Monkey Typewriter on the Microsoft Store. The software generates random text using the Infinite Monkey theorem
string formula. The software queries the generated text for user
inputted phrases. However the software should not be considered true to
life representation of the theory. This is a more of a practical
presentation of the theory rather than scientific model on how to
randomly generate text.
Obsessive–compulsive disorder (OCD) is a mental disorder in which an individual has intrusive thoughts (an obsession) and feels the need to perform certain behaviors (compulsions) repeatedly to relieve the distress caused by the obsession, to the extent where it impairs general function. OCD has been described since antiquity and has affected numerous
notable historical and contemporary figures; understandings of it were
historically rooted in religion and beliefs about demonic possession.
Obsessions are persistent unwanted thoughts, mental images, or urges that generate feelings of anxiety, disgust, or discomfort. Some common obsessions include fear of contamination, obsession with symmetry, the fear of acting blasphemously, sexual obsessions, and the fear of possibly harming others or themselves. Compulsions are repetitive actions performed in response to obsessions
to reduce anxiety, such as washing, checking, counting, reassurance
seeking, and situational avoidance.
Compulsions occur often and typically take up at least one hour per day, impairing one's quality of life. Compulsions temporarily relieve distress but reinforce obsessions over
time. Many adults with OCD recognize their rituals as irrational yet
continue them to reduce anxiety. For this reason, thoughts and behaviors in OCD are usually considered egodystonic (inconsistent with one's ideal self-image).
The causes of OCD are multifactorial and not fully understood, involving genetic predisposition, environmental stressors such as childhood trauma, abnormalities in brain structure and neurotransmitter
function, certain medications or drugs, potential autoimmune processes
in some children, and possibly evolutionary factors influencing
compulsive behaviors. Diagnosis is based on clinical presentation; rating scales such as the Yale–Brown Obsessive–Compulsive Scale (Y-BOCS) assess severity. OCD involves abnormalities in cortico-striato-thalamo-cortical circuits and dysregulation of serotonin, dopamine, and glutamate. OCD is associated with a general increase in suicidality. The term obsessive–compulsive or OCD
is often used informally to describe someone overly meticulous or
fixated, but OCD can present in many ways, and not all sufferers focus
on cleanliness or symmetry.
OCD is chronic and long-lasting with periods of severe symptoms followed by periods of improvement. Treatment can improve ability to function and quality of life, and is usually reflected by improved Y-BOCS scores. First-line treatment for OCD typically consists of either exposure and response prevention or pharmacotherapy with selective serotonin reuptake inhibitors (SSRIs), or both in combination. Some patients fail to improve after treatment with SSRIs alone; these
cases qualify as treatment-resistant and can require second-line
treatment such as clomipramine or augmentation with an atypical antipsychotic. Treatment-resistant obsessive–compulsive disorder is also managed with transcranial magnetic stimulation or, as a last resort, surgical options like deep brain stimulation.
Signs and symptoms
OCD can present with a wide variety of symptoms. Certain groups of
symptoms usually occur together as dimensions or clusters, which may
reflect an underlying process. The standard assessment tool for OCD, the
Yale–Brown Obsessive–Compulsive Scale (Y-BOCS), has 13 predefined categories of symptoms. These symptoms fit into three to five groupings. A meta-analytic
review of symptom structures found a four-factor grouping structure to
be most reliable: symmetry factor, forbidden thoughts factor, cleaning
factor and hoarding factor. The symmetry factor correlates highly with
obsessions related to ordering, counting and symmetry, as well as
repeating compulsions. The forbidden thoughts factor correlates highly
with intrusive thoughts of a violent, religious, or sexual nature. The
cleaning factor correlates highly with obsessions about contamination
and compulsions related to cleaning. The hoarding factor only involves
hoarding-related obsessions and compulsions, and was identified as being
distinct from other symptom groupings.
When examining the onset of OCD, one study suggests that there
are differences in the age of onset between males and females, with the
average age of onset of OCD being 9.6 years for boys and 11.0 years for
girls. Children with OCD often have other mental disorders, such as ADHD, depression,
anxiety, and disruptive behavior disorder. Continually, children are
more likely to struggle in school and experience difficulties in social
situations. When looking at both adults and children, a study found the average
ages of onset to be 21 and 24 for males and females respectively. While some studies have shown that OCD with earlier onset is associated
with greater severity, other studies have not been able to validate
this finding. Looking at women specifically, a different study suggested that 62% of
participants found that their symptoms worsened at a premenstrual age.
Across the board, all demographics and studies showed a mean age of onset of less than 25.
Some OCD subtypes have been associated with improvement in performance on certain tasks, such as pattern recognition (washing subtype) and spatial working memory (obsessive thought subtype). Subgroups have also been distinguished by neuroimaging
findings and treatment response, though neuroimaging studies have not
been comprehensive enough to draw conclusions. Subtype-dependent
treatment response has been studied and the hoarding subtype has
consistently been least responsive to treatment.
People with scrupulosity OCD may face intrusive thoughts such as worrying about death.
Obsessions are stress-inducing thoughts that recur and persist, despite efforts to ignore or confront them. People with OCD frequently perform tasks, or compulsions,
to seek relief from obsession-related anxiety. Within and among
individuals, initial obsessions vary in clarity and vividness. A
relatively vague obsession could involve a general sense of disarray or
tension, accompanied by a belief that life cannot proceed as normal
while the imbalance remains. A more intense obsession could be a
preoccupation with the thought or image of a close family member or
friend dying, or intrusive thoughts related to relationship rightness. Other obsessions concern the possibility that someone or something other than oneself—such as God, the devil, or disease—will
harm either the patient or the people or things the patient cares
about. Others with OCD may experience the sensation of invisible
protrusions emanating from their bodies or feel that inanimate objects are ensouled. Another common obsession is scrupulosity,
the pathological guilt/anxiety about moral or religious issues. In
scrupulosity, a person's obsessions focus on moral or religious fears,
such as the fear of being an evil person or the fear of divine
retribution for sin, for example going to Hell. Mysophobia, a pathological fear of contamination and germs, is another common obsession theme.
Some people with OCD experience sexual obsessions
that may involve intrusive thoughts or images of various sexual acts
with strangers, acquaintances, relatives, animals, or religious figures
and can include heterosexual or homosexual contact with people of any age. Similar to other intrusive thoughts or images, some disquieting sexual
thoughts are normal at times, but people with OCD may attach
extraordinary significance to such thoughts. For example, obsessive
fears about sexual orientation can appear to the affected individual, and even to those around them, as a crisis of sexual identity. Furthermore, the doubt that accompanies OCD leads to uncertainty
regarding whether one might act on the troubling thoughts, resulting in
self-criticism or self-loathing.
Pedophilia-themed obsessive–compulsive disorder (also known as
pedophile OCD or P-OCD) is an OCD subtype regarding reocurring
compulsions and obsessions over one being a pedophile.
Most people with OCD understand that their thoughts do not
correspond with reality; however, they feel that they must act as though
these ideas are correct or realistic. For example, someone who engages
in compulsive hoarding
might be inclined to treat inorganic matter as if it had the sentience
or rights of living organisms, despite accepting that such behavior is
irrational on an intellectual level. There is debate as to whether
hoarding should be considered an independent syndrome from OCD.
Some people with OCD perform compulsive rituals because they
inexplicably feel that they must do so, while others act compulsively to
mitigate the anxiety that stems from obsessive thoughts. The affected
individual might feel that these actions will either prevent a dreaded
event from occurring or push the event from their thoughts. In any case,
their reasoning is so idiosyncratic or distorted that it results in significant distress, either personally or for those around the affected individual. Excessive skin picking, hair pulling, nail biting and other body-focused repetitive behavior disorders are all on the obsessive–compulsive spectrum. Some individuals with OCD are aware that their behaviors are not
rational, but they feel compelled to follow through with them to fend
off feelings of panic or dread. Furthermore, compulsions often stem from memory distrust, a symptom of OCD characterized by insecurity in one's skills in perception, attention and memory, even in cases where there is no clear evidence of a deficit.
Common compulsions may include hand washing, cleaning, checking
things (such as locks on doors), repeating actions (such as repeatedly
turning on and off switches), ordering items in a certain way and
requesting reassurance. Although some individuals perform actions repeatedly, they do not
necessarily perform these actions compulsively; for example, morning or
nighttime routines and religious practices are not usually compulsions.
Whether behaviors qualify as compulsions or mere habit depends on the
context in which they are performed. For instance, arranging and
ordering books for eight hours a day would be expected of someone who
works in a library, but this routine would seem abnormal in other
situations. In other words, habits tend to bring efficiency to one's
life, while compulsions tend to disrupt it. Furthermore, compulsions are different from tics (such as touching, tapping, rubbing or blinking) and stereotyped movements (such as head banging, body rocking or self-biting), which are usually not as complex and not precipitated by obsessions. It can sometimes be difficult to tell the difference between
compulsions and complex tics, and about 10–40% of people with OCD also
have a lifetime tic disorder.
People with OCD rely on compulsions as an escape from their
obsessive thoughts; however, they are aware that relief is only
temporary and that intrusive thoughts will return. Some affected
individuals use compulsions to avoid situations that may trigger
obsessions. Compulsions may be actions directly related to the
obsession, such as someone obsessed with contamination compulsively
washing their hands, but they can be unrelated as well. In addition to experiencing the anxiety and fear that typically
accompanies OCD, affected individuals may spend hours performing
compulsions every day. In such situations, it can become difficult for
the person to fulfill their work, familial or social roles. These
behaviors can also cause adverse physical symptoms; for example, people
who obsessively wash their hands with antibacterial soap and hot water can make their skin red and raw with dermatitis.
Individuals with OCD often use rationalizations
to explain their behavior; however, these rationalizations do not apply
to the behavioral pattern, but to each individual occurrence. For
example, someone compulsively checking the front door may argue that the
time and stress associated with one check is less than the time and
stress associated with being robbed, and checking is consequently the
better option. This reasoning often occurs in a cyclical manner and can
continue for as long as the affected person needs it to in order to feel
safe.
OCD sometimes manifests in mental instead of overt compulsions. This manifestation may be termed "primarily obsessional OCD" and typically involves mental compulsions, such as mental avoidance or excessive rumination. OCD without overt compulsions could, by one estimate, characterize as many as 50–60% of OCD cases.
Insight and overvalued ideation
The Diagnostic and Statistical Manual of Mental Disorders
(DSM-5) identifies a continuum for the level of insight in OCD, ranging
from good insight (the least severe) to no insight (the most severe).
Good or fair insight is characterized by the acknowledgment that
obsessive–compulsive beliefs are not or may not be true, while poor
insight is characterized by the belief that obsessive–compulsive beliefs
are probably true. The absence of insight altogether, in which the
individual is completely convinced that their beliefs are true, is also
identified as a delusional thought pattern and occurs in about 4% of people with OCD. When cases of OCD with no insight become severe, affected individuals
have an unshakable belief in the reality of their delusions, which can
make their cases difficult to differentiate from psychotic disorders. Additionally, good insight can include cases where the individual has
no insight during the experience but demonstrates insight later, when
they are in a calmer state of mind.
Some people with OCD exhibit what is known as overvalued ideas,
ideas that are abnormal compared to affected individuals' respective
cultures, and more treatment-resistant than most negative thoughts and
obsessions. After some discussion, it is possible to convince the individual that
their fears are unfounded. It may be more difficult to practice exposure and response prevention therapy (ERP) on such people, as they may be unwilling to cooperate, at least initially. Similar to how insight is identified on a continuum,
obsessive–compulsive beliefs are characterized on a spectrum, ranging
from obsessive doubt to delusional conviction. In the United States,
overvalued ideation (OVI) is considered most akin to poor
insight—especially when considering belief strength as one of an idea's
key identifiers. Furthermore, severe and frequent overvalued ideas are considered similar to idealized values, which are so rigidly held by, and so important to affected individuals, that they end up becoming a defining identity. In adolescent OCD patients, OVI is considered a severe symptom.
Historically, OVI has been thought to be linked to poorer
treatment outcome in patients with OCD, but it is currently considered a
poor indicator of prognosis. The Overvalued Ideas Scale (OVIS) has been developed as a reliable
quantitative method of measuring levels of OVI in patients with OCD.
Research has suggested that overvalued ideas are more stable for those
with more extreme OVIS scores.
Cognitive performance
Though OCD was once believed to be associated with above-average intelligence, this does not appear to necessarily be the case. A 2013 review reported that people with OCD may sometimes have mild but wide-ranging cognitive deficits, most significantly those affecting spatial memory and to a lesser extent with verbal memory, fluency, executive function and processing speed, while auditory attention was not significantly affected. People with OCD show impairment in formulating an organizational strategy for coding information, set-shifting, and motor and cognitive inhibition.
Specific subtypes of symptom dimensions in OCD have been associated with specific cognitive deficits. For example, the results of one meta-analysis comparing washing and checking symptoms reported that washers outperformed checkers on eight out of ten cognitive tests. The symptom dimension of contamination and cleaning may be associated
with higher scores on tests of inhibition and verbal memory.
Pediatric OCD
Approximately 1–2% of children are affected by OCD. An international study showed that OCD most often develops during
childhood or adolescence, with 21% of subjects having developed symptoms
during childhood (age 12 and under) and another 36% having developed
symptoms during adolescence (ages 13-17). OCD diagnosis in children occurs at similar rates across different
ethnic groups and races, but African American children are less likely
to receive treatment. The clinical presentation of OCD in children shares many similarities
with that observed in adults. OCD is considered a highly familial
disorder, with a phenotypic heritability of around 50%. Symptoms tend to
develop more frequently in children 10–14 years of age, with males
displaying symptoms at an earlier age, and at a more severe level than
females. In children, symptoms can be grouped into at least four types, including sporadic and tic-related OCD.
The Children's Yale–Brown Obsessive–Compulsive Scale (CY-BOCS) is the gold standard measure for assessment of pediatric OCD. It follows the Y-BOCS format, but with a Symptom Checklist that is
adapted for developmental appropriateness. Insight, avoidance,
indecisiveness, responsibility, pervasive slowness and doubting are not
included in a rating of overall severity. The CY-BOCS has demonstrated
good convergent validity with clinician-rated OCD severity and good to
fair discriminant validity from measures of closely related anxiety,
depression and tic severity. The CY-BOCS Total Severity score is an important monitoring tool as it is responsive to pharmacotherapy and psychotherapy. Positive treatment response is characterized by 25% reduction in
CY-BOCS total score and diagnostic remission is associated with a
45%-50% reduction in Total Severity score (or a score <15). The Child Behavior Checklist-Obsessive Compulsive Subscale (CBCL-OCS)
appears to demonstrate sufficient accuracy in identifying children and
adolescents who may require additional evaluation for OCD.
The Children's Florida Obsessive Compulsive Inventory (C-FOCI)
utilizes 17 specific, brief questions which focus on compulsions or
obsessions frequent among younger individuals with OCD. These act as a
dichotomous tool to evaluate whether obsessions and compulsions are
present or absent, using a symptom checklist on a scale of 0 to 17, and a
severity scale of 0 to 85.
Cognitive behavioral therapy
(CBT) is the first line treatment for mild to moderate cases of OCD in
children, while medication plus CBT is recommended for moderate to
severe cases. Selective serotonin reuptake inhibitors (SSRIs) are first-line medications for OCD in children with established AACAP guidelines for dosing. Medication in addition to a CBT intervention like exposure and response prevention (ERP) is more beneficial than only using medication in the treatment of OCD in children.
It has been found that between 18 and 34% of females currently
experiencing OCD scored positively on an inventory measuring disordered
eating. Another study found that 7% are likely to have an eating disorder, while another found that fewer than 5% of males have OCD and an eating disorder.
Individuals with OCD have also been found to be affected by delayed sleep phase disorder at a substantially higher rate than the general public. Moreover, severe OCD symptoms are consistently associated with greater sleep disturbance. Reduced total sleep time and sleep efficiency have been observed in people with OCD, with delayed sleep onset and offset.
Some research has demonstrated a link between drug addiction and OCD. For example, there is a higher risk of drug addiction among those with any anxiety disorder, likely as a way of coping
with the heightened levels of anxiety. However, drug addiction among
people with OCD may be a compulsive behavior. Depression is also
extremely prevalent among people with OCD. One explanation for the high
depression rate among OCD populations was posited by Mineka, Watson and
Clark (1998), who explained that people with OCD, or any other anxiety
disorder, may feel "out of control".
Someone exhibiting OCD signs does not necessarily have OCD.
Behaviors that present as obsessive–compulsive can also be found in a
number of other conditions, including obsessive–compulsive personality disorder (OCPD), autism spectrum disorder (ASD) or disorders in which perseveration is a possible feature (ADHD, PTSD, bodily disorders or stereotyped behaviors). Some cases of OCD present symptoms typically associated with Tourette
syndrome, such as compulsions that may appear to resemble motor tics; this has been termed tic-related OCD or Tourettic OCD.
OCD frequently occurs comorbidly with both bipolar disorder and major depressive disorder.
Between 60 and 80% of those with OCD experience a major depressive
episode in their lifetime. Comorbidity rates have been reported at
between 19 and 90%, as a result of methodological differences. Between
9–35% of those with bipolar disorder also have OCD, compared to 1–2% in
the general population. About 50% of those with OCD experience cyclothymic traits or hypomanic episodes. OCD is also associated with anxiety disorders. Lifetime comorbidity for OCD has been reported at 22% for specific phobia, 18% for social anxiety disorder, 12% for panic disorder and 30% for generalized anxiety disorder. The comorbidity rate for OCD and ADHD has been reported to be as high as 51%.
The cause of OCD is unknown. Both environmental and genetic factors are believed to play a role. Risk factors include a history of adverse childhood experiences or other stress-inducing events.
General OCD symptoms (obsessions, compulsions, skin picking,
hair pulling, etc.) that developed soon after exposure to the substance
or medication which can produce such symptoms.
The onset of symptoms cannot be explained by an obsessive–compulsive
and related disorder that is not substance/medication-induced and
should last for a substantial period of time (about 1 month)
This disturbance does not only occur during delirium.
Clinically induces distress or impairment in social, occupational or other important areas of functioning.
Genetics
There appear to be some genetic components of OCD causation, with identical twins more often affected than fraternal twins. Furthermore, individuals with OCD are more likely to have first-degree family members exhibiting the same disorders than matched controls.
In cases in which OCD develops during childhood, there is a much
stronger familial link in the disorder than with cases in which OCD
develops later in adulthood. OCD is highly familial, about 50%
heritable. OCD is believed to be a heterogeneous disorder.
A genome-wide association study of OCD identified 30 significant genetic loci and 25 likely causal genes, including WDR6, DALRD3, and CTNND1, with ~11,500 variants explaining most of its heritability. Genetic risk is linked to excitatory neurons in the hippocampus and cerebral cortex, D1 and D2 medium spiny neurons, and overlaps with anxiety, depression, anorexia nervosa, and Tourette syndrome.
Research has found there to be a genetic correlation between anorexia nervosa and OCD, suggesting a strong etiology. First and second hand relatives of probands with OCD have a greater
risk of developing anorexia nervosa as genetic relatedness increases.
A mutation has been found in the human serotonin transporter gene hSERT in unrelated families with OCD.
A systematic review found that while neither allele was associated with OCD overall, in Caucasians, the L allele was associated with OCD. Another meta-analysis observed an increased risk in those with the homozygous S allele, but found the LS genotype to be inversely associated with OCD.
One meta-analysis found a small but significant association between a polymorphism in SLC1A1 and OCD.
The relationship between OCD and Catechol-O-methyltransferase
(COMT) has been inconsistent, with one meta-analysis reporting a
significant association, albeit only in men, and another meta analysis
reporting no association.
It has been postulated by evolutionary psychologists
that moderate versions of compulsive behavior may have had evolutionary
advantages. Examples would be moderate constant checking of hygiene,
the hearth or the environment for enemies. Similarly, hoarding
may have had evolutionary advantages. In this view, OCD may be the
extreme statistical tail of such behaviors, possibly the result of a
high number of predisposing genes.
Brain structure and functioning
Imaging studies have shown differences in the frontal cortex and subcortical
structures of the brain in patients with OCD. There appears to be a
connection between the OCD symptoms and abnormalities in certain areas
of the brain, but such a connection is not clear. Some people with OCD have areas of unusually high activity in their brain or low levels of the chemical serotonin, which is a neurotransmitter that some nerve cells use to communicate with each other, and is thought to be involved in regulating many functions, influencing emotions, mood, memory and sleep.
Autoimmune
A controversial hypothesis is that some cases of rapid onset of OCD
in children and adolescents may be caused by a syndrome connected to Group A streptococcal infections (GABHS), known as pediatric autoimmune neuropsychiatric disorders associated with streptococcal infections (PANDAS). OCD and tic disorders are hypothesized to arise in a subset of children as a result of a post-streptococcal autoimmune process. The PANDAS hypothesis is unconfirmed and unsupported by data and two new categories have been proposed: PANS (pediatric acute-onset neuropsychiatric syndrome) and CANS (childhood acute neuropsychiatric syndrome).The CANS and PANS hypotheses include different possible mechanisms
underlying acute-onset neuropsychiatric conditions, but do not exclude
GABHS infections as a cause in a subset of individuals. PANDAS, PANS and CANS are the focus of clinical and laboratory research, but remain unproven. Whether PANDAS is a distinct entity differing from other cases of tic disorders or OCD is debated.
A review of studies examining anti-basal ganglia antibodies in OCD found an increased risk of having anti-basal ganglia antibodies in those with OCD versus the general population.
Environment
OCD may be more common in people who have been bullied, abused or
neglected, and it sometimes starts after a significant life event, such
as childbirth or bereavement. It has been reported in some studies that there is a connection between childhood trauma and obsessive-compulsive symptoms. More research is needed to understand this relationship better.
Some
parts of the brain showing abnormal activity in OCD: Orbitofrontal
cortex integrates rewards, emotions, and behaviors; anterior cingulate
cortex is involved in error detection; amygdala is involved in emotional
interpretation of reward
A meta-analysis comparing affective and nonaffective tasks observed differences with controls in regions implicated in salience,
habit, goal-directed behavior, self-referential thinking and cognitive
control. For nonaffective tasks, hyperactivity was observed in the insula, ACC and head of the caudate/putamen, while hypoactivity was observed in the medial prefrontal cortex (mPFC) and posterior caudate. Affective tasks were observed to relate to increased activation in the precuneus and posterior cingulate cortex, while decreased activation was found in the pallidum, ventral anterior thalamus and posterior caudate. The involvement of the cortico-striato-thalamo-cortical
loop in OCD, as well as the high rates of comorbidity between OCD and
ADHD, have led some to draw a link in their mechanism. Observed
similarities include dysfunction of the anterior cingulate cortex and prefrontal cortex, as well as shared deficits in executive functions. The involvement of the orbitofrontal cortex and dorsolateral prefrontal cortex in OCD is shared with bipolar disorder and may explain the high degree of comorbidity. Decreased volumes of the dorsolateral prefrontal cortex related to executive function has also been observed in OCD.
People with OCD evince increased grey matter volumes in bilateral lenticular nuclei, extending to the caudate nuclei, with decreased grey matter volumes in bilateral dorsal medial frontal/anterior cingulate gyri. These findings contrast with those in people with other anxiety
disorders, who evince decreased (rather than increased) grey matter
volumes in bilateral lenticular/caudate nuclei, as well as decreased
grey matter volumes in bilateral dorsal medial frontal/anterior cingulate gyri. Increased white matter volume and decreased fractional anisotropy in anterior midline tracts has been observed in OCD, possibly indicating increased fiber crossings.
Cognitive models
Generally, two categories of models for OCD have been postulated. The
first category involves deficits in executive dysfunction and is based
on the observed structural and functional abnormalities in the dlPFC, striatum and thalamus. The second category involves dysfunctional modulatory control and primarily relies on observed functional and structural differences in the ACC, mPFC and OFC.
One proposed model suggests that dysfunction in the orbitalfrontal cortex (OFC) leads to improper valuation of behaviors and decreased behavioral control, while the observed alterations in amygdala activations leads to exaggerated fears and representations of negative stimuli.
Due to the heterogeneity
of OCD symptoms, studies differentiating various symptoms have been
performed. Symptom-specific neuroimaging abnormalities include the
hyperactivity of caudate and ACC in checking rituals, while finding
increased activity of cortical and cerebellar
regions in contamination-related symptoms. Neuroimaging differentiating
content of intrusive thoughts has found differences between aggressive
as opposed to taboo thoughts, finding increased connectivity of the amygdala, ventral striatum and ventromedial prefrontal cortex
in aggressive symptoms, while observing increased connectivity between
the ventral striatum and insula in sexual or religious intrusive
thoughts.
Another model proposes that affective dysregulation links excessive reliance on habit-based action selection with compulsions. This is supported by the observation that those with
OCD demonstrate decreased activation of the ventral striatum when
anticipating monetary reward, as well as increased functional
connectivity between the VS and the OFC. Furthermore, those with OCD
demonstrate reduced performance in Pavlovian
fear-extinction tasks, hyperresponsiveness in the amygdala to fearful
stimuli and hyporesponsiveness in the amygdala when exposed to
positively valanced stimuli. Stimulation of the nucleus accumbens
has also been observed to effectively alleviate both obsessions and
compulsions, supporting the role of affective dysregulation in
generating both.
Neurobiological
From the observation of the efficacy of antidepressants in OCD, a
serotonin hypothesis of OCD has been formulated. Studies of peripheral
markers of serotonin, as well as challenges with proserotonergic
compounds have yielded inconsistent results, including evidence pointing
towards basal hyperactivity of serotonergic systems. Serotonin receptor and transporter binding studies have yielded conflicting results, including higher and lower serotonin receptor 5-HT2A and serotonin transporter
binding potentials that were normalized by treatment with SSRIs.
Despite inconsistencies in the types of abnormalities found, evidence
points towards dysfunction of serotonergic systems in OCD. Orbitofrontal cortex overactivity is attenuated in people who have
successfully responded to SSRI medication, a result believed to be
caused by increased stimulation of serotonin receptors 5-HT2A and 5-HT2C.
Dopaminergic dysfunction in cortico-striato-thalamo-cortical
circuits has been implicated in cognitive rigidity, emotional
dysregulation, and compulsive behaviors in OCD. A 2020 review found striatal D2
receptors are decreased in OCD, dopamine transporters are unchanged in
OCD, and evidence for other dopaminergic changes is limited. Increased dopamine release in the nucleus accumbens
after deep brain stimulation correlates with improvement in symptoms,
pointing to reduced dopamine release in the striatum playing a role in
generating symptoms.
Abnormalities in glutamatergicneurotransmission have been implicated in OCD. Findings such as increased cerebrospinalglutamate,
less consistent abnormalities observed in neuroimaging studies, and the
efficacy of some glutamatergic drugs (such as the glutamate-inhibiting riluzole) have implicated glutamate in OCD. OCD has been associated with reduced N-Acetylaspartic acid
in the mPFC, which is thought to reflect neuron density or
functionality, although the exact interpretation has not been
established.
Diagnosis
Formal diagnosis may be performed by a psychologist, psychiatrist, clinical social worker
or other licensed mental health professional. OCD, like other mental
and behavioral health disorders, cannot be diagnosed by a medical exam, nor are there any medical exams that can predict if one will fall
victim to such illnesses. To be diagnosed with OCD, a person must have
obsessions, compulsions or both, according to the Diagnostic and Statistical Manual of Mental Disorders
(DSM). The DSM notes that there are multiple characteristics that can
turn obsessions and compulsions from normalized behavior to "clinically
significant". There has to be recurring and strong thoughts or impulsive
that intrude on the day-to-day lives of the patients and cause
noticeable levels of anxiousness.
These thoughts, impulses or images are of a degree or type that lies outside the normal range of worries about conventional problems. A person may attempt to ignore or suppress
such obsessions, neutralize them with another thought or action, or try
to rationalize their anxiety away. People with OCD tend to recognize
their obsessions as irrational.
Compulsions become clinically significant when a person feels
driven to perform them in response to an obsession or according to rules
that must be applied rigidly and when the person consequently feels or
causes significant distress. Therefore, while many people who do not
have OCD may perform actions often associated with OCD (such as ordering
items in a pantry by height), the distinction with clinically
significant OCD lies in the fact that the person with OCD must perform
these actions to avoid significant psychological distress. These
behaviors or mental acts are aimed at preventing or reducing distress or
preventing some dreaded event or situation; however, these activities
are not logically or practically connected to the issue or they are
excessive.
Moreover, the obsessions or compulsions must be time-consuming,
often taking up more than one hour per day or cause impairment in
social, occupational or scholastic functioning. It is helpful to quantify the severity of symptoms and impairment
before and during treatment for OCD. In addition to the person's
estimate of the time spent each day harboring obsessive-compulsive
thoughts or behaviors, concrete tools can be used to gauge the person's
condition. This may be done with rating scales, such as the Yale–Brown Obsessive–Compulsive Scale (Y-BOCS; expert rating) or the obsessive–compulsive inventory (OCI-R; self-rating). A 2025 systematic review found that the 8-question Child Behavior
Checklist–Obsessive-Compulsive Subscale (CBCL-OCD/OCS) demonstrates
moderate accuracy in identifying children likely to have OCD and may
help guide referrals for specialist evaluation. With measurements such as these, psychiatric consultation can be more appropriately determined, as it has been standardized.
In regards to diagnosing, the health professional also looks to
make sure that the signs of obsessions and compulsions are not the
results of any drugs, prescription or recreational, that the patient may
be taking.
There are several types of obsessive thoughts that are found
commonly in those with OCD. Some of these include fear of germs, hurting
loved ones, embarrassment, neatness, societally unacceptable sexual
thoughts etc. Within OCD, these specific categories are often diagnosed into their own type of OCD. OCD is sometimes placed in a group of disorders called the obsessive–compulsive spectrum.
Another criterion in the DSM is that a person's mental illness
does not fit one of the other categories of a mental disorder better.
That is to say, if the obsessions and compulsions of a patient could be
better described by trichotillomania, it would not be diagnosed as OCD. That being said, OCD does often go hand in hand with other mental
disorders. For this reason, one may be diagnosed with multiple mental
disorders at once.
A different aspect of the diagnoses is the degree of insight had
by the individual in regards to the truth of the obsessions. There are
three levels, good/fair, poor and absent/delusional. Good/fair indicated
that the patient is aware that the obsessions they have are not true or
probably not true. Poor indicates that the patient believes their obsessional beliefs are probably true. Absent/delusional indicates that they fully believe their obsessional thoughts to be true. Approximately 4% or fewer individuals with OCD will be diagnosed as absent/delusional. Additionally, as many as 30% of those with OCD also have a lifetime tic
disorder, meaning they have been diagnosed with a tic disorder at some
point in their life. There are several different types of tics that have been observed in
individuals with OCD. These include but are not limited to, "grunting",
"jerking" or "shrugging" body parts, sniffling and excessive blinking.
There has been a significant amount of progress over the last few decades and, as of 2022,
there is statically significant improvement in the diagnostic process
for individuals with OCD. One study found that of two groups of
individuals, one with participants under the age of 27.25 and one with
participants over that age, those in the younger group experienced a
significantly faster time between the onset of OCD tendencies and their
formal diagnoses.
Differential diagnosis
OCD is often confused with the separate condition obsessive–compulsive personality disorder (OCPD). OCD is egodystonic, meaning that the disorder is incompatible with the individual's self-concept. As egodystonic disorders go against a person's self-concept, they tend to cause much distress. OCPD, on the other hand, is egosyntonic, marked by the person's acceptance that the characteristics and behaviors displayed as a result are compatible with their self-image, or are otherwise appropriate, correct or reasonable.
As a result, people with OCD are often aware that their behavior
is not rational and are unhappy about their obsessions, but nevertheless
feel compelled by them. By contrast, people with OCPD are not aware of anything abnormal; they
will readily explain why their actions are rational. It is usually
impossible to convince them otherwise and they tend to derive pleasure
from their obsessions or compulsions.
In cognitive behavioral therapy
(CBT), OCD patients are asked to overcome intrusive thoughts by not
indulging in any compulsions. They are taught that rituals keep OCD
strong, while not performing them causes OCD to become weaker. This position is supported by the pattern of memory distrust; the more
often compulsions are repeated, the more weakened memory trust becomes
and this cycle continues as memory distrust increases compulsion
frequency.
One exposure and ritual prevention activity would be to check the lock only once and then leave.
One specific CBT technique used is called exposure and response prevention
(ERP), which involves teaching the person to deliberately come into
contact with situations that trigger obsessive thoughts and fears
(exposure), without carrying out the usual compulsive acts associated
with the obsession (response prevention). This technique causes patients
to gradually learn to tolerate the discomfort and anxiety associated
with not performing their compulsions. For many patients, ERP is the
add-on treatment of choice when selective serotonin reuptake inhibitors
(SSRIs) medication does not effectively treat OCD symptoms, or vice
versa, for individuals who begin treatment with psychotherapy. This technique is considered superior to others due to the lack of
medication used. However, up to 25% of patients will discontinue
treatment due to the severity of their tics. CBT normally lasts anywhere
from 12–16 sessions, with homework assigned to the patient in between meetings with a therapist. Modalities differ in ERP treatment but both virtual reality based as
well as unguided computer assisted treatment programs have shown
effective results in treatment programs. A 2024 systematic review concluded, with high strength of evidence,
that CBT with ERP provided via telehealth is equally as effective for
reducing symptoms, in children and adolescents, as in-person treatment.
For example, a patient might be asked to touch something very
mildly contaminated (exposure) and wash their hands only once afterward
(response prevention). Another example might entail asking the patient
to leave the house and check the lock only once (exposure), without
going back to check again (response prevention). After succeeding at one
stage of treatment, the patient's level of discomfort in the exposure
phase can be increased. When this therapy is successful, the patient
will quickly habituate to an anxiety-producing situation, discovering a considerable drop in anxiety level.
ERP has a strong evidence base and is considered the most effective treatment for OCD. However, this claim was doubted by some researchers in 2000, who criticized the quality of many studies. While ERP can lead a majority of clients to improvements, many do not reach remission or become asymptomatic; some therapists are also hesitant to use this approach.
The recent development of remotely technology-delivered CBT is
increasing access to therapy options for those living with OCD and
remote versions appear to be equally as effective as in-person therapy
options. The development of smartphone interventions for OCD that
utilize CBT techniques are another alternative that is expanding access
to therapy while allowing therapies to be personalized for each patient.
Acceptance and commitment therapy (ACT), a newer therapy also used to treat anxiety and depression, has also been found to be effective in treatment of OCD. ACT uses acceptance and mindfulness
strategies to teach patients not to overreact to or avoid unpleasant
thoughts and feelings but rather "move toward valued behavior".
Inference-based therapy (IBT) is a form of cognitive therapy specifically developed for treating OCD. The therapy posits that individuals with OCD put a greater emphasis on
an imagined possibility than on what can be perceived with the senses, and confuse the imagined possibility with reality, in a process called inferential confusion. According to inference-based therapy, obsessional thinking occurs when
the person replaces reality and real probabilities with imagined
possibilities. The goal of inference-based therapy is to reorient clients towards
trusting the senses and relating to reality in a normal, non-effortful
way. Differences between normal and obsessional doubts are presented and
clients are encouraged to use their senses and reasoning as they do in
non-obsessive–compulsive disorder situations. Research on Inference-Based Cognitive-Behavior Therapy (I-CBT) suggests it can lead to improvements for those with OCD.
Psychotherapy in combination with psychiatric medication may be
more effective than either option alone for individuals with severe OCD. ERP coupled with weight restoration and serotonin reuptake inhibitors
has proven the most effective when treating OCD and an eating disorder
simultaneously.
A blister pack of sertraline under the brand name Zoloft
The medications most frequently used to treat OCD are antidepressants, including selective serotonin reuptake inhibitors (SSRIs). SSRIs such as sertraline and fluoxetine are effective in treating OCD for children and adolescents.However, ERP alone may be as effective as ERP combined with an SSRI for OCD symptoms. A 2025 network meta-analysis of 71 randomized trials found that
combining exposure therapy with an SSRI was more helpful for children
with OCD than taking an SSRI by itself.
SSRIs are a second-line treatment of adult OCD with mild
functional impairment and as first-line treatment for those with
moderate or severe impairment. In children, SSRIs can be considered as a
second-line therapy in those with moderate to severe impairment, with
close monitoring for psychiatric adverse effects. Patients treated with SSRIs are about twice as likely to respond to treatment as are those treated with placebo, so this treatment is qualified as efficacious. Efficacy has been demonstrated both in short-term (6–24 weeks)
treatment trials and in discontinuation trials with durations of 28–52
weeks.
Clomipramine, a medication belonging to the class of tricyclic antidepressants, appears to work as well as SSRIs, but has a higher rate of side effects. Clomipramine has been shown to be possibly more effective than a placebo.
In 2006, the National Institute for Health and Care Excellence (NICE) guidelines recommended augmentative second-generation (atypical) antipsychotics for treatment-resistant OCD. Current evidence is limited regarding their use as monotherapy in OCD. For OCD treatment, there is tentative short-term evidence supporting risperidone and aripiprazole, insufficient evidence for olanzapine, and quetiapine shows no significant benefit versus placebo, with overall conclusions limited by a small number of studies.
Procedures
The United States Food and Drug Administration approved transcranial
magnetic stimulation (TMS) as a new treatment for treatment-resistant
OCD in 2018. Existing evidence suggests that repetitive TMS (rTMS), particularly targeting the dorsolateral prefrontal cortex and supplementary motor area, effectively reduces obsessive–compulsive disorder symptoms.
The evidence is insufficient to conclude that electroconvulsive therapy is an effective treatment for OCD. Evidence is limited to low-quality case reports/series that suggest possible benefit in some severe, treatment-resistant cases; however, no randomized trials have been performed, leaving its efficacy unproven.
Surgery may be used as a last resort in people who do not improve with other treatments. In this procedure, a surgical lesion is made in an area of the brain (the cingulate cortex). In one study, 30% of participants benefitted significantly from this procedure. Deep brain stimulation and vagus nerve stimulation are possible surgical options that do not require destruction of brain tissue.
However, because deep brain stimulation results in such an instant and
intense change, individuals may experience identity challenges
afterward. In the United States, the Food and Drug Administration approved deep brain stimulation for the treatment of OCD under a humanitarian device exemption, requiring that the procedure be performed only in a hospital with special qualifications to do so.
In the United States, psychosurgery
for OCD is a treatment of last resort and will not be performed until
the person has failed several attempts at medication (at the full
dosage) with augmentation, and many months of intensive cognitive behavioral therapy with exposure and ritual/response prevention. Likewise, in the United Kingdom, psychosurgery cannot be performed
unless a course of treatment from a suitably qualified
cognitive–behavioral therapist has been carried out.
Children
Therapeutic treatment may be effective in reducing ritual behaviors of OCD for children and adolescents. Similar to the treatment of adults with OCD, cognitive behavioral therapy, along with exposure and response prevention (ERP) therapy, stands as an effective and validated first line of treatment of OCD in children. Family involvement, in the form of behavioral observations and reports, is a key component to the success of such treatments. Parental interventions also provide positive reinforcement for a child
who exhibits appropriate behaviors as alternatives to compulsive
responses. In a recent meta-analysis of evidenced-based treatment of OCD
in children, family-focused individual CBT was labeled as "probably
efficacious", establishing it as one of the leading psychosocial
treatments for youth with OCD. After one or two years of therapy, in which a child learns the nature
of their obsession and acquires strategies for coping, they may acquire a
larger circle of friends, exhibit less shyness and become less
self-critical. Trials have shown that children and adolescents with OCD should begin treatment with the combination of CBT with a selective serotonin reuptake inhibitor or CBT alone, rather than only an SSRI. A 2024 systematic review of the literature found that combining ERP
therapy with selective serotonin reuptake inhibitors can enhance
treatment outcomes compared to using SSRIs alone. ERP therapy can be done in-office or via telehealth since there was no
statistically significant difference in effectiveness as shown in the
AHRQ study. A 2025 meta-analysis found that exposure and response prevention and
selective serotonin reuptake inhibitors are the most commonly studied
treatments, with more limited evidence for newer approaches such as
antipsychotic augmentation and neuromodulation.
Although the known causes of OCD in younger age groups range from
brain abnormalities to psychological preoccupations, life stress such
as bullying and traumatic familial deaths may also contribute to
childhood cases of OCD, and acknowledging these stressors can play a
role in treating the disorder.
Prognosis
Quality of life is reduced across all domains in OCD, which is vastly chronic. While psychological or pharmacological treatment can lead to a
reduction of OCD symptoms and an increase in reported quality of life,
symptoms may persist at moderate levels even following adequate
treatment courses, and completely symptom-free periods are uncommon. In pediatric OCD, around 40% still have the disorder in adulthood and around 40% qualify for remission. The risk of having at least one comorbid personality disorder in OCD is
52%, which is the highest among anxiety disorders and greatly impacts
its management and prognosis.
Age-standardized disability-adjusted life year estimated rates for obsessive-compulsive disorder per 100,000 inhabitants in 2004
no data
<45
45–52.5
52.5–60
60–67.5
67.5–75
75–82.5
82.5–90
90–97.5
97.5–105
105–112.5
112.5–120
>120
Obsessive–compulsive disorder affects about 2.3% of people at some point in their life, with the yearly rate about 1.2%. OCD occurs worldwide. It is unusual for symptoms to begin after the age of 35 and half of people develop problems before 20.Over 80% of OCD cases begin by early adulthood. Males and females are affected about equally. However, there is an earlier age for onset for males than females.
In the 7th century AD, John Climacus records an instance of a young monk plagued by constant and overwhelming "temptations to blasphemy"
consulting an older monk, who told him: "My son, I take upon myself all
the sins which these temptations have led you, or may lead you, to
commit. All I require of you is that for the future you pay no attention
to them whatsoever."The Cloud of Unknowing, a Christian
mystical text from the late 14th century, recommends dealing with
recurring obsessions by attempting to ignore them, and, if that fails,
to "cower under them like a poor wretch and a coward overcome in battle,
and reckon it to be a waste of your time for you to strive any longer
against them", a technique now known as emotional flooding.
Abu Zayd al-Balkhi, the 9th-century Islamic polymath, was likely the first to classify OCD into different types and pioneer cognitive behavioral therapy, in a fashion unique to his era and which was not popular in Greek medicine. In his medical treatise entitled Sustenance of the Body and Soul,
al-Balkhi described obsessions particular to the disorder as "Annoying
thoughts that are not real. These intrusive thoughts prevent enjoying
life, and performing daily activities. They affect concentration and
interfere with ability to carry out different tasks." As treatment, al-Balkhi suggested treating obsessive thoughts with positive thoughts and mind-based therapy.
From the 14th to the 16th century in Europe, it was believed that
people who experienced blasphemous, sexual or other obsessive thoughts
were possessed by the devil. Based on this reasoning, treatment involved banishing the "evil" from the "possessed" person through exorcism. The vast majority of people who thought that they were possessed by the
devil did not have hallucinations or other "spectacular symptoms" but
"complained of anxiety, religious fears, and evil thoughts". In 1584, a woman from Kent, England, named Mrs. Davie, described by a justice of the peace as "a good wife", was nearly burned at the stake after she confessed that she experienced constant, unwanted urges to murder her family.
The English term obsessive–compulsive arose as a translation of GermanZwangsvorstellung (obsession) used in the first conceptions of OCD by Karl Westphal. Westphal's description went on to influence Pierre Janet, who further documented features of OCD. In the early 1910s, Sigmund Freud attributed obsessive–compulsive behavior to unconscious conflicts that manifest as symptoms. Freud describes the clinical history of a typical case of "touching
phobia" as starting in early childhood, when the person has a strong
desire to touch an item. In response, the person develops an "external
prohibition" against this type of touching. However, this "prohibition
does not succeed in abolishing" the desire to touch; all it can do is
repress the desire and "force it into the unconscious". Freudian psychoanalysis
remained the dominant treatment for OCD until the mid-1980s, even
though medicinal and therapeutic treatments were known and available,
because it was widely thought that these treatments would be detrimental
to the effectiveness of the psychotherapy.
In the mid-1980s, this approach changed and practitioners began
treating OCD primarily with medicine and practical therapy rather than
through psychoanalysis.
One of the first successful treatments of OCD, exposure and response prevention, emerged during the 1960s, when psychologist Vic Meyer
exposed two hospitalized patients to anxiety-inducing situations while
preventing them from performing any compulsions. Eventually, both
patients' anxiety level dropped to manageable levels. Meyer devised this
procedure from his analysis of fear extinguishment in animals via flooding. The success of ERP clinically and scientifically has been summarized as "spectacular" by prominent OCD researcher Stanley Rachman decades following Meyer's creation of the method.
In 1967, psychiatrist Juan José López-Ibor reported that the drug clomipramine
was effective in treating OCD. Many reports of its success in treatment
followed and several studies had confirmed its effectiveness by the
1980s. However, clomipramine was subsequently displaced by new SSRIs developed in the 1970s, such as fluoxetine and sertraline, which were shown to have fewer side effects.
Many people, particularly those with contamination-related OCD, experienced new or worsened symptoms related to COVID-19 during the first few months of the pandemic.
Notable cases
John Bunyan (1628–1688), the author of The Pilgrim's Progress,
displayed symptoms of OCD (which had not yet been named). During the
most severe period of his condition, he would mutter the same phrase
over and over again to himself while rocking back and forth. He later described his obsessions in his autobiography Grace Abounding to the Chief of Sinners,
stating, "These things may seem ridiculous to others, even as
ridiculous as they were in themselves, but to me they were the most
tormenting cogitations." He wrote two pamphlets advising those with similar anxieties
In one of them, he warns against indulging in compulsions: "Have care
of putting off your trouble of spirit in the wrong way: by promising to
reform yourself and lead a new life, by your performances or duties."
British poet, essayist and lexicographerSamuel Johnson
(1709–1784) had OCD. He had elaborate rituals for crossing the
thresholds of doorways and repeatedly walked up and down staircases
counting the steps.
He would touch every post on the street as he walked past, only step in
the middle of paving stones and repeatedly perform tasks as though they
had not been done properly the first time.
The "Rat Man", real name Ernst Lanzer, a patient of Sigmund Freud,
suffered from what was then called "obsessional neurosis". Lanzer's
illness was characterised most famously by a pattern of distressing
intrusive thoughts in which he feared that his father or a female friend
would be subjected to a purported Chinese method of torture in which rats would be encouraged to gnaw their way out of a victim's body by a hot poker.
American aviator and filmmaker Howard Hughes is known to have had OCD, primarily an obsessive fear of germs and contamination. Friends of Hughes have also mentioned his obsession with minor flaws in clothing. This was conveyed in The Aviator (2004), a film biography of Hughes.
American actor James Spader has spoken about his OCD. In 2014, when interviewed for Rolling Stone
he said: "I'm obsessive-compulsive. I have very, very strong
obsessive-compulsive issues. I'm very particular. ... It's very hard for
me, you know? It makes you very addictive in behavior, because routine
and ritual become entrenched. But in work, it manifests itself in
obsessive attention to detail and fixation. It serves my work very well:
Things don't slip by. But I'm not very easygoing."
In 2022 the president of Chile Gabriel Boric
stated that he had OCD, saying: "I have an obsessive–compulsive
disorder that's completely under control. Thank God I've been able to
undergo treatment and it doesn't make me unable to carry out my
responsibilities as the President of the Republic."
In a documentary released in 2023, the footballer David Beckham discussed his compelling cleaning rituals, need for symmetry in the fridge and the impact of OCD on his life.
In 2018, American rapper NF was diagnosed with obsessive–compulsive disorder. He addresses his experience with mental illness and therapy frequently in his music, particularly in the 2023 album Hope.
In 2025, actress Jenna Ortega
revealed that she struggles with it noting: "(I have) pretty intense
OCD. Repetitive thoughts and counting everything multiple times and
having to do the same action over and over... Sometimes my nights
consist of just being really exhausted and going up and down the stairs
six times because that's what I think I need to do to make sure no one
breaks into my home."
Society and culture
Art, entertainment and media
Movies and television shows may portray idealized or incomplete representations of disorders such as OCD. Compassionate and accurate literary and on-screen depictions may help counteract the potential stigma associated with an OCD diagnosis and lead to increased public awareness, understanding and sympathy for such disorders.
The play and film adaptations ofThe Odd Couple based around the character of Felix, who shows some of the common symptoms of OCD.
In the film As Good as It Gets (1997), actor Jack Nicholson portrays a man with OCD who performs ritualistic behaviors that disrupt his life.
The film Matchstick Men (2003) portrays a con man named Roy (Nicolas Cage) with OCD who opens and closes doors three times while counting aloud before he can walk through them.
In the television series Monk (2002–2009), the titular character Adrian Monk fears both human contact and dirt.
In the novel Turtles All the Way Down (2017) by John Green,
teenage main character Aza Holmes struggles with OCD that manifests as a
fear of the human microbiome. Throughout the story, Aza repeatedly
opens an unhealed callus
on her finger to drain out what she believes are pathogens. The novel
is based on Green's own experiences with OCD. He explained that Turtles All the Way Down is intended to show how "most people with chronic mental illnesses also live long, fulfilling lives."
In the film The House That Jack Built (2018), the titular character, a serial killer, compulsively cleans a crime scene after obsessing over leaving evidence.
Cortical thickness differences in adults with OCD are linked to a network of brain-specific, developmentally expressed genes.
OCD patients have thicker precentral and paracentral brain
regions compared to controls and those with thinner precentral areas
showed greater improvement with transcranial direct-current stimulation treatment, suggesting these structural differences may serve as neural biomarkers for predicting treatment response.
Glutamatergic medications, such as N-acetylcysteine (NAC) and memantine, may improve symptoms of OCD, though high heterogeneity and potential publication bias warrant cautious interpretation. Augmenting SSRIs with NAC may modestly reduce OCD symptoms without increasing adverse events, though it may have limited efficacy. Ketamine, an N-methyl-D-aspartate
(NMDA) glutamate receptor antagonist, has shown potential for rapid and
tolerable symptom relief in OCD, but evidence is limited and
inconsistent.
Psychedelics have been investigated for their potential use in treating OCD; psilocybin
is generally well-tolerated in OCD, with symptom reduction for some
patients, but repeated dosing may be needed to maintain effects.