e01.org

Arity

In logic, mathematics, and computer science, arity ( ) is the number of arguments or operands taken by a function, operation or relation. In mathematics, arity may also be called rank, but this word can have many other meanings. In logic and philosophy, arity may also be called adicity and degree. In linguistics, it is usually named valency. Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.

In logic, mathematics, and computer science, arity ( ) is the number of arguments or operands taken by a function, operation or relation. In mathematics, arity may also be called rank, but this word can have many other meanings. In logic and philosophy, arity may also be called adicity and degree. In linguistics, it is usually named valency. Example: f()=2 A unary function takes one argument. Example: f(x)=2x A binary function takes two arguments. Example: f(x,y)=2xy A ternary function takes three arguments. Example: f(x,y,z)=2xyz An n-ary function takes n arguments. Example: f(x_1, x_2, \ldots, x_n)=2\prod_{i=1}^n x_i The Unix dc calculator has several ternary operators, such as | , which will pop three values from the stack and efficiently compute x^y \bmod z with arbitrary precision. Many (RISC) assembly language instructions are ternary (as opposed to only two operands specified in CISC); or higher, such as MOV %AX, (%BX, %CX) , which will load ( ) into register the contents of a calculated memory location that is the sum (parenthesis) of the registers and . The arithmetic mean of n real numbers is an n-ary function: \bar{x}=\frac{1}{n}\left (\sum_{i=1}^n{x_i}\right) = \frac{x_1+x_2+\dots+x_n}{n} Similarly, the geometric mean of n positive real numbers is an n-ary function: \left(\prod_{i=1}^n a_i\right)^\frac{1}{n} = \ \sqrt[n]{a_1 a_2 \cdots a_n} . Note that a logarithm of the geometric mean is the arithmetic mean of the logarithms of its n arguments From a mathematical point of view, a function of n arguments can always be considered as a function of a single argument that is an element of some product space. However, it may be convenient for notation to consider n-ary functions, as for example multilinear maps (which are not linear maps on the product space, if ). The same is true for programming languages, where functions taking several arguments could always be defined as functions taking a single argument of some composite type such as a tuple, or in languages with higher-order functions, by currying.

source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Arity". 1789724100. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1375536476

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·