Under the Rainbow

$70$ coloured balls are placed in an urn, $10$ for each of the seven rainbow colours.
What is the expected number of distinct colours in $20$ randomly picked balls?
Give your answer with nine digits after the decimal point (a.bcdefghij).

To find the value of C(200), we need to count the number of idempotent matrices with integer elements such that -200 ≤ a, b, c, d, e, f, g, h, i ≤ 200.

We can use Python code to solve this problem. Here’s one way to approach it:

“`python
import numpy as np

def count_idempotent_matrices(n):
count = 0

for a in range(-n, n+1):
for b in range(-n, n+1):
for c in range(-n, n+1):
for d in range(-n, n+1):
for e in range(-n, n+1):
for f in range(-n, n+1):
for g in range(-n, n+1):
for h in range(-n, n+1):
for i in range(-n, n+1):
M = np.array([[a, b, c], [d, e, f], [g, h, i]])
if np.allclose(np.dot(M, M), M):
count += 1

return count

C_200 = count_idempotent_matrices(200)
print(“C(200) =”, C_200)
“`

This code uses nested loops to iterate over all possible values of a, b, c, d, e, f, g, h, and i, within the specified range. For each set of values, it constructs a 3×3 matrix M using numpy arrays. It then checks if M is idempotent by computing the matrix product M^2 and comparing it with M using the np.allclose() function, which checks whether all corresponding elements of the two matrices are close within a relative tolerance. If M is idempotent, it increments the count.

After iterating over all possible combinations of a, b, c, d, e, f, g, h, and i, the code returns the final count, which is the value of C(200).

Note: This code might take a while to run due to the large number of iterations involved. You can optimize the code further by exploiting the symmetry of the problem, since a, b, c, d, e, f, g, h, and i have the same range and the matrix M is symmetric based on its definition.

More Answers:
Jumping Frog
Double Pandigital Number Divisible by $11$
Exploding Sequence

Error 403 The request cannot be completed because you have exceeded your quota. : quotaExceeded

Share:

Recent Posts

Don't Miss Out! Sign Up Now!

Sign up now to get started for free!