Several weeks ago, I was home on a Sunday morning when, for no apparent reason, these words popped into my head: "Funky Cold Medina." That's a line from a song by rapper Tone Loc.
I'm told it was a hit in the 1990s, but I'd never heard it until the night before. I was at a karaoke bar. My friend Jay Beezley sang it.
When the song reappeared in my head the next day, I could hear Jay singing the chorus again and again and again.
I was stuck with the song for nearly a day and a half before it finally went away, but it left behind a nagging question: Why do we get songs stuck in our heads in the first place? I figured someone must be trying to find an answer.
Victoria Williamson is a psychologist at Goldsmiths College in London. A few years ago, she became fascinated by tunes that stick in our heads.
"I personally couldn't believe how little there was in terms of research on this phenomenon," she says. "It seemed to happen to me very frequently."
She found that scientists used a range of terms to describe the experience. Stuck-song syndrome. Sticky music. Cognitive itch.
The most common term was this: earworm.
A few years ago, Williamson collaborated with a BBC radio program in the UK and asked listeners to email and text their experiences with earworms.
Here are some responses she received: "My bloody earworm is that bloody George Harrison song you played yesterday. Woke up at 4:30 this morning with it going around me head."
"I've got 'ch-ch-ch-changes' by David Bowie as a repetitive earworm, because it was the last song I heard before the battery on my iPod ran out."
"My earworm is still 'Alive' by Pearl Jam and has been for days."
Williamson collected more stories through an international online survey. Then she looked for patterns to understand what causes these tunes to automatically pop into our heads and stay there. She found several triggers.
"The first one is music exposure, which means the person has heard the music recently," she says.
No surprise there. That explains why I was stuck with "Funky Cold Medina."
Another unsurprising finding was that if you hear a song repeatedly, you're more likely to get stuck with it. But sometimes songs pop into our heads even when we haven't heard them for a long time. In this case, something in our current environment may trigger the memory of a song.
Williamson experienced this herself recently, when she was in her office and noticed an old shoebox.
"It's from a shop called Faith," she says. "And just by reading the word faith, my mind went down a line of dominoes and eventually reached the song 'Faith' by George Michael. And then he was in my head for the rest of the afternoon."
Williamson says she found another trigger: stress.
One woman in Williamson's survey said a song first got stuck in her head when she was 16 and taking a big exam. The song was "Nathan Jones" by Bananarama.
"She now gets that song in every single moment of stress in her life," says Williamson. "Wedding, childbirth, everything."
But why is it that music gets stuck in our heads? Why not lines from movies or TV shows or books?
I asked Daniel Levitin, of McGill University in Montreal. He's an expert on the neuroscience of music, and he's been thinking about the phenomenon.
Levitin thinks there may be an evolutionary explanation for why music sticks in our brains. He notes that modern humans have been around for some 200,000 years, but he says written language may have been invented only 5,000 years ago.
"So for a very long period of time, we needed to remember information, information like where the well is, or what foods are poisonous and which aren't, and how to care for wounds so they won't become infected."
Levitin thinks for most of human history, people memorized this kind of information through songs. That practice continues today in cultures with strong oral traditions. He says the combination of rhythm, rhyme and melody provides reinforcing cues that make songs easier to remember than words alone.
"So it may be the case that brains and music in effect selected each other through Darwinian natural selection and co-evolved in such a way that songs were intended to get stuck in our heads, and that's why we still have them," he says. "It's a vestige of that."
That's just a hunch, of course. But he says the main question people ask him about the phenomenon of stuck songs is this: How do we turn it off? Levitin doesn't know, but he offers a piece of advice.
"You just think of another song and hope that that'll push out the first one."
But then, of course, you might just end up with a new song stuck in your head.