- #1
bernd
- 16
- 0
- TL;DR Summary
- How to put given set of triples (natural numbers) into as few sixtuple as possible?
Hi, I am not sure if this can be called directly a mathematical problem but it kind of is:
Say we have the list of all (ascendingly ordered) triple with natural numbers from 1-49 (is about lotto 6 out of 49):
T={(a,b,c) | a,b,c natural numbers, 1<=a,b,c<=49, a<b<c}
Now we are given a subset of this, lets call it M.
M is basically a rather long list of triples with thos specific properties.
Now I wonder how one can put those triples together neatly in as few sixtuples as possible?
Like for example (1,2,4) and (1,4,6) can be put together into a common tuple (1,2,4,6) of length 4.
speaking the other directly any sixtuple can contain up to 20(=6 over 3) triples.
so, yeah, I was wondering if there is some smart systematic way to "merge" triples from a given list so that the total amount of needed sixtuples is as little as possible?
(I know that you cant perfectly fill all sixtuples. once all triples are used up. jsut fill the non-full sixtuples with filler numbers)
doesnt matter if mathematical method or some smart programming way (java if possible) but could use any hint on how to do this smartly.
Say we have the list of all (ascendingly ordered) triple with natural numbers from 1-49 (is about lotto 6 out of 49):
T={(a,b,c) | a,b,c natural numbers, 1<=a,b,c<=49, a<b<c}
Now we are given a subset of this, lets call it M.
M is basically a rather long list of triples with thos specific properties.
Now I wonder how one can put those triples together neatly in as few sixtuples as possible?
Like for example (1,2,4) and (1,4,6) can be put together into a common tuple (1,2,4,6) of length 4.
speaking the other directly any sixtuple can contain up to 20(=6 over 3) triples.
so, yeah, I was wondering if there is some smart systematic way to "merge" triples from a given list so that the total amount of needed sixtuples is as little as possible?
(I know that you cant perfectly fill all sixtuples. once all triples are used up. jsut fill the non-full sixtuples with filler numbers)
doesnt matter if mathematical method or some smart programming way (java if possible) but could use any hint on how to do this smartly.