These were the genius that Hazrat Ali (A.S.) was in his time. People always asked their problems / tough question to Hazrat Ali (A.S.), but Ali (A.S.) answered very smartly.
Five Loaves of Bread
Zarr Bin Hobeish relates this story: Two travelers sat together on the way to their destination to have a meal. One had five loaves of bread. The other had three. A third traveler was passing by and at the request of the two joined in the meal.
Whole Number and Not A Fraction
The travelers cut each of the loaf of bread in three equal parts. Each of the travelers ate eight broken pieces of the loaf.
At the time of leaving the third traveler took out eight dirhams and gave to the first two men who had offered him the meal, and went away. On receiving the money the two travelers started quarrelling as to who should have how much of the money.
The five loaf man demanded five dirhams. The three loaf man insisted on dividing the money in two equal parts.
The dispute was brought to Ali ibn Abi Taleb (as) to be decided.
Ali ibn Abi Taleb (as) requested the three loaf man to accept three dirhams, because five-loaf-man has been more than fair to you. The three loaf man refused and said that he would take only four dirhams. At this Ali ibn Abi Taleb (as) replied, "You can have only one dirham." You had eight loaves between yourselves. Each loaf was broken in three parts. Therefore, you had 24 equal parts. Your three loaves made nine parts out of which you have eaten eight portions, leaving just one to the third traveler. Your friend had five loaves which divided into three made fifteen pieces. He ate eight pieces and gave seven pieces to the guest. As such the guest shared one part from your loaves and seven from those of your friend. So you should get one dirham and your friend should receive seven dirhams.
One Day a person came to Ali (A.S.), thinking that since Ali thinks he is too smart, I'll ask him such a tough question that he won't be able to answer it and I'll have the chance to embarrass him in front of all the Arabs. He asked 'Ali (A.S.), tell me a number, that if we divide it by any number from 1-10 the answer will always come in the form of a whole number and not as a fraction.'
which animals lay eggs and which animals give birth
Hazrat Ali (A.S.) Looked back at him and said, 'Take the number of days in a year and multiply it with the number of days in a week and you will have your answer.'
The person got astonished but as he was a Mushrik he still didn't believe Ali (A.S.). He calculated the answer Ali (A.S.) gave him. To his amazement he came across the following results:
The number of Days in a Year = 360 (in Arabic Calendar)
The Number of Days in a Week = 7
The product of the two numbers = 2520
2520 divide by 1 = 2520
2520 divide by 2 = 1260
2520 divide by 3 = 840
2520 divide by 4 = 630
2520 divide by 5 = 504
2520 divide by 6 = 420
2520 divide by 7 = 360
2520 divide by 8 = 315
2520 divide by 9 = 280
2520 divide by 10= 252
One day a person came to Ali (A.S.). He was planning to ask Ali (A.S.) such a question which would take Ali (A.S.) a long time to answer and because of that his Maghrib Prayers would be delayed. He asked, 'Ali you say you know everything in the world, then tell me which animals lay eggs and which animals give birth to their young ones.
Dividing 17 Camels
Hazrat Ali (A.S.) looked back at him smiled and said, 'The animals who have their 'EARS' outside their body give birth to their young ones and the animals who have their 'EARS' inside their body lay eggs.'
A person was about to die, and before dying he wrote his Will which went as follows 'I have 17 Camels, and I have three sons. Divide my Camels in such a way that My eldest son gets half of them, the second one gets 1/3rd of the total and my youngest son gets 1/9th of the total number of Camels' After his death when the relatives read his will they got extremely perplexed and said to each other that how can we divide 17 camels like this? So after a long hard thought they decided that there was only one man in Arabia who could help them: 'Ali Ibne Abi Taalib.' So they all came to the door of Ali (A.S.) and put forward their problem.
Hazrat Ali (A.S.) said, 'Ok. I will divide the camels as per the man's will.'
He said, 'I will lend one of my camels to the total which makes it 18 (17+1=18), now lets divide as per his will'
The Eldest gets 1/2 of 18 = 9
The second one gets 1/3 of 18 = 6
and The Youngest gets 1/9 of 18 = 2
Now the total number of camels = 17
Then Hazrat Ali (A.S.) said, 'Now I will take my Camel back.'
This was the genius that Hazrat Ali was in his time.