## Analysis of Mathematical Pattern in Quran.

Discuss subjects related to logic and mathematics.
Averroes
Posts: 73
Joined: Sun Sep 10, 2017 9:01 am

### Analysis of Mathematical Pattern in Quran.

In the name of Allah, the Most Compassionate, the Most Merciful

Welcome to my forum!

Following a post that I have written on Philosophy Now about the mathematical patterns in the Holy Quran, it has recently been brought to my attention that there has been a claim of a "debunking" or refutation of these patterns. This thread intends to be a "debunking of the debunker" or more formally, the refutation of the refutation! This reminds me of the title of a book by Ibn Rushd (the real Averroes)

To summarize the present situation, I present the following, which one can skip if one already knows the situation and thus read directly as from the second post.

So, I had written a post on Philosophy Now in the thread How deep is maths? on December 5, 2017, addressing the mathematical pattern involving the whole of the Holy Quran exhibiting the Golden Ratio.

The post can be read here: https://forum.philosophynow.org/viewtop ... 38#p342538

Recently, it has been brought to my attention that there has been an attempt to debunk the mathematical pattern in the Holy Quran by a blogger going by the name of Martin Taverille.

His blog is available here: https://quranspotlight.wordpress.com/ar ... -debunked/

In this thread, I will examine the claims of Martin Taverille and expose his errors and, in the end, show that the mathematical pattern in the Holy Quran has remained unscathed and has always been shinning with all its glory.

Averroes
Posts: 73
Joined: Sun Sep 10, 2017 9:01 am

### Re: Analysis of Mathematical Pattern in Quran.

Debunking the Debunker!

There are two parts to this refutation, the first part is historical and the second is mathematical. The historical part has already been addressed in the comments sections of the blog of the alleged debunker (i.e. Martin Taverille) and is being merely reproduced here. The so-called mathematical debunking has also in turn already been debunked on the web, and here I have expounded on the debunking of the debunking by considering the situation in greater depth. So, after reproducing the historical refutation, I will expound on the mathematical refutation.

1. Historical Refutation.

The first line itself that Martin writes into his article is mistaken. He says:
Martin Taverille wrote:Before beginning, it’s well worth pointing out that the number of ayats into which the Qur’an is divided was not part of Muhammad’s “revelation” (I’m talking here about the numbering, not the text itself or its ordering). Rather there were different systems of dividing up the surahs into ayats (6000, 6204 etc.), and the 6236 divisions devised by the Kufah school simply became most popular.
Those statements quoted above are in fact false. Consequently, Martin could not back these claims with any evidence whatsoever when he was challenged to do so in the comments section of his blog. Indeed, he was challenged by a Muslim thus:
Texan wrote:Regarding 6,000, 6,204, 6,219, and 6,236 verses, what’s the proof on this? Britannica just mentions this as a passing comment. You’ve not offered any proof either. How do you prove Qur’an, as taught by Prophet (saws), had many versions and Kufic version was any different from what he taught?. Kufa, as a city, was founded during the time of second caliph Umar ibn Khattab (R.A). All four righteous caliphs were huffaz themselves. They were all contemporaries of prophet (saws) and prayed along with him. Since they had direct access to prophet (saws) himself and learnt Qur’an directly from him, what would be the reason for them to change or alter the sequence of suras or ayas?

If you are insinuating that Qur’anic verses were not codified during the life of Prophet (saws) then you are wrong. Or, can you please back up your claim? This is what Muslims believe which is backed up by sahih hadith, books on sunnah and seerah:

Order of Verses:

Muslim scholars agree that the order of the verses in every chapter was done or commanded by the Prophet (saws) himself following the commands of Almighty Allah. The Prophet (saws) once told his Companions after he had received a certain revelation that the arch-angel Gabriel had specified for him the particular order of verses (Ahmad). There are also many incidents narrated in the books of Sunnah regarding the Prophet’s (saws) recitation during prayer. The Companions used to pray every day behind the Prophet (saws) and he used to recite the Qur’an in the order given to him by Allah, and they used to learn and memorize from his recitation. There have never been any incident in which any of the Companions reciting in any order that violated the order of the verses showed to us by the Prophet (saws).

Order of Surahs:

As for the order of the surahs (chapters), the most accepted view is that it was also applied following an instruction given by Almighty Allah. It has been recorded that the Prophet (saws) reviewed the Qur’an with the arch-angel Gabriel 24 times all within his life. Every year, he used to review it once during the month of Ramadan with Gabriel. During the final year of the Prophet’s life, Gabriel revised the Qur’an twice with the Prophet (saws) as a way of confirming it. The Prophet (saws), in turn, used to follow this order in teaching his Companions and communicating the message to them.
Martine taverille wrote:But regarding ordering of the text itself, it is possibly that there is evidence that the present word ordering goes back to Muhammad. That’s beyond the scope of my article.
Note: 'huffaz' is an Arabic word which is the plural form of the Arabic word 'haffiz'. A haffiz is someone who has memorized the whole of Quran in the order in which it was communicated by the blessed Prophet Muhammad(peace and blessings of Allah be upon him).

So that was already settled in the blog itself but needed to be mentioned here as not many people read the comments section! So that was the easy part of the refutation. But the mathematical refutation is not so easy but requires some rather elaborate mathematical and computer programming concepts and skills inorder to uncover and comprehend.

Averroes
Posts: 73
Joined: Sun Sep 10, 2017 9:01 am

### Re: Analysis of Mathematical Pattern in Quran.

2. Mathematical Refutation

In this part, I expound on some of the refutations of the so-called debunking of the even-odd pattern of the Quran. And in order to achieve this objective, I have had to write a computer program to estimate the probability of occurrence by mere chance of both of these patterns, i.e. the even-odd pattern and the Golden ratio pattern in the Quran. So, after refuting the debunker, I have shown, firstly, that the even-odd pattern is a statistically significant event. And, secondly, I show that the Golden ratio is practically impossible by pure chance alone. The computer program is given in the code window at the bottom of this post, and ways to experiment with the code is provided along with tips to make it easy for those who might want to experiment with the codes.

It is important to consider that the so-called debunking of the mathematical pattern of the Holy Quran does not even mention, let alone address, the golden ratio pattern in the Quran.

Warning: For those who are not somewhat friendly with mathematics, statistics and computer science this post might be a difficult read.
____________________________________

There are many issues with the so-called debunking by Martin Taverille of the mathematical pattern of the Quran. The main issues are as follows:

1. Misrepresentation of the Holy Quran.
2. Misunderstanding of the word 'pattern'.
3. Misunderstanding of statistical concepts and statistical analysis.

First consideration: Misrepresentation of the Holy Quran

One of the main issues with the blog of Taverille was that he had misrepresented the Holy Quran. The text of the Quran is organized with particular ayaats/verses arranged in a particular well-defined order and then collections of these are grouped in different surahs/chapters which are in turn organized in a particular well-defined order which considered collectively as such is called the Holy Quran. There are 6236 verses in the Quran spread in the 114 chapters of the Quran. Were one to add or remove verses (or even a word or a letter) to the text of the Quran, then the resulting text would no longer be the Holy Quran. If we are to study the structure of Holy Quran, then it is a necessary condition that nothing be added or removed to the basic constituents of the Quranic text i.e. letters, words, and statements. And if one is to refute the mathematical pattern in the overall structure of the Quran, then that condition must be adhered to strictly otherwise the resulting refutation would amount to what is called in logic the fallacy of the strawman argument.

And in fact, Martin’s whole debunking hinges on adding or removing verses from individual surahs of the Holy Quran. The evidence for that is both in the text of his blog and in his computer program at the end of the blog. In the text Taverille says:
Martin Taverille wrote:Incidentally, it is sometimes claimed that the distribution of ayats has to be exactly as it is for the “miracle” to work, and thus it supposedly has a useful function as a sort of checksum against change (in the numbering at least). However, there are many ways that the total number and distribution of ayat numbers could be different without affecting this property. For example, you could add or subtract any multiple of 2 to the number of ayats of any surah in the even s+a group.
The above bolded and underlined statement of the quotation is clear textual evidence that the so-called debunking was just a strawman argument. The evidence from the computer program will not be understood by laypersons in computer programming, but I will try to explain to the best of my ability. The relevant section in the program where this issue arises is as follows:

Code: Select all

for i = 0 to UBound(ayats)
ayats(i)=fix(((114-i)^2)/77)+1
'ayats(i)=114-i   'uncomment to test that there are 100%
'matches when ayats are a mirror image of suras
totalAyats = totalAyats + ayats(i)
next
When this code is executed, an array or list of integers is generated. I ran this piece of code and the result is the incorrect list as follows:

Incorrect list: [169, 166, 163, 161, 158, 155, 152, 149, 146, 144, 141, 138, 136, 133, 130, 128, 125, 123, 120, 118, 115, 113, 110, 108, 106, 103, 101, 99, 97, 94, 92, 90, 88, 86, 84, 82, 80, 78, 76, 74, 72, 70, 68, 66, 64, 62, 61, 59, 57, 55, 54, 52, 50, 49, 47, 46, 44, 43, 41, 40, 38, 37, 36, 34, 33, 32, 30, 29, 28, 27, 26, 25, 23, 22, 21, 20, 19, 18, 17, 16, 16, 15, 14, 13, 12, 11, 11, 10, 9, 9, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1]

This list contains 114 elements. Each element is intended to represent a surah and the value of the element represents the number of ayaats in a surah. The elements are not in order such that even if the first element of the above list is 169, it is not intended to represent that the first surah contains 169 verses, but merely intends to represent that there is a surah which contains 169 verses. But this whole scheme is a misrepresentation of the Holy Quran. If we just look at the end of the above list, we observe that there is a sequence of 8 consecutive 1s, and in the Holy Quran there are absolutely no surahs which have only one verse. The shortest surahs in the Holy Quran contain 3 verses (Surah Asr, Surah Kawthar, and Surah Nasr). The correct array or list to represent the structure of the Holy Quran should have been the following:

Correct list: [7, 286, 200, 176, 120, 165, 206, 75, 129, 109, 123, 111, 43, 52, 99, 128, 111, 110, 98, 135, 112, 78, 118, 64, 77, 227, 93, 88, 69, 60, 34, 30, 73, 54, 45, 83, 182, 88, 75, 85, 54, 53, 89, 59, 37, 35, 38, 29, 18, 45, 60, 49, 62, 55, 78, 96, 29, 22, 24, 13, 14, 11, 11, 18, 12, 12, 30, 52, 52, 44, 28, 28, 20, 56, 40, 31, 50, 40, 46, 42, 29, 19, 36, 25, 22, 17, 19, 26, 30, 20, 15, 21, 11, 8, 8, 19, 5, 8, 8, 11, 11, 8, 3, 9, 5, 4, 7, 3, 6, 3, 5, 4, 5, 6]

The correct list is in order, but that is not the main concern here. The essential point here is that each element of the list/array can be paired in a one-to-one correspondence with a surah of the Holy Quran such that the value of the element of the list corresponds to the number of verses in the surah it is paired with. Whereas for the array generated by Martin's code this would not have been possible.

Now, this misrepresentation of the Quran alone in the blog of Taverille is enough to refute his whole debunking of the mathematical pattern of the Quran. But there are many more mistakes he had made, which we will continue exposing.

We already know that there are 6236 verses in the Holy Quran. If one were to add each element of the correct list presented above, the result would turn out to be 6236. But if we were to add all the elements in the incorrect list of Martin, the result would be 6559. So Martin has added 323 verses to his incorrect representation of the Quran! And this is yet another misrepresentation. How did Martin come up those additional 323 verses? And how do we access them?

Allah, the All-Wise says in the Holy Quran:
• Or do they say, "He invented it"? Say, "Then bring ten surahs like it that have been invented and call upon [for assistance] whomever you can besides Allah, if you should be truthful." [Quran, interpretation of meaning 11:13]
• Or do they say [about the Prophet], "He invented it?" Say, "Then bring forth a surah like it and call upon [for assistance] whomever you can besides Allah, if you should be truthful." [Quran, interpretation of meaning 10:38]
• Say, "If mankind and the jinn gathered in order to produce the like of this Qur'an, they could not produce the like of it, even if they were to each other assistants." [Quran interpretation of meaning 17:88]
________

Second consideration: Misunderstanding of the word 'pattern'.

Indeed, the word 'pattern' was misunderstood by the so-called debunker Martin Taverille. And that is evidenced in both the text of the blog and the code script at the end of the blog. The algorithm which Martin tried to implement in VBScript at the end of the blog is erroneous on that account as well. I said "tried to implement" because again the coding is not correct as the logic is faulty. The philosophical issue is that Martin does not understand the meaning of the word "pattern." From the dictionary:

pattern: A regular and intelligible form or sequence discernible in the way in which something happens or is done.
Site: https://en.oxforddictionaries.com/definition/pattern

Martin says:
Martin Taverille wrote:Using computer simulations with random numbers and a similar distribution of ayats as we have in the Qur’an, I found that the odds of finding a match after randomly selecting half the surahs are approximately 1 in 170.
Now if one were to randomly select the surahs to form the two groups, then this would scarcely be considered as a pattern. As a matter of fact, this process itself contradicts the very definition of a pattern! He implements this scheme in the algorithm with some basic programming codes thus:

Code: Select all

do while s < 57
Randomize()
randomSura = Int(114 * Rnd())+1

'check through array to avoid adding duplicates
c = 0
do while c <= s - 1
if randomSura = selection(c) then
exit do
end if
c = c + 1
loop
if c = s then
selection(s) = randomSura
sumSelectedSuras = sumSelectedSuras + randomSura
s = s + 1
end if
loop
A pattern requires a rule which is applied systematically, and if one were to choose randomly which surahs to include in either group then as there would thus be no regularity or intelligibility (as the process is random) that would contradict the very definition of a pattern! So his whole algorithm was literally just sheer nonsense, even though it had fooled a great many laypersons who lacked the proper philosophical, mathematical and computer science background! Again, this alone refutes his whole debunking scheme. But there is more to mention.
______

Third consideration: Misunderstanding of statistical concepts

There are many statistical concepts that Martin misconstrued as a result of the previously mentioned mistakes.

Taverille wrote:
Martin Taverille wrote:Incidentally, it is sometimes claimed that the distribution of ayats has to be exactly as it is for the “miracle” to work, and thus it supposedly has a useful function as a sort of checksum against change (in the numbering at least). However, there are many ways that the total number and distribution of ayat numbers could be different without affecting this property. For example, you could add or subtract any multiple of 2 to the number of ayats of any surah in the even s+a group.
We have already seen that the ayaats in the Holy Quran cannot be added to or removed from the Holy Quran if we are to study the structure of the Quran. In this context, therefore, the distribution of ayaats means how the ayaats already present in the Quran are organized or configured. Since we cannot add or remove verses from the Holy Quran, it logically follows that from each surah as well we cannot add or remove verses otherwise that would change the surah (i.e. both its meaning and structure would change) and hence the Quran itself would change. The only way we can consider different distributions of ayat in the Quran is if the surahs were organized in a different order than they actually are but without modifying the number of verses in each surah. This is what was meant by a different distribution of ayaats in the description of the mathematical pattern of the Holy Quran.
For example, actually the first surah (Surah Fatiha) has seven verses and the second surah (Surah Baqarah) has 286 verses. One could think of swapping them such that the first surah becomes surah Baqara and the second becomes surah Fatiha. And while doing this, even though the message of the Quran would still be the exact same, yet it would be a different configuration/distribution of ayaats in the Holy Quran.

Another mistake of Taverille in this same category is his misunderstanding of the nature of the even-odd sums pattern itself and this results in part due to his misunderstanding of the word 'pattern' itself.

Taverille says:
Taverille wrote:Thus both apparent coincidences just simplify to a single one because both in fact count the same quantity as part of each side of its equation. They are not two independent coincidences.
Note: A surah of the Quran means a chapter of the Quran and an ayaat means a verse.

As already mentioned the so-called debunking article of Taverille does not at all address the pattern of the Golden ratio in the Quran but addresses an irrelevant issue with respect to the even-odd pattern only.

So we have the following equations for the odd-even pattern:

(1) the sum of the chapter numbers = the sum of all the odd S-sums of chapter and verse numbers.
and
(2) the sum of all the verses = the sum of all even S-sums of chapter and verse numbers.

The two equations mentioned above are conditions/rules that the present arrangement of the Quran fulfills. Even if the fulfillment of one brings about the fulfillment of the other, they are still two conditions. And one cannot do away with either one of them, otherwise the other would have no sense. For example, if two separate individuals come to meet each other, then when they are together one cannot just ignore one of them, otherwise, there would be no “togetherness.” And the fulfillment of these two conditions by the present configuration of surahs in the Holy Quran is what amounts to the Quran exhibiting this pattern.

These were the main logical and semantic errors which completely refute the so-called debunking of the mathematical pattern of the Holy Quran by Martin Taverille. Now, having refuted the debunking, I will offer, if Allah wills, the correct statistical analysis of the mathematical pattern of the Holy Quran.

The pertinent question to ask at this point is as follows: how likely/unlikely is that occurrence of the even-odd pattern in the Quran? Is it statistically significant? How likely is it that the present configuration of the Quran fulfills the two equations mentioned above?

The calculations of Martin Taverille are unsurprisingly completely wrong since he completely misunderstood the problem. So, I did everything all over again from scratch. Below are my results.
________________________________

Statistical Analysis

A. Even-Odd sums pattern.

One must first understand the mathematical situation at hand. We have 114 surahs in the Quran and each surah contains a certain number of ayaats from 3 to 286. Now, the question: how many ways are there to organize the 114 surahs of the Quran?

The answer to that is a very very big number. In the situation that is relevant to us, there are about 1.733059 x 10E+173 ways of arranging the 114 chapters/surahs of the Holy Quran. For this present problem, this number is NOT factorial 114 but less because many surahs have the same number of verses (for example, both Surah 111 and Surah 113 have 5 verses) and this must be taken into consideration in the calculation of possibilities. If each surah had a different number of ayaats, then the total number of possible combinations would have been factorial 114. A side consideration here, in mathematics, what is being referred to here as a "combination" is rather called a "permutation", but I will keep using the term "combination" because people outside mathematics are more familiar with the latter than the former.

Anyway, in either case, this is a huge number. To get an idea, take the number 2 and put 173 zeros behind it! This is about the number of ways we are having to deal with here! An exhaustive search of all these possibilities will take too much time (literally many millions of years on my computer!), so computer scientists in general resort to computer simulation with random numbers to estimate the probability of this occurrence.

So, as is standard in the field of computer science, I have written a computer program to estimate the probability that a given configuration of surahs and ayaats will satisfy by chance the two equations (a.k.a. constraints) mentioned above. And it turns out that we have a probability of about on average 1 in 1000 for that to be the case by pure chance. I have added my program, which I wrote in a computer language called Python 2.7, at the bottom of this post.

This is a beautiful result. For at present the threshold for statistical significance is set at 5% and my result is way below that level, i.e. about 50 times smaller. And that’s very good for the pattern if one was wondering what this all means in the end.

Something (i.e. an event or occurrence) is statistically significant if the probability of it occurring by chance is less than 5%.
That’s the definition of statistical significance. And as I said my results are about 50 times below that threshold.

Already here Martin Taverille has been completely debunked. But there is so much more on this that needs to be mentioned. So, since Martin Tavernille has been completely refuted, let us put him aside and concentrate on the pattern in the Holy Quran itself.
___________________________

B. The golden ratio revisited!

Now, the odd and even pattern even if beautiful was not the main subject of my post in December of 2017 on Philosophy Now! The main subject of my post was the golden mean. So, I will proceed to its statistical analysis now, if Allah wills.

Let S be a variable representing the sum of a surah number and number of ayaats in that surah. So, for example, if we have a surah/chapter with number C and having V number of ayaats/verses, then S=C+V.

We have already shown that for the present configuration of the Holy Quran:
• (Sum of repeating S)/ (sum of unique S)= golden ratio= 1.618 (to 3 decimal places)
Now, if we were to reshuffle the surahs of the Holy Quran, then not only will the even-odd pattern change but the golden ratio pattern as well will change.

Now, that too is a situation that must also be investigated statistically. So, how likely is it that the present configuration of the Holy Quran exhibiting the golden ratio is by pure chance?

As I already mentioned, I created a program to compute these probabilities. The program, given below, simulates the shuffling of the present arrangement of the surahs of Holy Quran, and then calculate for each generated combination, the ratio of the sum of the repeating S over the sum of the unique S. The program also calculates for each combination generated randomly, the even-S sums and the odd-S sums. I allowed the program to randomly select 20, 000, 000 combinations each being different from the original arrangement of the Quran and test for certain conditions. The resulting probabilities are as follows:

1. Probability of a random combination satisfying even-odd sums criteria ≅ 1 in 1000
2. Probability of a random combination being within 5% of the golden mean ≅ 1 in 73 000
3. Probability of a random combination being within 1 % of the golden mean ≅ 1 in 333 000
4. Probability of a random combination exhibiting to 3 d.p. the golden mean ≅ 1 in 10, 000, 000

5. Probability of a random combination being within 5% of golden mean AND satisfying even-odd sums criteria < 1 in 20, 000, 000
6. Probability of a random combination being within 1% of golden mean AND satisfying even-odd sums criteria < 1 in 20, 000, 000
7. Probability of a random combination exhibiting to 3 d.p. the golden mean AND satisfying even-odd sums criteria < 1 in 20, 000, 000

Note that a "random combination" here means a combination generated randomly by shuffling the surahs of the present arrangement of Quran in a different order. Now, one must be able to appreciate here that my use of randomness is different from that of Martin Taverille because in this case, I have not altered the internal structure of any surahs and also the same rules are being applied to each random combination being generated. The rules here are the two functions defined at the start of my program named: sum_even_odd_list() and ratio_cal(). Hence, here one can talk of two different patterns. The application of a rule is what can generate a pattern. However, here these rules/functions are not being used to generate a pattern but are being used to recognize if there is one.

Note as well that for the fifth to the seventh probabilities, an approximate equality relation could not be given for these probabilities but only be given in terms of an inequality. The reason for this being that of 20, 000, 000 combinations tested, not one combination(i.e. other than the original) satisfied these joint conditions simultaneously. But now, since we know that our original arrangement exhibits both the even-odd criteria and the golden mean to 3 d.p., we can come up with these inequality relations. The symbol '<' means "less than." The symbol '≅' means "approximately equal to." The abbreviation "d.p." means "decimal places."

Note also that the joint probabilities of (5) to (7) cannot be computed by the multiplication of the probabilities of the individual events in the joint because they are not independent events.

As can be seen from these ridiculously small probabilities, the conclusion is that the mathematical pattern in the Holy Quran is extremely unlikely by pure chance alone. And we should not forget that this is just the pattern of the overall arrangement of the Holy Quran. We have not here even considered the other more elaborate patterns within each individual surahs such as the ring structure in surah 2, and other numerous linguistic patterns present in the Holy Quran! So the mathematical pattern in the Holy Quran is still shinning with all its glory.

My codes are available in the code window below.

Code: Select all

# Golden ratio in the Holy Quran program in Python 2.7
# written by Averroes in September 2018

import random
import operator
from math import floor

# this function takes a list and returns a list
# of two integers,i.e. the sum of even and the sum of odd
def sum_even_odd_list(l):
list_even = []
list_odd = []
for n in l:
if n % 2 == 0:
list_even.append(n)
else:
list_odd.append(n)
result = [sum(list_even), sum(list_odd)]
return result

# takes a list and returns the ratio of sum of repeated over sum of unique elements
def cal_ratio(l):
unique = []
freq_sum = {}

for x in l:
if x in freq_sum:
freq_sum[x] += 1
else:
freq_sum[x] = 1

for key, value in freq_sum.items():
if value == 1:
unique.append(key)

sum_repeated= sum(l)-sum(unique)

return float(sum_repeated) / sum(unique)

print "\n             The Golden Computation Output!"
print "              -----------------------------\n"

a = [7, 286, 200, 176, 120, 165, 206, 75, 129, 109, 123, 111, 43, 52, 99, 128, 111, 110, 98, 135, 112, 78, 118, 64, 77,
227, 93, 88, 69, 60, 34, 30, 73, 54, 45, 83, 182, 88, 75, 85, 54, 53, 89, 59, 37, 35, 38, 29, 18, 45, 60, 49, 62,
55, 78, 96, 29, 22, 24, 13, 14, 11, 11, 18, 12, 12, 30, 52, 52, 44, 28, 28, 20, 56, 40, 31, 50, 40, 46, 42, 29, 19,
36, 25, 22, 17, 19, 26, 30, 20, 15, 21, 11, 8, 8, 19, 5, 8, 8, 11, 11, 8, 3, 9, 5, 4, 7, 3, 6, 3, 5, 4, 5, 6]

b = range(1, 115)

numTrial = 10000 # number of trials set to 10,000. Can be set to another number.
p=0.05
p2=0.01
count = 0
count2 = 0
count3 = 0
count4 = 0
count5 = 0
count6 = 0
count7 = 0

for x in range(numTrial):
c=a[:]
random.shuffle(c)
sum_even_odd=sum_even_odd_list(d)
s_even = sum_even_odd[0]
s_odd = sum_even_odd[1]
ratio = cal_ratio(d)
if x%100000 == 0:
print x
if (s_odd == 6555 and s_even==6236):
count = count + 1
if (ratio < 1.618 * (1 + p) and ratio > 1.618 * (1 - p)):
count5 = count5 + 1
if (ratio < 1.618 * (1 + p2) and ratio > 1.618 * (1 - p2)):
count6 = count6 + 1

if (ratio < 1.618 * (1 + p) and ratio > 1.618 * (1 - p)):
count2=count2 + 1
if (ratio < 1.618 * (1 + p2) and ratio > 1.618 * (1 - p2)):
count3=count3 + 1

if (floor(ratio*1000)/1000==1.618):
count4=count4+1
if (s_odd == 6555 and s_even==6236):
count7 = count7 + 1

print "The number of random combinations considered: ", numTrial

print "\nNumber of combinations satisfying ONLY even-odd criteria:  ", count
print "Number of combinations within ", p*100, "% of golden ratio: ", count2
print "Number of combinations within ", p2*100, "% of golden ratio: ", count3
print "Number of combinations satisfying golden ratio to 3 d.p.:  ", count4
print "Number of combinations satisfying even-odd AND within", p*100, "% of golden ratio: ", count5
print "Number of combinations satisfying even-odd AND within", p2*100, "% of golden ratio: ", count6
print "Number of combinations satisfying even-odd AND golden ratio to 3 d.p.:", count7


If one wants to experiment with this code, and one does not have Python 2.7 installed on his/her machine then check out the online Python interpreter at the following link: https://www.tutorialspoint.com/execute_ ... online.php

Just copy and paste my above codes to the code window of the online interpreter (the black screen) and click 'Execute' at the top left corner of the coding window. The results will appear on the right half of the screen.

To copy from here, just click on the ‘SELECT ALL’ text of the CODE window and then right click and then select ‘copy’. After clearing the black screen code editor of the online interpreter, paste the code in the cleared online interpreter code editor, and click Execute. Please, do not mess up with the indentation of the program because Python is sensitive to indentation and will not execute if there is such an error. If, however, you do mess up and do not know how to repair then repeat the whole process of copying and pasting anew! Note that I have set the number of trials/combinations for the program to test at 10 000 so that you do not have to wait too long to get the results. On my computer, it took about 30 seconds to get the results for testing 100 000 combinations. So it should take less than 5 seconds to get the results with 10, 000 combinations. With this online Python interpreter you will not be able to test for 100, 000 combinations or more, and hence you will not be able to verify the results that I have outlined in the post. For that, you will need to execute the program on your computer with the Python program installed. I used Pycharm to execute my code to obtain these results.

If anyone has ANY question about the mathematics, statistics and codings of the subject of the mathematical pattern in the Holy Quran described here, then feel free to ask. I completely understand that it would be very difficult for laypersons to grasp something from this mathematical refutation. There was no other way to decisively refute the so-called debunking than by going into such an in-depth analysis. So this post is essentially aimed at philosophy and maths lovers on Philosophy Now and elsewhere.