In how many ways can an ordered list of n elements be split into k groups? I am looking for a function $f(n, k)$ which receives the length $n \geq 1$ of an ordered list and in how many non-empty pieces $k \geq 1$ ($k \leq n)$ it should be split.
 A: I tried to make good examples and then found the answer myself while writing the question:
$$f(n, k) = \binom{n-1}{k-1}$$
How I got to this answer
First, some simple cases:


*

*$f(n, 1) = 1$

*$f(n, n) = 1$

*$f(n, 2) = n - 1 = f(n, n-1)$: I imagine the "splitter" between the elements and I move it from left to right, see below)

*$f(n, 3)$: I imagine a recursive approach here. So first I make the split as in the example $n=4, k=2$ below, then for every split for every second element I make another split. So for (1) I would get two possible splits and for (2) one possible split. Hence $f(4, 3) = 3$
I thought that it might be possible to build $f(n, k)$ with this knowledge. From $f(n, 2)$ there are two groups with only one element. Hence
$$
\begin{align}
f(n, 3) &= \sum_{i=1}^{n-2} f(n-i-1, 2) \\
&= \sum_{i=1}^{n-2} (n-i-1) \\
&= (n-2) \cdot (n - 1) - \sum_{i=1}^{n-2} i \\
&= (n-2) \cdot (n - 1) - \frac{(n-2)^2 + (n-2)}{2}\\
&= 0.5 \cdot (n-2) \cdot (n-1)
\end{align}
$$
I failed to generalize this approach and went back to the "splitter" thought:
The next thought was that a list [1,2,3,...,n] can be split at any comma. So n-1 potential commas / split positions. If I want $k$ lists in total, I have to use/select/enable (k-1) of the commas.
The list has (n-1) commas. As the order in which I select the commas does not matter, I think it should be
$$f(n, k) = \binom{n-1}{k-1}$$
n=4, k=2
original: [1,2,3,4]
splits:
  1. [[1], [2, 3,4]]
  2. [[1, 2], [3,4]]
  3. [[1, 2, 3], [4]]

n=5, k=3
original: [1,2,3,4,5]
split (first n=5,k=2):
  1. [[1], [2,3,4,5]]
  2. [[1,2], [3,4,5]]
  3. [[1,2,3], [4,5]]
  4. [[1,2,3,4], [5]]

split, second group (n=5, k=3):
  1.1. [[1],[2],[3,4,5]]
  1.2. [[1],[2,3],[4,5]]
  1.3. [[1],[2,3,4],[5]]

  2.1. [[1,2],[3],[4,5]]
  2.2. [[1,2],[3,4],[5]]

  3.1. [[1,2,3],[4],[5]]

