Arity (of a function)

https://arbital.com/p/function_arity

by Nate Soares May 9 2016 updated May 13 2016


The arity of a function is the number of parameters that it takes. For example, the function $~$f(a, b, c, d) = ac - bd$~$ is a function with arity 4, and $~$+$~$ is a function with arity 2; 2-arity functions are known as binary functions.

A function is said to take multiple parameters when its domain is the product of multiple sets. For example, consider the function is_older_than that takes (as input) a person and an age and returns yes if the person is older than that age, and no otherwise. The domain of is_older_than is the set of all pairs of people and ages, which we might write as $~$(\mathrm{People} \times \mathrm{Ages})$~$. Because this set is a product of two sets, we say that is_older_than is a function of two parameters, and that it has arity 2.