For future updates on our website,
app, new features, and content, be sure
to follow us on Instagram! @imam.and.science
For any Inquiries contact us on ask@imamandscience.com
Back

Imam Ali and The Science of Arithmetic

The life of Imam Ali (peace be upon him) shines with countless examples of profound knowledge in diverse fields. Among these, his mastery of arithmetic and logical reasoning stands as a testament to his unmatched intellect. His responses to complex problems not only solved the immediate issue but also revealed principles that modern scholars recognize today in fields such as mathematics, logic, and jurisprudence. In this chapter, we explore some of the most well-known incidents that display his mathematical wisdom.

The Story of the Loaves

One day, two friends were eating together. One of them had five loaves of bread, and the other had three loaves.

As they were about to eat, a traveler passed by. They invited him to join them. He agreed, and the three of them ate all the eight loaves equally.

After they finished eating, the traveler wanted to thank them. He gave them eight coins and left, saying, “Share this money between you.”

Now the two friends started arguing:

  • The man with five loaves said: “I gave five loaves, so I should get five coins. You gave three loaves, so you get three coins.”
  • The man with three loaves said: “No! We should share the coins equally. Four for me, four for you.”

They couldn’t agree, so they went to Imam Ali (peace be upon him) to solve the problem.

Imam Ali first told the man with three loaves: “Your friend was fair when he offered you three coins because he gave more bread than you. Just accept it.”

But the man said: “No! I only want what is truly mine!

So Imam Ali smiled and said: “If you want exactly what belongs to you, then you only get one coin, and your friend gets seven coins.”

The man was shocked: “How is that possible?”

Imam Ali explained:

“Let’s cut each loaf into three pieces (so we can count better). Then:

  • 5 loaves × 3 = 15 pieces from the man with five loaves
  • 3 loaves × 3 = 9 pieces from the man with three loaves

Together, they had 24 pieces of bread.

Since they shared the food equally, each person ate 8 pieces (because 24 ÷ 3 people = 8 pieces each).

Now, the traveler ate 8 pieces. But from where did these 8 pieces come?

  • The man with five loaves originally had 15 pieces but ate 8, so he gave 7 pieces to the traveler.
  • The man with three loaves originally had 9 pieces but ate 8, so he gave 1 piece to the traveler.

👉 Therefore, the traveler ate 7 pieces from the first man and 1 piece from the second man.

Since the traveler gave 8 coins for the 8 pieces he ate,
7 coins go to the man who gave 7 pieces,
1 coin goes to the man who gave 1 piece.

That’s why your real share is 1 coin, and your friend’s share is 7 coins.

When the man heard this, he finally understood and happily accepted the decision.

Explanation:
Here, Imam Ali (peace be upon him) applied what we might call a proportional division. He calculated not based on the count of loaves, but based on the actual amount shared. This reflects an early understanding of proportionality and fairness beyond mere superficial counts.

(Reference: Qada’ Amir al-Mu’mineen by al-Tustari, p.126; al-Haqq al-Mubeen fi Qada’ Amir al-Mu’mineen, p.97, Dar Karam)


The Story of the Camels

In another narration, three Bedouins approached Imam Ali (peace be upon him) with a problem. They said, “We have seventeen camels. The first among us is entitled to half, the second to a third, and the third to a ninth. Please divide them among us.”

Without hesitation, Imam Ali (peace be upon him) said, “Would you be satisfied if I added one of my camels to yours and then divided them?” They agreed. Imam Ali added his own camel, bringing the total to eighteen. He then divided them as follows:

  • The first man took half: nine camels.
  • The second man took a third: six camels.
  • The third man took a ninth: two camels.

When they counted, they found that together they had received seventeen camels, and Imam Ali (peace be upon him) then said, “This camel is mine, which I added; I shall now take it back.”

Each man left satisfied, having received his rightful share.

Explanation:
In modern mathematical terms, the Imam cleverly resolved the fractions by temporarily increasing the total number of camels to a number divisible by 2, 3, and 9 (the denominators of the heirs’ shares). By adding his own camel to make it 18, he avoided fractions entirely, then returned the extra after the fair division. This is an elegant, real-life application of finding a common denominator.

(Reference: Tareekh al-Khulafa by al-Suyuti, p.179; Qada’ Amir al-Mu’mineen by al-Tustari, p.125)


The Minbar Issue: Her Eighth Became a Ninth

One day, while Imam Ali (peace be upon him) was on the pulpit, a woman posed a question about inheritance, a question that had perplexed even the most knowledgeable. Without hesitation, Imam Ali replied: “Her eighth has become a ninth.”

The case involved a man who died leaving behind a wife, two parents, and two daughters. According to Qur’anic inheritance laws, the wife was entitled to an eighth, the parents to a sixth each, and the daughters to two-thirds. But these prescribed shares, when summed, exceeded the estate. The woman wanted to know how much she, as the wife, would receive.

Imam Ali (peace be upon him) explained that under the ruling of Umar ibn al-Khattab, who introduced the concept of ‘awl (proportional reduction), the shares were reduced proportionally to fit the estate. Therefore, her rightful eighth was reduced to a ninth. Imam Ali’s reply summarized this ruling concisely and highlighted the underlying issue.

Samaak narrated this incident, saying, “I asked Ubaydah: How was that?” He explained that Umar assigned two-thirds to the daughters, one-sixth each to the parents, and one-eighth to the wife. But these shares together exceeded the estate. Umar ordered the heirs to be given their prescribed shares, but when calculated, nothing remained for the daughters’ two-thirds. Umar then asked, “Where is their two-thirds?” Imam Ali (peace be upon him) answered, “They receive whatever remains.”

Explanation:
This incident is a fascinating intersection of jurisprudence and arithmetic. Imam Ali’s awareness of proportionality and his critique of ‘awl show both his mathematical insight and his commitment to the integrity of Qur’anic law. He encapsulated a complex legal-mathematical issue in a single, profound sentence.

(Reference: Qada’ Amir al-Mu’mineen by al-Tustari, p.126; al-Haqq al-Mubeen fi Qada’ Amir al-Mu’mineen, p.97; Ma‘adin al-Jawahir by Sayyid Mohsin al-Ameen, vol.2, p.247)


Multiplying the Days of the Year by the Days of the Week

Imam Ali (peace be upon him) once stated that the number of days in the year was 360. If we factor this number into its prime components, we find:

360 = 2³ × 3² × 5.

This number is divisible by every natural number from one to ten except seven. But if we multiply 360 by seven, the number of days in the week, we obtain 2520—a number divisible by every number from one to ten without remainder.

A man once approached Imam Ali (peace be upon him) and asked, “What is the number that is divisible by all numbers from one to ten without remainder?” Imam Ali answered him immediately, “Multiply the days of your year by the days of your week.” The man, satisfied with the answer, departed.

Explanation:
In modern terms, Imam Ali was identifying what we call the least common multiple (LCM) of the numbers from one to ten. By recognizing that multiplying 360 (a number already divisible by many factors) by seven would complete the set of divisibility, he provided a practical and elegant solution. This demonstrates his deep understanding of number theory long before formal mathematical terminology existed.

(Reference: Qada’ Amir al-Mu’mineen by al-Tustari, p.126; al-Haqq al-Mubeen fi Qada’ Amir al-Mu’mineen, p.97)

These stories are more than mere anecdotes; they reveal the depth of Imam Ali’s (peace be upon him) intellectual capacity, his mastery of both divine law and worldly sciences, and his unique ability to convey complex truths with simplicity and wisdom. His answers, though delivered in moments, continue to inspire reflection, study, and admiration across generations.