计算机代考程序代写 Platypus calculations – cscodehelp代写

Platypus calculations
September 9, 2020
1 3 Player tournament
As we have seen, a tournament of n machines playing two players at a time means there are a total of n(n + 1)/2 matches. When n = 268, that means 36, 046 matches.
What happens when there are three players in each match? The number matches required to play a full tournament is a lot higher in this case. To see why consider the following.
Let’s consider a tournament of 4 players, numbered 1 to 4. That means the matches can be organised like this, with each row representing a match.
111 112 113 114 122 123 124 133 134 144 222 223 224 233 234 244 333 334 344 444
Note that no combination of 3 of the 4 players is repeated this way. There are 20 overall. For 5 players it is as below. There are 35 overall.
1

111 112 113 114 115 122 123 124 125 133 134 135 144 145 155 222 223 224 225 233 234 235 244 245 255 333 334 335 344 345 355 444 445 455 555
How do we work out a general formula for this? The trick is to note that when i = 1, the there are n(n + 1)/2 matches (when n = 4, this means 10 matches). When i = 2, there are (n − 1)n/2 matches. When i = 3, there are (n−2)(n−1)/2 matches, and so on. In general, there are (n+1−i)(n+2−i)/2 matches involving player i. So the general formula for n matches (let’s call this S(n)) will satisfy
n
S(n) = 􏰅(n + 1 − i)(n + 2 − i)/2 i=1
Now if we let j = n + 1 − i, this is the same as
n
S(n) = 􏰅 j(j + 1)/2 j=1
2

and so
and so
n
S(n) = 􏰅 i(i + 1)(i + 2)/6 i=1
nnnnn
nnn
2 × S(n) = 􏰅 j(j + 1) = 􏰅 j2 + 􏰅 j = n(n + 1)(2n + 1)/6 + n(n + 1)/2 j=1 j=1 j=1
and so
S(n) = n(n+1)(2n+1)/12 + n(n+1)/4 = [n(n + 1)(2n + 1) + 3n(n + 1)] /12 = n(n+1)(2n+4)/12
S(n) = n(n + 1)(n + 2)/6
So when n = 268, there will be 3, 244, 140 matches, or (n + 2)/3 = 90 times more than in the two-player case …
A similar analysis for the 4 player tournament gives
6×S(n)=􏰅i(i+1)(i+2)=􏰅i3 +3i2 +2i=􏰅i3 +3􏰅i2 +2􏰅i i=1 i=1 i=1 i=1 i=1
6×S(n) = n2(n+1)2/4 + n(n+1)(2n+1)/2 + n(n+1) = n(n+1) [n(n + 1)/4 + (2n + 1)/2 + 1] and so
S(n) = n(n+1) [n(n + 1) + 4n + 2 + 4] /24 = n(n+1)(n2+5n+6)/24 = n(n + 1)(n + 2)(n + 3)/24
When n = 268 this is 219, 790, 485. Somehow I think you will struggle to play that many matches …
I think you should limit the number of machines in a 4-player tournament to about 90, as that will play about the same number of matches as a complete 3-player tournament for 268 machines. Use the above to check this!
3

Leave a Reply

Your email address will not be published. Required fields are marked *