The Maxima on-line user's manual

Algebra Calculator

Cartesian_product

Function: cartesian_product (<b_1>, ... , <b_n>) Returns a set of lists of the form `[<x_1>, ..., <x_n>]`, where <x_1>, ..., <x_n> are elements of the sets <b_1>, ... , <b_n>, respectively.

`cartesian_product` complains if any argument is not a literal set.

Examples:

```          (%i1) cartesian_product ({0, 1});
(%o1)                      {[0], [1]}
(%i2) cartesian_product ({0, 1}, {0, 1});
(%o2)           {[0, 0], [0, 1], [1, 0], [1, 1]}
(%i3) cartesian_product ({x}, {y}, {z});
(%o3)                      {[x, y, z]}
(%i4) cartesian_product ({x}, {-1, 0, 1});
(%o4)              {[x, - 1], [x, 0], [x, 1]}```

```(%o1)                                true
(%i2) ```

Related Examples

cartesian_product-product

cartesian_product({a,...

Calculate

cartesian_product-product-setdifference

1/* Produktmenge: A={...

A:{1,2,3};

B:{3,4};

Calculate

cartesian_product-product

cartesian_product({{}...

Calculate

cartesian_product-product

? cartesian_product;

Calculate

cartesian_product-product

cartesian_product({-2...

Calculate

cartesian_product-product

f(a,b,c):=not b and (...

f(true,true,true);

S:{true,false};

Calculate

cartesian_product-product

cartesian_product({{}...

Calculate

cartesian_product-product

cartesian_product;

Calculate

cartesian_product-product

cartesian_product ({[...

Calculate

cartesian_product-product

cartesian_product({1,...

Calculate