Cartesian product

By Martin McBride, 2021-11-04
Tags: Cartesian product
Categories: statistics probability


The Cartesian product of two sets includes every possible combination of an element from the first set and an element from the second set.

Example

Suppose you had two sets of cards:

  • 3 red cards marked A, B and C
  • 4 blue cards numbered 1 to 4

The Cartesian product shows all the possible combinations of a red card and a blue card:

The grid shows all the possible pairs of values.

Calculating probabilities

The Cartesian product can be useful for calculating probabilities. This table shows all possible results of throwing two dice:

It shows every possibility for the first and second dice scores. Here is another table that shows the sum of the scores:

This can be used, for example, to determine the probability that the total score will be 5. There are 4 possible pairs of values that add up to 5, out of 36 possible pairs in total. This means that the probability of scoring 5 is 4/36, or 1 in 9.

More dimensions

If there are more than two values, for example if 3 dice were thrown, the result would be a 3-dimensional table of 6 by 6 by 6 entries. This can be extended to any number of dimensions, although it becomes less useful because it is hard to visualise.

See also



Join the GraphicMaths Newletter

Sign up using this form to receive an email when new content is added:

Popular tags

adder adjacency matrix alu and gate angle area argand diagram binary maths cartesian equation chain rule chord circle cofactor combinations complex modulus complex polygon complex power complex root cosh cosine cosine rule cpu cube decagon demorgans law derivative determinant diagonal directrix dodecagon eigenvalue eigenvector ellipse equilateral triangle euler eulers formula exponent exponential exterior angle first principles flip-flop focus gabriels horn gradient graph hendecagon heptagon hexagon horizontal hyperbola hyperbolic function hyperbolic functions infinity integration by parts integration by substitution interior angle inverse hyperbolic function inverse matrix irrational irregular polygon isosceles trapezium isosceles triangle kite koch curve l system line integral locus maclaurin series major axis matrix matrix algebra mean minor axis nand gate newton raphson method nonagon nor gate normal normal distribution not gate octagon or gate parabola parallelogram parametric equation pentagon perimeter permutations polar coordinates polynomial power probability probability distribution product rule proof pythagoras proof quadrilateral radians radius rectangle regular polygon rhombus root sech set set-reset flip-flop sine sine rule sinh sloping lines solving equations solving triangles square standard curves standard deviation star polygon statistics straight line graphs surface of revolution symmetry tangent tanh transformation transformations trapezium triangle turtle graphics variance vertical volume volume of revolution xnor gate xor gate