HALIFAX — Researchers from Canada and the U.S. are using math to unravel one of the greatest musical mysteries of the modern era: Who wrote “In My Life,” a nostalgic rock ballad on the Beatles’ 1965 album “Rubber Soul.”

It’s a song both John Lennon and Paul McCartney have laid claim to, sparking an enduring debate on the authorship of the melody.

But a new statistical model developed by researchers at Dalhousie and Harvard universities that was used to analyze multiple Lennon-McCartney songs has concluded that Lennon likely penned “In My Life.”

Jason Brown, a mathematics professor at Dalhousie, says the researchers analyzed the Beatles music using five main categories — melody notes, sequences of notes, chords, pairs of chords and melodic contour. Each category was then further broken down, resulting in 149 categories for data collection.

He says the model, which is 80 per cent accurate, found a 98 per cent probability that Lennon write “In My Life.”

The Canadian Press