For example,

(1a) "The number of A and B in the set X exactly matches the number of A and B in the set Y, respectively."

(1b) "The numbers of A and B in the set X exactly matches the numbers of A and B in the set Y, respectively."

(2a) The set X contains different number of A and B from the set Y.

(2b) The set X contains different numbers of A and B from the set Y.

What I want to compare is that the number of A in the set X and Y, and the number of B in the set X and Y. Should I use "number" or "numbers"?

I hope my description is clear, and any suggestions are welcome.

Thanks in advance.

Lin