You learn early that an ordered pair (a, b) is not the same as (b, a) — order matters for the two slots. Fair enough. But then you meet the Cartesian product A \times B, and a reasonable next thought is: if every individual ordered pair cares about order, maybe the set of all ordered pairs doesn't. After all, the set A \times B contains the same information as B \times A — same two underlying sets, same total count of pairs. Could they be the same set?

Almost never. A \times B and B \times A are two different sets in general, and the difference is genuine — not a notational quirk. Here is why, with the one exception that is worth knowing.

The definitions, side by side

Recall that the Cartesian product is

A \times B = \{(a, b) \mid a \in A,\ b \in B\}.

The first coordinate comes from A, the second from B. Now

B \times A = \{(b, a) \mid b \in B,\ a \in A\}.

The first coordinate comes from B, the second from A. The two sets differ in which set contributes the first coordinate, and ordered pairs are picky about that.

A tiny example makes it obvious

Let A = \{1, 2\} and B = \{x, y\}. Then

A \times B = \{(1, x), (1, y), (2, x), (2, y)\}
B \times A = \{(x, 1), (x, 2), (y, 1), (y, 2)\}.

Look at the pair (1, x). It is in A \times B but not in B \times A — because B \times A only contains pairs with first coordinate from B, and 1 \notin B. Every pair in A \times B has its entries swapped in B \times A, and since (1, x) \neq (x, 1), the two sets share no elements at all (in this case). They are even disjoint here.

Why: two ordered pairs are equal only when their first coordinates are equal and their second coordinates are equal. So (1, x) = (x, 1) would force 1 = x, which is false. The pairs are genuinely different objects, even though they reuse the same symbols.

Grid picture: rows vs columns swap

Two 2 by 2 grids comparing A times B and B times ALeft grid labelled A times B has rows for 1 and 2 and columns for x and y with ordered pairs in each cell. Right grid labelled B times A has rows for x and y and columns for 1 and 2 with ordered pairs in each cell. Arrows between the two grids show that the row and column roles are swapped. A × B (1,x) (1,y) (2,x) (2,y) row: 1 row: 2 B × A (x,1) (x,2) (y,1) (y,2) row: x row: y
Same four ordered pairs? No — every pair has had its two entries swapped. The row-labels and column-labels have also swapped. No cell of the left grid appears in the right grid.

But the sizes are equal

One thing is the same: the count of elements.

|A \times B| = |A| \cdot |B| = |B| \cdot |A| = |B \times A|.

Multiplication of cardinalities is commutative. So if you are just counting ordered pairs, the two sets are interchangeable. But when you are listing them, or using them as relations, or comparing to a specific target set, the difference matters.

The one case when they are equal

A \times B = B \times A holds in exactly one non-trivial case: when A = B.

If A = B, then every pair (a, b) in A \times B has both coordinates from the same set, and the swapped pair (b, a) also has both coordinates from the same set. Both sets are the self-product A \times A.

There is also the trivial case: if either A or B is empty, then both products are empty, and empty equals empty. That's not especially interesting, but it does count.

In summary: A \times B = B \times A if and only if A = B or at least one of them is empty.

Why the "only if" direction: suppose A \neq B and both are nonempty. Pick an element a_0 \in A that is not in B (such an element exists because A is not a subset of B — you can always find one set that has an element the other lacks, unless they are equal). Pick any b_0 \in B. Then (a_0, b_0) \in A \times B. For this pair to also be in B \times A, you would need a_0 \in B — contradiction. So (a_0, b_0) witnesses the inequality. A symmetric argument handles A \subset B.

Why does this matter for JEE?

Three places where the distinction becomes important.

1. Relations. A relation from A to B is a subset of A \times B. A relation from B to A is a subset of B \times A. If you swap the source and target, you get the inverse relation, and it lives in a different ambient product. Confusing the two sends you down the wrong track in relation/function questions.

2. Coordinate geometry translations. A point in the xy-plane is an ordered pair (x, y) \in \mathbb{R} \times \mathbb{R}. The pair (1, 2) and the pair (2, 1) are different points, and "swap the axes" is a genuine transformation. Problems that ask for reflections across the line y = x are secretly asking you to swap from A \times B to B \times A structure.

3. Domain/range in functions. f: A \to B has graph \{(a, f(a)) : a \in A\} \subseteq A \times B. The inverse function f^{-1}, when it exists, has graph \{(f(a), a)\} \subseteq B \times A. Getting the direction right is not optional.

What about the "contents" argument?

The intuition that A \times B and B \times A have "the same information" is correct in a weak sense. You can translate between them perfectly — just swap each pair's entries. So the sets are in one-to-one correspondence. But being in bijection is not the same as being equal as sets. Two sets are equal when they have exactly the same elements. The pair (1, x) is an element of A \times B and not an element of B \times A, and that settles it.

Equality of sets and sameness of information are different claims. Sets are equal element-by-element; sameness of information is a much softer notion captured by bijections.

One-sentence answer for revision

A \times B and B \times A have the same cardinality and the same underlying information, but they are different sets whenever A \neq B and both are nonempty — because ordered pairs are sensitive to which slot holds which coordinate.

Related: Set Operations · Cartesian Product Grid · Cardinality of A × B · Sets — Introduction