It is given that

n(A) =3 and n(B) =2; and (x, 1), (y, 2), (z, 1) are in A×B.

We know that

A = Set of first elements of the ordered pair elements of A × B

B = Set of second elements of the ordered pair elements of A × B.

∴ x, y, and z are the elements of A; and 1 and 2 are the elements of B.

Since n(A) = 3 and n(B) = 2, it is clear that A = {x, y, z} and B = {1, 2}.