Information About

Arity




In Linguistics , arity is sometimes referred to as Valency , not to be confused with Valency In Mathematics .

Although arity is an important concept, the word "arity" is rarely used in everyday practice. For example, rather than saying "the arity of the Addition operation is 2" or "addition is an operation of arity 2" one usually says "addition is a Binary Operation ".
In general, the naming of functions or operators with a given arity follows a convention similar to the one used for ''n''-based Numeral System s such as Binary and Hexadecimal . One combines a Latin prefix with the -ary ending; for example:
  • A nullary function takes no arguments.

  • A Unary function takes one argument.

  • A Binary function takes two arguments.

  • A Ternary function takes three arguments.

  • An ''n''-ary function takes ''n'' arguments.


In particular, an ''n''-ary operation ''f'' on a Set ''S'' is the same as a function ''f'' : ''S''''n'' → ''S''.


EXAMPLES



Nullary

Sometimes it is useful to consider a Constant as a function or an operator of arity 0, and hence call it ''nullary''.


Unary

Examples of unary operators in math and in programming include the unary minus and plus, the add-one or subtract-one operator in C -style languages, ''not'' in logical languages and the Factorial function in math. Also, the Two's Complement operator and the Address Reference operators are examples of unary operators in math and programming.


Binary

Most operators encountered in programming are of the binary form. For both programming and math these can be the Multiplication Operator , the addition operator, the division operator. Logical predicates such as ''OR'', ''XOR'', ''AND'', ''IMP'' are typically used as binary operators with two distinct operands.


Ternary

From , taking three parameters.




OTHER NAMES

  • ''Nullary'' means zero parameters.

  • '' Unary '' means one parameter.

  • '' Binary '' means two parameters.

  • '' Ternary '' means three parameters.

  • ''Quaternary'' means four parameters.

  • ''Quinary'' means five parameters.

  • ''Sestary'' means six parameters.

  • ''k''-ary means ''k'' parameters.


An alternative nomenclature is derived in a similar fashion from the corresponding Greek roots, for example, ''medadic'', ''monadic'', ''dyadic'', ''triadic'', and so on. Hence derive the alternative terms ''adicity'' and ''adinity'' for the Latin derived ''arity''.

Arities above quaternary are rarely found in math- or programming-related literature; already quaternary operations are more often called 4-ary.
However, these words are often used to describe anything related to that number (i.e. Undenary Chess is a chess variant with an 11x11 board, or the Millenary Petition of 1603).


SEE ALSO