Umar frequently consulted Ali in judicial matters and the advice given by Ali was invariably followed. Once some persons while in the state of "Ihram" ate eight eggs of ostriches. The point that arose for consideration was as to how these men should atone for the wrong they had done. Umar sought the advice of Ali. Ali advised that these persons should mate eight camels with eight she camels, and their offspring should be sacrificed.
Once a mad woman was found guilty of adultery. Umar was inclined to punish the woman by being stoned to death. Umar sought the advice of Ali. He said that a mad person who had no control over the senses could not be declared guilty. The woman was accordingly let off.
A woman gave birth to a child six months after her marriage, She was accused of adultery. The case was referred to Ali. Ali advised that as there was no evidence of adultery the woman could not be punished merely on the ground that she had given birth to a child six months after the marriage. Ali observed that according to the Holy Quran the period from conception to the weaning of the child had been stated at thirty months, and at another place the period of the weaning of the child after birth had been stated to be two years. This means that though the normal period for the birth of a child is nine months, in some cases a child can be born after six months as well.
In the Shari'ah there were no specific orders for punishment in the case of drinking. The usual practice heretofore was that men found guilty of drinking were awarded forty lashes. It was found that this punishment was not deterrent. Umar sought the counsel of Ali. Ali observed that in the case of calumny a punishment of eighty lashes was prescribed. When a man drank he lost his senses and could indulge in calumny. Ali advised that for drinking the punishment should be the same as for the offense of calumny that is eighty lashes. This advice was accepted, and it was laid down that henceforward the punishment for drinking would be eighty lashes.
In view of the soundness of his judicial opinions, Ali was held by Umar to be the best judge. Umar paid the highest tribute to Ali when he said, "But for Ali, Umar would have been lost".