4

I am writing a proof, which uses functions that can handle an arbitrary number of parameters like summing, or averaging. In other words, I'm referring to functions like:

$f(x_1, ... x_n) = \sum_i x_i$, or

$f(x_1, ... x_n) = 1/n \sum_i x_i$, or even

$f(x_1, ... x_n) = \sum_i i \cdot x_i$

Clearly, $n$ can be arbitrary and these definitions would still make sense. I'd like to call these functions a name. Is there an existing name for such functions?

As an example, I'd like to be able to say: "Let $f$ be a ______ function that acts on some (or all) of the elements of $S$" (So here $f$ would be any function that accepts any number of elements from $S$ as arguments". What's the right way to word this?

  • The name for the set of variables as a group is often a vector. The function you describe is then simply a function, which takes a vector as an argument. You might use the notation 'f:\mathbb R^n\mapsto \mathbb R' as $f:\Bbb R^n\mapsto \Bbb R$. – abiessu Feb 10 '18 at 03:46
  • That makes sense, but then I'd like for the function to be able to take vectors of arbitrary size. Is that standard? – Curious Student Feb 10 '18 at 03:48
  • 1
    @CuriousStudent In math? Not really. In computing? Certainly. But there is usually some rather simple structure to such functions in practice, as in your examples. – Ian Feb 10 '18 at 03:50
  • Thanks. The examples I gave were for illustration, but I'd like to not assume any special structure to these functions in my proof. – Curious Student Feb 10 '18 at 03:53
  • 2
    In mathematics, it's much more common to describe these functions as taking a single argument, which is a set (or in your third example, a sequence). –  Feb 10 '18 at 03:57
  • @CuriousStudent It ultimately comes down to the formalism you choose to work within to define what a "variadic function" may be, but it is common for example to extend commutative and associative binary operators to an arbitrary number of variables e.g. $,\max(x_1,x_2,\ldots,x_n),$ or $,\gcd(x_1,x_2,\ldots,x_n),$. – dxiv Feb 10 '18 at 04:14
  • What is your set $S$ which each $x_i$ belongs to? Moreover, is it finite? – Taroccoesbrocco Feb 10 '18 at 04:15
  • 1
    In programming languages, such functions are called variadic. – Fabio Somenzi Feb 10 '18 at 04:30
  • 1
    You could use the term aggregating. – JonathanZ Feb 10 '18 at 05:21
  • I don't know about a name for such functions, but regarding notation see Notation for the Set of All Finite $n$-Tuples from a Set $A$. Incidentally, besides $S^{}$ and $S^{< \omega}$ mentioned there, I've seen the notation Seq($S$) (p. 46 of 1999 3rd edition of Introduction to Set Theory* by Karel Hrbacek and Thomas Jech). – Dave L. Renfro Feb 10 '18 at 10:21

2 Answers2

5

As hinted by Fabio Somenzi and JonathanZ, in the context of computer science you can call these kind of functions variadic or aggregating.

By the way, you can easily define this kind of function in a mathematically rigorous way. The intuition is that a function $f$ would have an arbitrary arity, i.e. $f$ would accept any number of elements from a set $S$ as arguments. From a rigorous prospective, you can say the domain of $f$ is the set $S^*$ (denoted also by $S^{<\omega}$) of finite sequences of elements of $S$, i.e.

\begin{align} S^* = \bigcup_{n \in \mathbb{N}} \overbrace{S \times \dots \times S}^{n \text{ times } S}. \end{align}

So, for all $n \in \mathbb{N}$, $s_1, \dots, s_n \in S$ iff $(s_1, \dots, s_n) \in S^*$: in other words, $S^*$ contains all and only the tuples of elements of $S$, for every (finite) length.

Strictly speaking, the function $f$ defined in this way is unary (with respect to the domain $S^*$), but it perfectly translates the idea that $f$ has an arbitrary arity (with respect to $S$). How powerful the language of mathematics is!

-1

The term for the number of arguments a function takes is arity and for arbitrary (but finite) arguments is the somewhat unimaginative n-ary.

law-of-fives
  • 1,963
  • 2
    "$n$-ary" indicates "has a fixed arity, which is equal to $n$". The word "finitary" is more apt, I think, though that is a word I would always define the first time I used it. – Patrick Stevens Feb 10 '18 at 09:03