Looking for a formula to calculate maximun number of combination with restrictions

18 Views Asked by At

I have this problem.

I want to select 40 numbers out of 120 and create all possible subsets, however there is a restriction that each subset is at least 50% different than the all other ones (or if it makes it simpler it is exactly 50% different than all other subsets). Numbers can not reappear/repeat in the same subset, the order of appearance in a subset is not important.

Is there a math or stats formula or programming code that can calculate this?