Let $x_1, \dots, x_n$ with $\sum x_i = 1$ be proportions of a discrete distribution. Suppose the distribution changes and let $y_1, \dots, y_n$ be the subsequent proportions (and so $\sum y_i = 1$ too). Let $d_i = y_i - x_i$ be given.
For example consider that the distribution is the distribution of grades A-F of a cohort of school children over two years.
Assuming that a student can move at most one grade in a year (i.e. an A student in year 1 can only be an A student or a B student in year 2), and given the changes $d_i$, what is the minimum proportion of the distribution to have moved up (or down)?
Consider $d' = (0.1, 0, 0, -0.1)$ then the answer is 30% have moved down (and 0% have moved up). That is, I want a function $f(d') = (0.3, 0)$.