I apologize if this has been answered before.

I would like to know how many ways there are to choose $M'$ elements from a set of $M$ elements such that any two sets selected are not similar at more than $m$ elements (for $M \geq M' \geq m$)?

For example, let's say $M=12$, $M'=4$ and $m = 3$. We take example elements: {A B C D E F G H I J K L}. Then {A B C D}, {A B E F}, {A C F G} are valid selections together, but we could not add {A B E G} as this would overlap with the second set on A, B, and E.

This may be related to coding theory. If I remember my coding theory correctly, I believe this question would be stated as how many block codes exist of length $M$ with weight $M'$ such that the minimum distance is $m$?

Thanks.