In terms of mathematics, we’re all familiar with the phrase ‘product.’ It refers to the act of multiplying. 2 multiplied by 4 equals 8, and 16 multiplied by 7 equals 112. Let’s have a look at what the term “Cartesian” means. Also, what does a cartesian product imply? Complicated? Let’s have a look.
Cartesian Product
Before we get into the details of this phrase, let’s define the Cartesian Product of Two Sets. Reminisce words such as axes (both x and y), origin, and others while graphing on a piece of paper. For example, (2, 3) represents a value of 2 on the x-plane (axis) and a value of 3 on the y-plane (axis), which is not the same as (3, 2).
The order of representation is fixed, with the value of the x coordinate coming first, followed by the value of the y coordinate (ordered way). The Cartesian product is the ordered product of two elements x and y.
Cartesian Product of Sets
The Cartesian Product of Two Sets is the ordered product of two non-empty sets. Or, to put it another way, the collection of all ordered pairs is produced by multiplying two non-empty sets. An ordered pair is made up of two pieces from each set.
The first element of a pair of non-empty sets (say A & B) comes from set A, whereas the second member comes from set B. So we get a Cartesian product when all of these pairs are added together.
A × B denotes the Cartesian product of dual non-empty sets, namely A & B. Also known as the A and B product set or cross-product. The ordered pairs (a, b) are such that a ∈ A and b ∈ B. So, A × B = {(a, b): a ∈ A, b ∈ B}. For example, consider two non-empty sets A is equal to {a1, a2, a3} and B is equal to {b1, b2, b3}.
There is no arguing that (a1, b1) will be different from (b1, a,m, ). If either of the two sets is a null set, i.e., either A = Φ or B = Φ, then, A × B = Φ, i.e., A × B will also be a null set.
Number of Ordered Pairs
A and B are two non-empty sets. If the number of elements in A is h, n(A) = h, and the number of elements in B is k, n(B) = k, the number of ordered pairs in the Cartesian product is n(A × B) = n(A) × n(B) = HK.
Example of a Cartesian product
The Cartesian Product of Two Sets is the multiplication of two sets to produce the set of all ordered pairs, as we know. The ordered pair’s first element will belong to the first set, whereas the second pair will belong to the second set. For example, if A = cow, horse, and B = egg, juice, then A×B = (cow, egg), (horse, juice), (horse, juice), (cow, juice), (horse, egg).
Properties of Cartesian Product
The following are some significant properties to consider when calculating the Cartesian Product of Two Sets. The following are the properties:
Properties
Representation
The result of a Cartesian product is non-commutative, meaning it depends on the order of the sets.
Consider the two sets C and D:
C × D ≠ D × C
C × D = D × C, if and only if C = D.
C × D = ∅, if either C = ∅ or D =∅
The Cartesian product is non-associative, meaning it violates the associative property.
The result will vary if the parenthesis in this equation is rearranged.
(C × D) × E ≠ C × (D × E)
Over the intersection of sets, there is a distributive property.
C × (D∩E) = (C × D) ∩ (C × E)
Over the union of sets, there is a distributive property.
C × (D∪E) = (C × D) ∪ (C × E)
Cartesian Product of Two Empty Sets
An empty set will be the Cartesian Product of Two Sets. Consider two sets A and D, such that A × D = ∅ if either A = ∅ or D =∅, according to the properties of the cartesian product. In addition, if both sets are empty sets, the cartesian product will be empty as well.
Conclusion
The Cartesian product of sets is defined as the ordered product of two non-empty sets. Or, to put it another way, all ordered pairs are collected by multiplying two non-empty sets. An ordered pair is when two pieces from each set are selected. In SQL, it describes a fault in which you join two tables incorrectly and end up with numerous records from one table related to each of the entries from the other, rather than the expected one.