A McGill professor has found that a mathematical equation used to describe everything in the natural world from the human heartbeat to the annual flooding levels of the Nile River, also applies to the rhythm in classical music.

After years of analyzing nearly 2,000 pieces of music Daniel Levitin discovered that this equation can describe the rhythm found in 400 years of music. It's not as if the composers knew the formula, he said, but their music somehow conforms to it.

What was also fascinating, he added, is that part of the equation, the exponent, allowed his team to distinguish between composers. Beethoven had the most predictable rhythms while Mozart and Scott Joplin had the least predictable, he said.

"It's as if those composers had their own musical, mathematical finger print," Levitin told CTV's Canada AM.

Levitin's paper on the subject was published Monday in the Proceeding of the National Academy of Sciences.

Levitin started the project several years ago after he became intrigued while reading an article about the discovery of a mathematic equation for musical pitch. He decided he wanted to try to find if the same equation applied to rhythm.

To start, Levitin and his colleagues took 1,788 different pieces of music by composers ranging from J.S. Bach to Scott Joplin, and broke each line of music down according to the length of its individual notes. The process took 500 hours.

They discovered that rhythm conforms to the 'one-over-f' law. In its simplest form the equation can be used to describe the frequency of events. The second most common event happens half as often as the most common, the third most common event happens one-third as often, and so on.

The formula is common across the world and it can be used to describe voltage fluctuations in electronics, signals across nerve endings and even DNA patterns.

"It's a kind of universal number or equation that ties properties of the world together," Levitin explained.

The formula finds that more powerful events happen less frequently than weaker events. Levitin said the human brain has picked up on these particular regularities of the physical world and that they have influenced our aesthetic responses. This would explain why in music there are more short notes than long notes.

"The composers apparently have also internalized this regularity of the physical world and they've written it into their music presumably because that's what we all want to hear," he added.

Levitin's study didn't look at pop or jazz music but he said there isn't any reason to believe the formula wouldn't apply to those genres as well.