# table -- make a table from a binary function

## Synopsis

• Usage:
table(a, b, f)
table(m, n, f)
• Inputs:
• Outputs:
• T, a table, or list of lists, where $T_{ij}$ is the value of $f(a_i, b_j)$, OR, if using integer arguments $m$ and $n$, $T_{ij}=f(i,j)$ for $0\le i < m, 0\le j < n$

## Description

The command table(m, n, f) is equivalent to table(0..(m-1), 0..(n-1), f).

 i1 : t1 = table({1,3,5,7}, {0,1,2,4}, (i,j) -> i^j) o1 = {{1, 1, 1, 1}, {1, 3, 9, 81}, {1, 5, 25, 625}, {1, 7, 49, 2401}} o1 : List i2 : t2 = table(5, 5, (i,j) -> i+j) o2 = {{0, 1, 2, 3, 4}, {1, 2, 3, 4, 5}, {2, 3, 4, 5, 6}, {3, 4, 5, 6, 7}, {4, ------------------------------------------------------------------------ 5, 6, 7, 8}} o2 : List

Tables can be displayed nicely using netList.

 i3 : netList t1 +-+-+--+----+ o3 = |1|1|1 |1 | +-+-+--+----+ |1|3|9 |81 | +-+-+--+----+ |1|5|25|625 | +-+-+--+----+ |1|7|49|2401| +-+-+--+----+

• applyTable -- apply a function to each element of a table
• isTable -- whether something is a list of lists of equal length
• subtable -- extract a subtable from a table
• lists and sequences -- a detailed overview of lists and sequences in Macaulay2

## For the programmer

The object table is .