All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
99 numbers in three lists (Posted on 2024-09-27) Difficulty: 3 of 5
List 1: Write down the numbers 1 to 99

1, 2, 3, 4, 5, 6, 7, 8, 9, ..., 99

List 2: Take every successive set of three numbers (3k-2, 3k-1, 3k) for k=(1...33) and randomly apply a permutation to the trio. Example:

3, 1, 2, 4, 5, 6, 7, 9, 8, ..., 98

List 3: Multiply the first numbers, second numbers, etc of lists 1 and 2. Example:

3, 2, 6, 16, 25, 36, 49, 72, 72, ..., 9702

What is the expected sum of the values in list 3?

No Solution Yet Submitted by Jer    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Computer solution | Comment 2 of 5 |
328284

Method, define a function of n that computes the expected value for the appropriate trio.
It turns out, this is equivalent to 27n^2 - 18n + 3

The sum of this formula applied to all integers from 1 to n:
27n(n+1)(2n+1)/6 - 18n(n+1)/2 + 3n, which simplifies to
(18n^3 + 9n^2 - 3n)/2
which also is 328284 when n=33

[12, 75, 192, 363, 588, 867, 1200, 1587, 2028, 2523, 3072, 3675, 4332, 5043, 5808, 6627, 7500, 8427, 9408, 10443, 11532, 12675, 13872, 15123, 16428, 17787, 19200, 20667, 22188, 23763, 25392, 27075, 28812]

------
from itertools import permutations
def jumb(n):
    x = [3*n-2, 3*n-1, 3*n]
    mysum = 0
    for perm in permutations(x):
        for i,p in enumerate(perm):
            mysum += x[i] * p
    return int(mysum/6)

bigsum = 0
ans1 = []
ans2 = []
for i in range(1,34):
    ans1.append(jumb(i))
    ans2.append(27*i**2 - 18*i + 3)
    bigsum += jumb(i)
print(bigsum)
print('Does formula give the same answer?', ans1 == ans2)

  Posted by Larry on 2024-09-27 10:01:46
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (4)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information