It is given that A × B = {(a, x), (a, y), (b, x), (b, y)}

We know that the Cartesian product of two non-empty sets P and Q is defined as P × Q = {(p, q): p ∈ P, q ∈ Q}

∴ A is the set of all first elements and B is the set of all second elements.

Thus, A = {a, b} and B = {x, y}