~/tedtes/writing/math-foundations-for-reasoning-models

~/writing/math-foundations-for-reasoning-models $ ls

Sets, Relations, and Functions

Cartesian Product

The Cartesian product creates all ordered pairs from two sets.

~/writing/math-foundations-for-reasoning-models $ cat topic.md

Cartesian Product

Definition

The Cartesian product of two sets is the set of all ordered pairs formed by taking one element from the first set and one from the second.

Example:

A = {1, 2}
B = {a, b}

Cartesian product:

A x B = {(1, a), (1, b), (2, a), (2, b)}

Cartesian product creates all possible ordered pair combinations.


Order Matters

In an ordered pair:

(1, a)

the first position comes from the first set.

The second position comes from the second set.

This is different from:

(a, 1)

So:

A x B

is not always the same as:

B x A

Cartesian product is ordered.


Why Ordered Pairs Matter

Ordered pairs let us represent relationships.

Example:

(person, city)

could represent:

person lives in city

A relation can be built by selecting some ordered pairs from a Cartesian product.

Cartesian product creates the space of possible relationships.


Size Of A Cartesian Product

If A has 2 elements and B has 3 elements:

A = {1, 2}
B = {a, b, c}

then:

A x B

has:

2 * 3 = 6

ordered pairs.

The product size multiplies the sizes of the sets.


Final Summary

  • Cartesian product creates ordered pairs from two sets.
  • The first pair position comes from the first set.
  • The second pair position comes from the second set.
  • Order matters in Cartesian products.
  • Cartesian products define the space of possible relations.

~/writing/math-foundations-for-reasoning-models $ open

Continue the series.

Relation