A peculiar (and mathematical) argument for Lucan priority and Matthean posteriority.

Discussion about the New Testament, apocrypha, gnostics, church fathers, Christian origins, historical Jesus or otherwise, etc.
User avatar
Ben C. Smith
Posts: 8994
Joined: Wed Apr 08, 2015 2:18 pm
Location: USA
Contact:

A peculiar (and mathematical) argument for Lucan priority and Matthean posteriority.

Post by Ben C. Smith »

I want to float this idea on the forum for honest feedback. It originates from John Kloppenborg, Excavating Q, pages 88-89. Kloppenborg is arguing at this point for the originality of the Lucan order of Q over the Matthean order of Q, but any argument for the originality of the Lucan order vis-à-vis the Matthean order can serve either as an argument for the existence of Q (if other arguments point to the originality of the Matthean order vis-à-vis the Lucan order) or as an argument for Lucan priority and Matthean posteriority (if no other such arguments are forthcoming).

The argument is based upon part of the Matthean mission discourse. The following table shows the relevant sayings in Matthew and then also the position of those same sayings in Luke:

Block
Saying
Matthew
Luke
Other Parallels
ADisciple and master.10.24-256.40
B1Fear not.10.26-3112.2-7Mark 4.22 = Luke 8.17
B2Before my father.10.32-3312.8-9Matthew 16.27 = Mark 8.38 = Luke 9.26
C1No peace on earth.10.3412.50
C2The divided family.10.35-3612.51-52Mark 13.12 = Luke 21.16
D1Loving family more.10.3714.26
D2Following after me.10.3814.27Matthew 16.24 = Mark 8.34 = Luke 9.23
EFinding and losing.10.3917.33Matthew 16.25 = Mark 8.35 = Luke 9.24

The five blocks (A, B, C, D, E) correspond to the Lucan grouping of these sayings, since Matthew groups them all into this single catena instead of scattering them like Luke does. What is interesting to note is that Luke, if he is copying from something like Matthew, not only scatters this catena across his gospel but also leaves the five blocks in the same relative order as in Matthew. That Luke would break this catena up into blocks and remove the blocks to different contexts is not a problem, but how likely is it that he would also make certain to keep the blocks in the same relative order? This would seem an arbitrary procedure, and I feel like Streeter would then have a point about Luke being a crank.

Kloppenborg, presuming Q (instead of dependence of Matthew upon Luke), comments on page 89, "Matthew reproduces the sayings in Lukan order, as if he had scanned Q, collecting sayings that he thought were related and might fit together well." And that is the crux of the argument. If Matthew is copying either from something like Luke or from a Q document whose sayings Luke has retained in their original order, so far as this particular set is concerned, then there is nothing to explain. Matthew's procedure is obvious: he scanned through his source (Q or Luke) from start to finish for sayings to compile into this set. If, however, we suppose that it is Luke who copied from something like Matthew 10.24-39, then we may still have some explaining to do. Why make sure that the sayings remain in their Matthean order if they are all being moved to very different contexts anyway?

One obvious answer to this question is that Luke did not actually make sure they remained so: it is just a coincidence that they happened to turn out that way. What I would like to know, then, is how much of a coincidence that is. I have broken the Matthean catena up into logical sayings, but I have assigned letters to each saying or pair of sayings based solely upon how they fall in Luke; that is, any sayings with the same letter (A, B, C, D, E) appear together in Luke as well as in Matthew. I have done this in order to minimize bias in determining the odds of a coincidence. If we were to count each saying separately (determining what constitutes a saying just by our own wits), then we have 8 separate sayings (by my reckoning, and yours may differ from mine) which Luke, if he is copying from Matthew, has managed to keep in relative order despite scattering them. If we used individual words or phrases, we would have dozens. But to divide the catena up like that involves a serious element of the arbitrary, which is why I feel we must divide it up in exactly the same way as we find it divided up in Luke.

Thus we have 5 nonarbitrary blocks of material in the same order in Luke as in Matthew, despite them being widely separated in Luke. How much of a coincidence is that? I asked this question on the old FRDB/IIDB back in the day, and S. C. Carlson responded, and we debated it for a while. Neither of us could come up with a logical equation to use to decide the matter. We both agreed that we would have to know how many blocks Matthew and Luke share overall, but beyond that, once we have a number in mind, how do we figure out the odds of any 5 contiguous blocks from the whole winding up in the same order but also separated from each other? If it were only 2 blocks, I think we could easily claim coincidence. If it were 20 blocks, I think the coincidence explanation would seem pretty strained. But what about 5?

The matter of how many overall blocks we should count is not very easy, either. Obviously we cannot just count pericopes, since what constitutes a pericope can be arbitrary at times, and many of them may comprise longer blocks which both Matthew and Luke retain in the same order (for example, both authors feature information about John the Baptist followed by a sample of his preaching; this would have to be one block, not two or more). And should we count blocks which, on our preferred solution to the synoptic problem, we feel are following the shared order of Mark (for example)?

At any rate, I hope the main issue is clear enough. If Matthew copied from something like Luke, then his procedure was clear and not at all arbitrary: he simply scrolled or paginated through his source and picked up the sayings one at a time in order. If, however, Luke copied from something like Matthew, his procedure of scattering them across his text, while not an issue in and of itself, may become an issue in conjunction with his having kept them in the same relative order. To have done such a thing deliberately would be weird, and I think that, on balance, it would then have to be considered more likely that Matthew is the one doing the copying here (that is, it is more likely that Matthew followed a perfectly cogent and simple procedure than that Luke followed a weird and arbitrary one). The most obvious way out of Lucan priority and Matthean posteriority, then, is coincidence. (If there is another, my mind is wide open.) And that is what I need feedback on. How can we determine how much of a coincidence we are dealing with?

Any takers?

Ben.

PS: It also occurs to me that, depending on how things shake out, we may not need an exact count of Matthean and Lucan blocks of shared material. It may be the case that (A) there is an equation or an algorithm which could be used which would allow us to plug in whatever number we wish to test on that account, just to see how likely or unlikely 5 blocks retained in order would be if that were the total number of blocks, and that (B) the results are telling already without knowing the true number; for example, if we needed more than 100 such blocks overall before the coincidence started to seem likely, then that would be valuable information, since there are almost certainly not 100 such blocks to be had between Matthew and Luke.
User avatar
Ken Olson
Posts: 1277
Joined: Fri May 09, 2014 9:26 am

Re: A peculiar (and mathematical) argument for Lucan priority and Matthean posteriority.

Post by Ken Olson »

Coincidentally (I think) David Inglis asked for input on his treatment of Matt 10.24-39 on his web page about four hours ago.

https://sites.google.com/site/inglisonm ... yxc69dmsZU

You two should talk.

Best,

Ken
User avatar
Ben C. Smith
Posts: 8994
Joined: Wed Apr 08, 2015 2:18 pm
Location: USA
Contact:

Re: A peculiar (and mathematical) argument for Lucan priority and Matthean posteriority.

Post by Ben C. Smith »

Ken Olson wrote: Wed Apr 14, 2021 12:47 pm Coincidentally (I think) David Inglis asked for input on his treatment of Matt 10.24-39 on his web page about four hours ago.

https://sites.google.com/site/inglisonm ... yxc69dmsZU

You two should talk.
Wow, hard to believe, but yes, this is a coincidence. Thanks for the link.
User avatar
Peter Kirby
Site Admin
Posts: 8015
Joined: Fri Oct 04, 2013 2:13 pm
Location: Santa Clara
Contact:

Re: A peculiar (and mathematical) argument for Lucan priority and Matthean posteriority.

Post by Peter Kirby »

Ben C. Smith wrote: Wed Apr 14, 2021 12:25 pm How can we determine how much of a coincidence we are dealing with?

Any takers?
Ignore the rest of the text of Matthew and Luke besides the N blocks (N = 5). Let p_i be the probability that Luke would use the same order as Matthew for an individual block i, where 0 <= i < N, assuming that Luke had followed the same order as Matthew for all previous blocks. Then the probability that Luke would follow the same order as Matthew for all blocks is the product of all p_i for i from 0 to 4.

If you assume that Luke was completely indifferent to which block he would use & also that the probabilities are unaffected by previous choices (other than eliminating used blocks), then the values of p_i are 1/5, 1/4, 1/3, 1/2, and 1. That's 0.83%. I suppose this is what you mean by "coincidence."

If you assume that Luke had a 50/50 chance of choosing the first remaining block in Matthew's narrative, with the rest of the probability of choosing any of the blocks being equal, then the values of p_i are 3/5, 5/8, 2/3, 3/4, and 1. That's 18.75%.

Besides the idea that there may be some effortless proclivity to keeping the same order, this is further complicated by the fact that Luke used Matthew on many other occasions. We would want to make sure we're not just cherry picking one case among many of Luke's use of Matthew. I think that's what you're referring to here:
PS: It also occurs to me that, depending on how things shake out, we may not need an exact count of Matthean and Lucan blocks of shared material. It may be the case that (A) there is an equation or an algorithm which could be used which would allow us to plug in whatever number we wish to test on that account, just to see how likely or unlikely 5 blocks retained in order would be if that were the total number of blocks, and that (B) the results are telling already without knowing the true number; for example, if we needed more than 100 such blocks overall before the coincidence started to seem likely, then that would be valuable information, since there are almost certainly not 100 such blocks to be had between Matthew and Luke.
I'd dig deeper into these:

"Luke, if he is copying from Matthew, has managed to keep in relative order despite scattering them"
"To have done such a thing deliberately would be weird"
"Why make sure that the sayings remain in their Matthean order if they are all being moved to very different contexts anyway?"

I suspect that there may be more nuanced answers to these questions than just "coincidence" or "weird"-ness.
Paul the Uncertain
Posts: 994
Joined: Fri Apr 21, 2017 6:25 am
Contact:

Re: A peculiar (and mathematical) argument for Lucan priority and Matthean posteriority.

Post by Paul the Uncertain »

If it isn't weird for Matthew to compile an ordered list of sayings from Luke, then why is it weird that Luke might compile an ordered list of sayings from Matthew? Isn't a "Do it yourself" (DIY) Q either way?

If there was a third-party Q, then the two authors used it differently. That's the upper bound on the weirdness that Luke would have used a DIY Q the same as he would have used a third-party Q.

If I've missed something in the problem statement, then maybe I'm not the only one.
User avatar
Ben C. Smith
Posts: 8994
Joined: Wed Apr 08, 2015 2:18 pm
Location: USA
Contact:

Re: A peculiar (and mathematical) argument for Lucan priority and Matthean posteriority.

Post by Ben C. Smith »

Paul the Uncertain wrote: Wed Apr 14, 2021 3:25 pm If it isn't weird for Matthew to compile an ordered list of sayings from Luke, then why is it weird that Luke might compile an ordered list of sayings from Matthew? Isn't a "Do it yourself" (DIY) Q either way?
Because in Matthew the sayings are all contiguous, all in chapter 10. In Luke they are spread out across most of the gospel. There is no reason why Luke should have kept them in the Matthean order, since they all wind up in completely different contexts, but Matthew could have easily found them in the Lucan order by thumbing through Luke from start to finish. Consult the table for more clarity on that point.
If I've missed something in the problem statement, then maybe I'm not the only one.
You are not alone by any means in having missed it. Heck, IIRC, it took S. C. Carlson a couple of posts to understand what I was arguing back on the old FRDB/IIDB, as well; once he got it, it was a fruitful exchange, but I am wanting more clarity on the point.

Honestly, I am half hoping that someone will let me know, from a mathematical point of view, that the coincidence is not really all that great so that I can cross this argument off my list and not have to deal with it anymore, LOL. Carlson ran some simulations back when we were discussing this, using a simple computer program of some kind, but I forget both the number of pericopes we put in as a total and the final percentage result, and I do not remember enough of what he said about the simulation itself for me to be able to rely on half remembered results.
User avatar
Ken Olson
Posts: 1277
Joined: Fri May 09, 2014 9:26 am

Re: A peculiar (and mathematical) argument for Lucan priority and Matthean posteriority.

Post by Ken Olson »

Sometimes John Kloppenborg says things that baffle me (other examples available upon request).
Luke 6:39: He also told them a parable: “Can a blind person guide a blind person? Will not both fall into a pit? 40 A disciple is not above the teacher, but everyone who is fully qualified will be like the teacher. 41 Why do you see the speck in your neighbor’s eye, but do not notice the log in your own eye? 42 Or how can you say to your neighbor, ‘Friend, let me take out the speck in your eye,’ when you yourself do not see the log in your own eye? You hypocrite, first take the log out of your own eye, and then you will see clearly to take the speck out of your neighbor’s eye.
Kloppenborg comments:
Although Luke may have moved 17:33 to follow his illustration of the fate of Sodom (17:31 [from Mark] 32), it would exceedingly difficult in the other instances to imagine that Luke saw in Q a topically ordered set of sayings and scattered them throughout Q [I think JSKV means 'his gospel' here]. The problem is particularly acute in the case of Luke 6:40, which, as many critics have observed, seems to interrupt the connection between 6:39 and 6:41-42. (JSKV, Excavating Q, 89).
What is the logic here? I understand the claim that there's a thematic connection (vision, or lack thereof) between 6:39 and 6:41, and that 6:40 interrupts this. But what's the argument for Luke not being responsible for the interruption? The Matthean parallels to 6.39 and 6.41 are Matt 15.14 and Matt 7.3, so it's not Matthew who is responsible for the interruption. Who is? It must have happened at the pre-Lukan level. Either the compiler of Q originally composed 6;39, 6:40, and 6:41 in that order or he composed 6:39 and 6:41 in that order and a pre-Lukan redactor inserted 6:40 between them. How do we know Luke did not compose 6:39, 6:40, and 6:41 in that order or insert 6:40 between 6:39 and 6:41? Because it wouldn't make sense for Luke to have done that, so it must have been someone else who, apparently, does things that don't make sense.

Best,

Ken
User avatar
Ben C. Smith
Posts: 8994
Joined: Wed Apr 08, 2015 2:18 pm
Location: USA
Contact:

Re: A peculiar (and mathematical) argument for Lucan priority and Matthean posteriority.

Post by Ben C. Smith »

Ken Olson wrote: Wed Apr 14, 2021 3:58 pm Sometimes John Kloppenborg says things that baffle me (other examples available upon request).
I would be interested in such examples.
Luke 6:39: He also told them a parable: “Can a blind person guide a blind person? Will not both fall into a pit? 40 A disciple is not above the teacher, but everyone who is fully qualified will be like the teacher. 41 Why do you see the speck in your neighbor’s eye, but do not notice the log in your own eye? 42 Or how can you say to your neighbor, ‘Friend, let me take out the speck in your eye,’ when you yourself do not see the log in your own eye? You hypocrite, first take the log out of your own eye, and then you will see clearly to take the speck out of your neighbor’s eye.
Kloppenborg comments:
Although Luke may have moved 17:33 to follow his illustration of the fate of Sodom (17:31 [from Mark] 32), it would exceedingly difficult in the other instances to imagine that Luke saw in Q a topically ordered set of sayings and scattered them throughout Q [I think JSKV means 'his gospel' here]. The problem is particularly acute in the case of Luke 6:40, which, as many critics have observed, seems to interrupt the connection between 6:39 and 6:41-42. (JSKV, Excavating Q, 89).
What is the logic here? I understand the claim that there's a thematic connection (vision, or lack thereof) between 6:39 and 6:41, and that 6:40 interrupts this. But what's the argument for Luke not being responsible for the interruption? The Matthean parallels to 6.39 and 6.41 are Matt 15.14 and Matt 7.3, so it's not Matthew who is responsible for the interruption. Who is? It must have happened at the pre-Lukan level. Either the compiler of Q originally composed 6;39, 6:40, and 6:41 in that order or he composed 6:39 and 6:41 in that order and a pre-Lukan redactor inserted 6:40 between them. How do we know Luke did not compose 6:39, 6:40, and 6:41 in that order or insert 6:40 between 6:39 and 6:41? Because it wouldn't make sense for Luke to have done that, so it must have been someone else who, apparently, does things that don't make sense.
I think I agree with this assessment, and I have noticed comments regarding the synoptic problem before which seem only to push the problem back one step rather than to actually solve it.
User avatar
Peter Kirby
Site Admin
Posts: 8015
Joined: Fri Oct 04, 2013 2:13 pm
Location: Santa Clara
Contact:

Re: A peculiar (and mathematical) argument for Lucan priority and Matthean posteriority.

Post by Peter Kirby »

Ben C. Smith wrote: Wed Apr 14, 2021 3:43 pm Honestly, I am half hoping that someone will let me know, from a mathematical point of view, that the coincidence is not really all that great so that I can cross this argument off my list and not have to deal with it anymore, LOL. Carlson ran some simulations back when we were discussing this, using a simple computer program of some kind, but I forget both the number of pericopes we put in as a total and the final percentage result, and I do not remember enough of what he said about the simulation itself for me to be able to rely on half remembered results.
I was looking for a kind of formula, because exhaustively going through all the permutations is far too computationally expensive.

For the purpose of finding the odds, it is simpler for the program to imagine Luke's procedure in reverse: instead of taking all the Matthean blocks, scattering them, and finding a sequence of 5 disconnected blocks in order that correspond to a contiguous series in Matthew... we can rely on the symmetry of the problem, start with the Lukan order of blocks, scatter his sources as representing where they were found in Matthew, and look for a sequence of five contiguous blocks in the Matthean block sources.

Alternatively and, also, equivalently:

If you imagine that you have the original Matthean sources numbered correctly:
0, 1, 2, 3, 4, 5, 6

Then you shuffle them to get where Luke put these sources:
4, 0, 2, 5, 6, 1, 3

You can go through these Lucan positions of the Matthean blocks and look for a contiguous sequence of increasing positions (here 0, 2, 5, 6 is the longest).

I think a simulation based on random sampling is probably the way to go (for M > 10).
User avatar
Peter Kirby
Site Admin
Posts: 8015
Joined: Fri Oct 04, 2013 2:13 pm
Location: Santa Clara
Contact:

Re: A peculiar (and mathematical) argument for Lucan priority and Matthean posteriority.

Post by Peter Kirby »

Ben C. Smith wrote: Wed Apr 14, 2021 3:43 pm Honestly, I am half hoping that someone will let me know, from a mathematical point of view, that the coincidence is not really all that great so that I can cross this argument off my list and not have to deal with it anymore, LOL. Carlson ran some simulations back when we were discussing this, using a simple computer program of some kind, but I forget both the number of pericopes we put in as a total and the final percentage result, and I do not remember enough of what he said about the simulation itself for me to be able to rely on half remembered results.
By exact methods, looking at every permutation, I get these results (here "N" is the number of blocks, the sequence length is 5):

('N: ', 5, ', coincidence: ', 0.008333333333333333)
('N: ', 6, ', coincidence: ', 0.015277777777777777)
('N: ', 7, ', coincidence: ', 0.022222222222222223)
('N: ', 8, ', coincidence: ', 0.029166666666666667)
('N: ', 9, ', coincidence: ', 0.03611111111111111)
('N: ', 10, ', coincidence: ', 0.04298638668430335)
('N: ', 11, ', coincidence: ', 0.049815340909090906)
('N: ', 12, ', coincidence: ', 0.05659606982523649)

By approximate methods, using 1,000,000 randomly selected shuffles for each number of blocks, I get these results:

('N: ', 5, ', coincidence: ', 0.008192)
('N: ', 6, ', coincidence: ', 0.015057)
('N: ', 7, ', coincidence: ', 0.022339)
('N: ', 8, ', coincidence: ', 0.028931)
('N: ', 9, ', coincidence: ', 0.035824)
('N: ', 10, ', coincidence: ', 0.043135)
('N: ', 11, ', coincidence: ', 0.049946)
('N: ', 12, ', coincidence: ', 0.056552)
('N: ', 13, ', coincidence: ', 0.063104)
('N: ', 14, ', coincidence: ', 0.069405)
('N: ', 15, ', coincidence: ', 0.076599)
('N: ', 16, ', coincidence: ', 0.08314)
('N: ', 17, ', coincidence: ', 0.089871)
('N: ', 18, ', coincidence: ', 0.096322)
('N: ', 19, ', coincidence: ', 0.102748)
('N: ', 20, ', coincidence: ', 0.109337)
('N: ', 21, ', coincidence: ', 0.115838)
('N: ', 22, ', coincidence: ', 0.122207)
('N: ', 23, ', coincidence: ', 0.127997)
('N: ', 24, ', coincidence: ', 0.134483)
('N: ', 25, ', coincidence: ', 0.140572)
('N: ', 26, ', coincidence: ', 0.146474)
('N: ', 27, ', coincidence: ', 0.152273)
('N: ', 28, ', coincidence: ', 0.15881)
('N: ', 29, ', coincidence: ', 0.165295)
('N: ', 30, ', coincidence: ', 0.170844)
('N: ', 31, ', coincidence: ', 0.176727)
('N: ', 32, ', coincidence: ', 0.182329)
('N: ', 33, ', coincidence: ', 0.188466)
('N: ', 34, ', coincidence: ', 0.193409)
('N: ', 35, ', coincidence: ', 0.20004)
('N: ', 36, ', coincidence: ', 0.205379)
('N: ', 37, ', coincidence: ', 0.21106)
('N: ', 38, ', coincidence: ', 0.216706)
('N: ', 39, ', coincidence: ', 0.222379)
('N: ', 40, ', coincidence: ', 0.228052)
('N: ', 41, ', coincidence: ', 0.233656)
('N: ', 42, ', coincidence: ', 0.238889)
('N: ', 43, ', coincidence: ', 0.244517)
('N: ', 44, ', coincidence: ', 0.249364)
('N: ', 45, ', coincidence: ', 0.255453)
('N: ', 46, ', coincidence: ', 0.261086)
('N: ', 47, ', coincidence: ', 0.26486)
('N: ', 48, ', coincidence: ', 0.270944)
('N: ', 49, ', coincidence: ', 0.275926)
('N: ', 50, ', coincidence: ', 0.281696)
('N: ', 51, ', coincidence: ', 0.286477)
('N: ', 52, ', coincidence: ', 0.291647)
('N: ', 53, ', coincidence: ', 0.296987)
('N: ', 54, ', coincidence: ', 0.30152)
('N: ', 55, ', coincidence: ', 0.306761)
('N: ', 56, ', coincidence: ', 0.311633)
('N: ', 57, ', coincidence: ', 0.316269)
('N: ', 58, ', coincidence: ', 0.321666)
('N: ', 59, ', coincidence: ', 0.326485)
('N: ', 60, ', coincidence: ', 0.33111)
('N: ', 61, ', coincidence: ', 0.335791)
('N: ', 62, ', coincidence: ', 0.340988)
('N: ', 63, ', coincidence: ', 0.344909)
('N: ', 64, ', coincidence: ', 0.349095)
('N: ', 65, ', coincidence: ', 0.354336)
('N: ', 66, ', coincidence: ', 0.359218)
('N: ', 67, ', coincidence: ', 0.364389)
('N: ', 68, ', coincidence: ', 0.368366)
('N: ', 69, ', coincidence: ', 0.372524)
('N: ', 70, ', coincidence: ', 0.376792)
('N: ', 71, ', coincidence: ', 0.381642)
('N: ', 72, ', coincidence: ', 0.386288)
('N: ', 73, ', coincidence: ', 0.39061)
('N: ', 74, ', coincidence: ', 0.395538)
('N: ', 75, ', coincidence: ', 0.39898)
('N: ', 76, ', coincidence: ', 0.403754)
('N: ', 77, ', coincidence: ', 0.408408)
('N: ', 78, ', coincidence: ', 0.411903)
('N: ', 79, ', coincidence: ', 0.415696)
('N: ', 80, ', coincidence: ', 0.420394)
('N: ', 81, ', coincidence: ', 0.424102)
('N: ', 82, ', coincidence: ', 0.428716)
('N: ', 83, ', coincidence: ', 0.432727)
('N: ', 84, ', coincidence: ', 0.436382)
('N: ', 85, ', coincidence: ', 0.441332)
('N: ', 86, ', coincidence: ', 0.444589)
('N: ', 87, ', coincidence: ', 0.447247)
('N: ', 88, ', coincidence: ', 0.452707)
('N: ', 89, ', coincidence: ', 0.456243)
('N: ', 90, ', coincidence: ', 0.459967)
('N: ', 91, ', coincidence: ', 0.464455)
('N: ', 92, ', coincidence: ', 0.468792)
('N: ', 93, ', coincidence: ', 0.471494)
('N: ', 94, ', coincidence: ', 0.475269)
('N: ', 95, ', coincidence: ', 0.478877)
('N: ', 96, ', coincidence: ', 0.482135)
('N: ', 97, ', coincidence: ', 0.487425)
('N: ', 98, ', coincidence: ', 0.490973)
('N: ', 99, ', coincidence: ', 0.493094)
('N: ', 100, ', coincidence: ', 0.497745)

Does this answer the question?

Here's the code in Python:

Code: Select all

import random

permutations = 1000000
for N in range(5, 101):
    success = 0
    permutation = range(N)
    for _ in range(permutations):
        random.shuffle(permutation)
        chain_length = [1] * N
        for i in range(1, N):
            if permutation[i] > permutation[i - 1]:
                chain_length[i] = chain_length[i - 1] + 1
        if max(chain_length) >= 5:
            success += 1
    proportion_success = float(success) / permutations
    print('N: ', N, ', coincidence: ', proportion_success)
Post Reply