Cartesian product


The Cartesian product of two sets is the set of all possible ordered pairs made up of one element from each set. In set-builder notation, the Cartesian product \(A \times B\) of two sets \(A\) and \(B\) is defined as:

$$A \times B = \set{ (a, b) : a \in A \land b \in B }$$

Intuitively, the Cartesian product here can be viewed as the set of all combinations of \(a\) and \(b\) where \(a\) is an element of \(A\) and \(b\) is an element of \(B.\)

For finite sets, the cardinality of their Cartesian product is the product of their individual cardinalities. This is expressed through the following equation: \(|A \times B| = |A| * |B|\), which is really just the rule of product.

⚠ Recognize that \(A \times B \neq B \times A.\) This is because the roles of the first and second elements have been swapped, and for ordered pairs, that matters. Therefore, while \(A \times B\) and \(B \times A\) have the same combinations, they do not have the same ordered pairs, making them different sets.
Contents

Cartesian products of several sets


When dealing with more than \(2\) sets at once, the definition of the Cartesian product can be generalized for \(n\) sets.

For sets \(A_1, ..., A_n\), their Cartesian product is as follows: $$A_1 \times ... \times A_n = \set{ (a_1, ..., a_n) : \bigwedge_{i=1}^{n} a_i \in A_i}$$

This can be read as "the set of all \(n\)-tuples whose \(i\)th element is an element of the \(i\)th set." Therefore, the Cartesian product of \(n\) sets is the set of all ordered \(n\)-tuples made up of one element from each set.

Cartesian product of a set with itself


The Cartesian product of a set \(A\) with itself is typically abbreviated as \(A^n\), defined as:

$$A^n = \underbrace{A \times A \times ... \times A}_{n \, \text{times}}$$

If \(A\) consists of only characters, you can instead write the elements of \(A^n\) as strings rather than as ordered \(n\)-tuples, which means you can forgo the use of parentheses and commas. Take \(\set{0, 1}^3\) for example, the set of all \(3\)-bit binary strings:

$$\set{0, 1}^3 = \set{ 000, 001, 010, 011, 100, 101, 110, 111 }$$
⚠ Notably, the two-dimensional plane as we know it is the collection of all ordered pairs \((x, y)\) such that \((x, y) \in \mathbb{R}^2.\)
Logic & Proofs
IntegerRational numberInequalityReal numberTheoremProofStatementProof by exhaustionUniversal generalizationCounterexampleExistence proofExistential instantiationAxiomLogicTruthPropositionCompound propositionLogical operationLogical equivalenceTautologyContradictionLogic lawPredicateDomainQuantifierArgumentRule of inferenceLogical proofDirect proofProof by contrapositiveIrrational numberProof by contradictionProof by casesSummationDisjunctive normal form
Set Theory
SetElementEmpty setUniversal setSubsetPower setCartesian productStringBinary stringEmpty stringSet operationSet identitySet proof
Functions
FunctionFloor functionCeiling functionInverse function
Algorithms
AlgorithmPseudocodeCommandAsymptotic notationTime complexityAtomic operationBrute-force algorithm
Relations
RelationReflexive relationSymmetric relationTransitive relationRelation compositionEquivalence relationEquivalence class
Number Theory
Integer divisionLinear combinationDivision algorithmModular arithmeticPrime factorizationGreatest common divisorLeast common multiplePrimality testFactoring algorithmEuclid's theoremPrime number theoremEuclidean algorithm
Induction
Proof by inductionFibonacci sequenceProof by strong inductionWell-ordering principleSequenceFactorialRecursive definition
Combinatorics
Rule of productRule of sumBijection rulePermutationCombinationComplement ruleExperimentOutcomeSample spaceEventProbabilityProbability distributionUniform distributionMultisetSixfold wayInclusion-exclusion principlePigeonhole principle
Graph Theory
GraphWalkSubgraphRegular graphComplete graphEmpty graphCycle graphHypercube graphBipartite graphComponentEulerian circuitEulerian trailHamiltonian cycleHamiltonian pathTreeHuffman treeSubstringForestPath graphStarSpanning treeWeighted graphMinimum spanning treeGreedy algorithmPrim's algorithm
Recursion
RecursionRecursive algorithmCorrectness proofDivide-and-conquer algorithmSorting algorithmMerge sort