Work out cartesian product instantly with clear inputs, formula shown and shareable results.
The Cartesian product forms every ordered pair with the first element from A and the second from B, giving |A| × |B| pairs. Any subset of the product is a relation, and a function is a relation choosing one B for each A.
Cartesian product
|A × B| = |A| × |B|
Function count
number of functions A → B = |B|^|A|
Six pairs, 2⁶ = 64 possible relations and 2³ = 8 possible functions from A to B.
Not unless one set is empty or they are equal. Ordered pairs remember which came first.