I have a friend who is a graduate in mathematics, and he was able to make a system that is superior to the online gambling system. By using some mathematical equations and studying some complex things, you can guarantee winning 100% of the time, and there is no risk at all, hence you will never lose any money. I have seen him doing that, and using it for a long time, and never losing anything at all. This is not prohibited, truly, because when you gamble, it is based on luck and risk, but if I use this system, I am certain that I am going to win all the time.
Firstly: gambling and its types
Gambling is any dealing in which there is the possibility of gaining or losing.
Allah, may He be exalted, says (interpretation of the meaning):
{O you who have believed, indeed, intoxicants, gambling, [sacrificing on] stone altars [to other than Allah], and divining arrows are but defilement from the work of Satan, so avoid it that you may be successful
Satan only wants to cause between you animosity and hatred through intoxicants and gambling and to avert you from the remembrance of Allah and from prayer. So will you not desist?} [Al-Ma’idah 5:90, 91].
Al-Bujayrami (may Allah have mercy on him) said: Gambling is that which, if you do it, you will either win or lose.(Hashiyat al-Bujayrami `ala Sharh al-Manhaj, 4/376).
Shaykh Ibn `Uthaymin (may Allah have mercy on him) said: With regard to gambling – which is any dealing in which a person may win or lose – the one who does it does not know whether he will be a winner or a loser. All of it is prohibited; in fact it is a major sin and it will be obvious to anyone that it is evil, when he sees that Allah, may He be Exalted, mentions it alongside idol worship, intoxicants and divining arrows.(Fatawa Islamiyyah, 4/441).
If it so happens that mathematical calculations help your friend to win all the time, and never lose, then what about the other party? Is he playing to lose? Or is he playing with the possibility of both winning or losing? This is gambling.
Let us assume that there is no risk for you in this gambling, but you are calling someone else to gamble and helping him to do that, and you are consuming his wealth unlawfully by deceiving and cheating him. All of that is prohibited.
Secondly: offering prizes in competitions
It is not permissible to offer prizes for competitions, whether they are offered by an outside party or by the competitors themselves, except in the case of what is mentioned in the text narrated from the Prophet (blessings and peace of Allah be upon him) about competing in camel races, horse races and archery, and other things that come under the same heading, such as competitions in learning the Qur’an, hadiths and jurisprudence (fiqh), which help to spread and support Islam.
The basic principle regarding that is the report narrated by Abu Dawud (2574), at-Tirmidhi (1700), who classed it as sound, and Ibn Majah (2878), from Abu Hurayrah (may Allah be pleased with him), from the Prophet (blessings and peace of Allah be upon him), who said: “There should not be any prizes except for archery, camel-racing or horse-racing.”
Classed as authentic by al-Albani in Sahih Abi Dawud and elsewhere.
What is meant by the prize is what is given to the winner for beating his competitors of what the competitors decided to award to the winner.
Ibn al-Qayyim (may Allah have mercy on him) said: When competing in memorizing Qur’an, hadiths, jurisprudence and other beneficial knowledge, and getting the right answers, is it permissible to give a prize to the winner? The companions of Malik, Ahmad and ash-Shafa`i disallowed that, whereas the companions of Abu Hanifah and our shaykh allowed it. Ibn `Abd al-Barr narrated that view from ash-Shafa`i, and it is more appropriate than [allowing prizes] for archery, wrestling and swimming. Some of the scholars allowed competing for prizes in these activities, so it is more appropriate that it be permitted to compete in knowledge (for prizes). This is similar to the case of Abu Bakr’s bet with the disbelievers of Quraysh as to whether what he told them was true and sound. We have noted above that there is no textual evidence to indicate that this ruling was abrogated, and we know that he won and took the prize after the prohibition on gambling was revealed. Religion is based on establishing proof and jihad, so if betting is permissible regarding tools of jihad, then it is more appropriate that it be permissible to compete in knowledge. This view is the correct view.(Al-Furusiyyah, p. 318).
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said: If one of the two players or an outsider offers a prize, this comes under the heading of awarding a prize, and this is not allowed, except in beneficial things, such as competing and striving against one another in the activities mentioned in the hadith: “There should not be any prizes except for camel-racing, horse-racing or archery.” That is because giving money as a prize in competitions in which there is no religious or worldly benefit is not allowed, even if it is not gambling.(Majmu` al-Fatawa, 32/223).
What is disallowed in this regard is not only gambling; rather prizes are also disallowed in anything other than what is mentioned in the religious texts, which is what helps one prepare for physical jihad, and what may be included with that of things that help in intangible jihad to spread and support the religion.
For more information, please see the answer to question no. 147826.
Conclusion:
What your friend is doing is prohibited and comes under the heading of consuming people’s wealth unlawfully. Therefore he must repent from that and get rid of the money that he acquired through gambling.
For more information, please see the answer to question no. 219679.
And Allah knows best.