Bound

From APL Wiki
Revision as of 14:15, 17 October 2019 by Miraheze>Marshall (Created page with "The bound of an array is the number of elements it contains, or equivalently the length (Tally) of its ravel vector or the product (<code>×/</code>) of its ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The bound of an array is the number of elements it contains, or equivalently the length (Tally) of its ravel vector or the product (×/) of its shape.

The bound can be derived axiomatically as a function of the shape from two rules:

  • The bound of a vector is its length, and
  • If two shapes are catenated (for instance by an outer product), the resulting bound is the product of their individual bounds.

A scalar has rank 0, or empty shape. From the above axioms we can deduce that it has bound 1: catenating with some other shape leaves that shape unchanged, so multiplying any bound by a scalar's bound cannot change it either. Therefore a scalar's bound must be the multiplicative identity, 1.

Combining axes of an array, for instance by using Table or Ravel with axis, leaves the array's bound unchanged, despite changing its shape, rank, and possibly Tally.