Arity (of a function)

The ar­ity of a func­tion is the num­ber of pa­ram­e­ters that it takes. For ex­am­ple, the func­tion \(f(a, b, c, d) = ac - bd\) is a func­tion with ar­ity 4, and \(+\) is a func­tion with ar­ity 2; 2-ar­ity func­tions are known as bi­nary func­tions.

A func­tion is said to take mul­ti­ple pa­ram­e­ters when its do­main is the product of mul­ti­ple sets. For ex­am­ple, con­sider the func­tion is_older_than that takes (as in­put) a per­son and an age and re­turns yes if the per­son is older than that age, and no oth­er­wise. The do­main of is_older_than is the set of all pairs of peo­ple and ages, which we might write as \((\mathrm{People} \times \mathrm{Ages})\). Be­cause this set is a product of two sets, we say that is_older_than is a func­tion of two pa­ram­e­ters, and that it has ar­ity 2.

Parents: