Skip to content
ENExplore Calculators

Cartesian Product Calculator

Work out cartesian product instantly with clear inputs, formula shown and shareable results.

About Cartesian Product Calculator

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.

Formulas

Cartesian product

|A × B| = |A| × |B|

Function count

number of functions A → B = |B|^|A|

Worked example

With the default values below, Cartesian Product Calculator returns |A × B| of 6. Change any input above and every figure here is recalculated in your browser.

Inputs used

Set A
1, 2, 3
Set B
10, 20

Results

|A × B|
6
Ordered pairs
(1,10) (1,20) (2,10) (2,20) (3,10) (3,20)
Possible relations from A to B (0 if too large)
64
Possible functions from A to B
8

Step by step

  1. 1Values used
  2. 2Cartesian product
  3. 3Function count
  4. 4|A × B|= 6
  5. 5Ordered pairs= (1,10) (1,20) (2,10) (2,20) (3,10) (3,20)
  6. 6Possible relations from A to B (0 if too large)= 64
  7. 7Possible functions from A to B= 8

Assumptions and limits

  • The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

For A = {1,2,3} and B = {10,20}?

Six pairs, 2⁶ = 64 possible relations and 2³ = 8 possible functions from A to B.

Is A × B the same as B × A?

Not unless one set is empty or they are equal. Ordered pairs remember which came first.

Cartesian Product Calculator | Calcrivo