Is it possible to have function with a variable number of parameters? I was wondering if there is a type of parameterized function where the number of parameters changes over time? How would you describe the derivative/properties of the number of parameters over time since the change would most likely be discrete? What about a vector-valued function that can take in different sized vectors and have some operation that decides whether to increase or decrease the size of the output vector? I don't have a clear sense of what kind of mathematical machinery could be used to produce something like this.
 A: The usual take to get a function with "varying number of parameters" is to define it as having the maximal number of parameters it can have, and then simply let it ignore some of the parameters depending on the input on some of the variables. E.g. we can model a function that for $x∈(−∞,1]$ has a single parameter $x$, and for $x>1$ has two parameters $x,y$ as follows:
$$f(x,y):=\begin{cases} f_1(x), &x\le 1\\ f_2(x,y), &x>1\end{cases}$$
If you don't like it being so obviously a piece-wise function, then you can use an indicator function, which does the same. With indicator functions, it'd be written as:
$$f(x,y) = f_1(x) \mathbb{1}_{(-\infty,1]}(x) + f_2(x,y)\mathbb{1}_{(1,\infty)}(x)$$
Here, the function $\mathbb{1}_A(x)$, where $A$ is an abitrary set, is defined as 
$$ \mathbb{1}_A(x):=\begin{cases} 1, &\text{ if } x\in A\\ 0, &\text{else}\end{cases}$$
On the most basic level of definitions, $\mathbb{1}_A$ is therefore the set $\{(x,1)\mid x\in A\}\cup \{(x,0)\mid x\not\in A\} $
You'll find ample use of the indicator function in integration theory and stochastics.
A classic example of a situation where you kind of want a varying number of parameters is the following game:
Let's say we have 4 players playing a turn based game. Each turn, every player gets to take an action. Let's say every player has the same possible actions $\Omega$ (a set of actions).
However, as it is a game, a player might lose, which means he can not take any actions anymore. Furthermore, the game ends at some point.
How would we describe a generic game?
One possibility is the following: 
We let $\hat\Omega$ be the set $\Omega$, extended by an element $l$, which we'll interpret as "the player can't take any action because he has lost/won".
Then, every possible game is an element in $\bigg((\hat\Omega)^4\bigg)^\mathbb{N}$
So let's define $\tilde{\Omega}$ as the set $\{x\in\hat\Omega\mid x\text{  is a legit game}\}$ (for example, in a legit game a player who has lost in one turn, has lost in all later turns as well) .
Now, every function that takes the game as input, has technically a variable number of parameters it really cares about - at the latest, all parameters from rounds when everybody has lost/won should be negligible.
Let's say we now have a function that e.g. shows the score of player 1. Then, at the latest when player 1 has lost/won, the score won't change anymore.
How do we tell our function that?
One possible way would be to use an expression that returns for a game the round where player 1 loses/wins, e.g. for $w\in\tilde{\Omega}$: $$\text{min arg}_{i\in \mathbb N} ((w_i)_1 = l)$$
since every $w\in\tilde\Omega$ can be written as  $(w_i)_{i\in\mathbb N}$ an equivalent characterization would be:
$$
\min \{i\in\mathbb N\mid (w_i)_1 = l\}
$$
Or, if $f$ is a sum that simply runs over the turns, we can simply set $l=0$.
