I'm trying to write a formula to count groups of $n$ elements taken from a set $Q$ containing $q$ elements with no repetition, so that each subset doesn't contain more than $d$ elements in common with any other subset (e.g. the cardinality of intersection of any two groups is $\leq d$), assuming that all elements in set $Q$ are different.
For example, I wish to count how many subsets of 5 different elements can be formed by a set of 20 elements so that maximum 3 elements are in common in any two subsets.
There is some similiarity with Hamming bound, but in my case repetitions are not allowed (each element can't be assigned more than once to the same subset).
Do you have any suggestion?
Thanks