Ads

Cartesian Product Calculator


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

Calculator

Please enter the values separated by comma(,)


 

The cross product (Cartesian Product) is a vector product which yields another vector rather than a scalar.

The value entered sets A and B separated by comma, the Cartesian product A × B is the set of all ordered pairs (a, b)

where

a ∈ A and b ∈ B.

Cartesian Product Formula

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

A × B = {(a,b) : a ∈ A and b ∈ B}

Each ordered pair contains one element from set A and one element from set B. The order of elements matters, which means (a,b) and (b,a) are considered different pairs.

If set A contains m elements and set B contains n elements, then:

n(A × B) = n(A) × n(B)

where n(A) and n(B) represent the number of elements in sets A and B respectively.

What is a Cartesian Product?

The Cartesian product is a mathematical operation that combines two sets to create a new set consisting of all possible ordered pairs. The first value of each pair comes from the first set, while the second value comes from the second set.

For example, if:

A = {1, 2}

B = {x, y}

then the Cartesian product A × B is:

{(1,x), (1,y), (2,x), (2,y)}

The Cartesian product is widely used in mathematics, computer science, database systems, probability theory, graph theory, and relation mapping.

Properties of Cartesian Product

  • The order of elements in each pair is important.
  • Generally, A × B is not equal to B × A.
  • If either set is empty, the Cartesian product is empty.
  • The number of ordered pairs equals the product of the sizes of both sets.
  • A Cartesian product can contain numbers, symbols, letters, or words.
  • Repeated elements do not create additional unique pairs in a set.

Applications of Cartesian Product

Cartesian products are used in many areas of mathematics and computing:

  • Creating coordinate systems and graph points.
  • Database relationship modeling.
  • Generating combinations of options.
  • Defining mathematical relations and functions.
  • Probability and sample space construction.
  • Computer programming and nested loop operations.
  • Machine learning feature combinations.
  • Graph theory and network analysis.

Difference Between A × B and B × A

The Cartesian product is not commutative.

If A = {1,2} and B = {x,y}

A × B = {(1,x),(1,y),(2,x),(2,y)}

B × A = {(x,1),(x,2),(y,1),(y,2)}

Since the ordered pairs are different, A × B ≠ B × A.

Solved Example

Problem:

Find the Cartesian product of:

A = {1, 2, 3}

B = {a, b}

Step 1: Write the Formula

A × B = {(a,b) : a ∈ A and b ∈ B}

Step 2: Pair Each Element of A with Every Element of B

(1,a), (1,b)

(2,a), (2,b)

(3,a), (3,b)

Step 3: Combine the Ordered Pairs

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

Step 4: Count the Pairs

Number of pairs = 3 × 2 = 6

Final Answer

{(1,a), (1,b), (2,a), (2,b), (3,a), (3,b)}

Frequently Asked Questions

What is a Cartesian product in mathematics?

The Cartesian product is a set of all ordered pairs formed by combining elements from two sets.

Why is the order of elements important?

Because (a,b) and (b,a) are different ordered pairs unless a and b are identical.

Is A × B always equal to B × A?

No. The order of elements changes, so the two Cartesian products are usually different.

What happens if one set is empty?

If either set contains no elements, the Cartesian product is an empty set.

How many ordered pairs will a Cartesian product contain?

The number of pairs equals the product of the number of elements in each set.

Can sets contain words instead of numbers?

Yes. Cartesian products can be formed from numbers, letters, symbols, words, or any valid set elements.

What is the difference between Cartesian product and cross product?

A Cartesian product operates on sets and produces ordered pairs, while a cross product is a vector operation in three-dimensional geometry.

Can duplicate values appear in a Cartesian product?

Sets normally contain unique elements, so duplicate entries are not considered separate elements.

Where are Cartesian products used in real life?

They are used in databases, scheduling systems, coordinate geometry, probability, and computer programming.

Can the Cartesian product of a set with itself be calculated?

Yes. A × A contains every possible ordered pair where both elements come from the same set.

What is the cardinality of a Cartesian product?

The cardinality is the total number of ordered pairs and equals n(A) × n(B).

Why are Cartesian products important in computer science?

They help generate all possible combinations, model relationships, and organize structured data efficiently.