freeCodeCamp/guide/english/mathematics/cross-product/index.md

790 B

title
Cross Product

Cross Product

In set theory, a cross product of two sets is a binary operation performed on sets, which outputs a result set. It is denoted by the symbol X. Sometimes it is also called as Cartesian Product after mathematician Rene Descartes.


A X B = {(a, b) | a ∈ A and b ∈ B} 

Examples

let us have,
  set A = {a, b}
 & set B = {1, 2}
 then A X B = {(a, 1), (a, 2),
               (b, 1), (b, 2)}

Use

It is used to generate all possible combinations after combining two tables in a database.

References

Wikipedia Article

Wofram Alpha