The cartesian product of two sets : $X,Y$ is a set $Z$ defined as :
$Z = \{ (x,y) \, | \, x \in X \, \text {and} \, y \in Y \}$
where $(x,y)$ is the ordered pair having $x$ as first component and $y$ as second component.
Thus, the cartesian product $X \times Y$ is the set of all ordered pairs with first component in $X$ and second component in $Y$.
A relation $R$ with domain in $X$ and range in $Y$ is a subset of the cartesian product $X \times Y$, i.e. :
$R \subseteq X \times Y$.
Thus, a relation is a set of ordered pairs.
A function $F$ is a relation satisfying the ("functionality") condition :
if $(x_1,y_1) \in F$ and $(x_1,y_2) \in F$, then $y_1=y_2$.
A binary operation $f : Y \times Y \to Y$ is a function from the cartesian product $Y \times Y$ to the set Y, i.e. a subset of $(Y \times Y) \times Y$, because it "maps" an ordered pair $(y_1,y_2)$ into an element $y_3$, with $y_i \in Y$.
You can try to clarify the definitions with some simple examples.
Let $\mathbb N = \{ 0, 1, 2, ... \}$ the set of natural numbers.
Consider the cartesian product $\mathbb N \times \mathbb N$ and :
the relation $<$ ("Less then"), i.e. $(n,m) \in L$ iff $n < m$,
the function $s$ ("Successor"), i.e. $(n,m) \in S$ iff $m=s(n)$
the (binary) operation $+$ ("Plus"), i.e. $((x,y),z) \in P$ iff $z=x+y$.
You might consider whether the 5 of hearts is different from the heart 5 ? There is clearly a bijection between Rank x Suit and Suit x Rank. So A x B is in that sense quite similar to B x A.
What differentiates A x B from B x A is better revealed when A and B have the same elements (rather than for example suits and ranks), but meaning is attached to order of the pairing of the elements of A and B. What about $R^2 = R \times R$, identifiable with the x-y plane ? Now, we can see that $(x, y) \ne (y, x)$ unless $x = y$.
In the most common (ZF) treatment of ordered pairs, for $a \in A $ and $b \in B$ the ordered pair $(a, b) $ is defined as the set {a, {a, b}}. This distinguishes it from the set {b, {a, b}} unless a = b.
In More Detail
In the card example we create sets representing suits and ranks which are disjoint (in English), so that Suits = {C, D, H, S} and Ranks = {2, 3, 4, ,5, 6, 7, 8, 9, 10, J, Q, K, A}. There is a set representing cards, perhaps identified as Cards = {2C, 3C, ...AS} (at my bridge club they have bar codes for the dealing machine). We see there is a bijection between Suits x Ranks and Cards so that a card is identifiable by its suit and rank, and equally there is a bijection between Ranks x Suits and Cards and a card is identifiable by its rank and suit. Mathematically (in ZF set theory), the elements of the Cartesian products Suits x Ranks differ from the elements of Ranks x Suits: they both consist of elements which are sets, but the one looks like {C, {C, 2}} while the other looks like {2, {2, C}}, or in the more conventional ordered pair notation (C, 2) and (2, C). The elements which comprise the two Cartesian products are different so that in set terms, Suits x Ranks $\ne$ Ranks x Suits. They are interpreted to mean the same because:
- When we see an ordered pair the fact that Suits and Ranks are disjoint lets us recognize which element of the pair is a suit and which is a rank.
- There are bijections from both of the Cartesian products to Cards and we interpret the ordered pair as a card.
But, in maths a lot of ordered pairs we meet are numbers. In the X-Y plane X = {x|x $\in$ R} and Y = {y|y $\in$ R}, so in fact X = Y = R and it follows that X x Y = Y x X = R$^2$ (any pair of numbers e.g. (5, 3.72) exists in R$^2$, is a point in the X-Y plane and a point in the Y-X plane: the three Cartesian products contain the same elements and are therefore the same set). Now to understand the ordered pair we cannot identify which element belongs to which set by its value, we need to know what the order represents, i.e. the first element is a X-value, the second a Y-value.
This leads to a somewhat ironic conclusion that
- if A and B are different sets then A x B $\ne$ B x A (in set terms), but we can probably interpret the meaning of (a, b) and (b, a) to be the same thing
- if A and B are the same set then in fact A x B = B x A (in set terms), but (a, b) doesn't mean the same as (b, a) unless a = b.
Best Answer
You didn't give a definition for $A\times B\times C$ but it's usually defined by $$A\times B\times C=\{(a,b,c) | a\in A, b\in B, c\in C\}$$ Now $(A\times B)\times C$ is, by definition $$(A\times B)\times C = \{((a,b),c) | (a,b)\in A\times B, c\in C\} = \{((a,b),c) | a\in A,b\in B, c\in C\}$$ This shows you the difference: The elements are of the form $((a,b),c) \ne (a,b,c)$, but they are, in fact, in a 1-1 correspondence, wich may be the point of confusion.
Addendum due to comment of Asaf: An ordered pair can be written as a set: $$(a,b) = \{a,\{a,b\}\}\\ (a,b,c) = \{a,\{a,b\},\{a,b,c\}\}\\ ((a,b),c) = \{(a,b),\{(a,b),c\}\} = \Big\{\{a,\{a,b\}\},\{\{a,\{a,b\}\},c\}\Big\}$$ Wich clearly shows why $((a,b),c) \ne (a,b,c)$.