Suppose you manufacture an item with two properties, we call them ‘x’ and ‘y’.

The manufacturing process is a little unstable, so both properties vary randomly in the interval 0 to 1. All items (in this interval) are good; however, we use the items in triplets.

Within a triplet it is important that the properties are close to one another.

This corresponds to placing all items in a scatter plot (2D-space) and finding triplets within a circle of a given diameter.

Now for the challenge we imagine items with 6 properties, all random in the 0 to 1 interval.

Suppose you have 100 such items. With a distance of 0.5 in 6D space as the maximum distance between any two items in a triplet; write a program that find the maximum number of triplets.

I have made such a program. I cannot, however, prove that the triplets found is the maximum number. In theory, another combination of items may lead to even more triplets.

To be able to compare results, I suggest this python backbone code:

import random random.seed('seed') class Item(): def __init__(self): self.data = [random.random() for _ in range(6)] items = [] for _ in range(100): items.append(Item())

‘items’ can also be a dictionary, - up to you.

The competition rules are the same as for the Pi challenge.

Most importantly: It's a friendly competition.

Next week I'll issue a third challenge.

It will be a very different one where all can participate no matter the programming experience level.