We load three different passengers - A, B, and C - onto a ferris wheel with $M$ cars symmetrically distributed around the wheel. Let d(AB), d(AC), and d(BC) represent the number of cars between all possible sets of two passengers going clockwise around the ferris wheel. If no two passengers are loaded in the same car, how many distinct sets, $S$, of these three pairwise distances (d(AB), d(AC), d(BC)) are possible? How does this generalize as the number of passengers loaded in distinct cars increases to $M$?
To clarify, each passenger is distinct/labeled, and the set of all possible pairwise distances should form an ordered list. For example, (d(AB), d(AC), d(BC)) = (2,3,4) would be counted as distinct from (d(AB), d(AC), d(BC)) = (3,2,4). If one filled the ferris wheel with $(M - 1)$ passengers, there would therefore be $S = M$ possible sets of these pairwise distances.
Correct me if I'm wrong, but I believe this is equivalent to asking for the number, $S$, of possible ordered lists of $N$ zero or positive integers for some $N < M$ s.t. their sum is equal to $(M - N)$.
Results of brute force calculations:
For $N$ = 3 and $M$ = 3 to 10, a brute force calculation shows that the number of such distinct ordered lists, $S$, increases as {1,3,6,10,15,21,28,36}, which fits the relation: $S = \frac{1}{2}(M-2)(M-1)$, or $S = \frac{1}{2}\frac{(M-1)!}{(M-N)!}$. This relation holds when $M = 100$ and $S = 4851$.
For $N$ = 4 and $M$ = 4 to 10, a brute force calculation shows that the number of such distinct ordered lists, $S$, increases as {1,4,10,20,35,56,84}, which fits the relation: $S = \frac{1}{6}(M-3)(M-2)(M-1)$, or $S = \frac{1}{6}\frac{(M-1)!}{(M-N)!}$. This relation holds when $M = 20$ and $S = 969$.
For $N$ = 5 and $M$ = 5 to 10, a brute force calculation shows that the number of such distinct ordered lists, $S$, increases as {1,5,15,35,70,126}, which fits the relation: $S = \frac{1}{24}(M-3)(M-2)(M-1)$, or $S = \frac{1}{24}\frac{(M-1)!}{(M-N)!}$.
For $N$ = 6 and $M$ = 6 to 10, we have $S$ increasing as {1,6,21,56,126}, which fits the relation $S = \frac{1}{120}\frac{(M-1)!}{(M-N)!}$.
From these results, one might guess that $S = C*\frac{(M-1)!}{(M-N)!}$, where $C$ is some fractional coefficient. Using the predicted coefficients for $N = {3,4,5,6}$, which are {$\frac{1}{2}$,$\frac{1}{6}$,$\frac{1}{24}$,$\frac{1}{120}$}, I'd say that $C = \frac{1}{(N-1)!}$, which gives us a solution of:
$S = \frac{1}{(N-1)!}\frac{(M-1)!}{(M-N)!}$
Is this true?