Given a sample of discrete random variables $X_1, X_2, \ldots, X_n \sim F$, I am looking to calculate the distribution given by the probability mass function:
$$P\left(\sum_{i=1}^n X_i = x~\middle|~\max_{i=1}^n X_i = a\right)$$
In other words, given that I know the maximum value of the sample, I would like to know the distribution of the sum.
My initial approach to this problem was to define a new distribution $F'$, a truncated version of $F$ supported up to and including $a$, such that we can independently take $Y_1, Y_2, \ldots, Y_{n-1} \sim F'$ and rewrite:
$$P\left(\left(a + \sum_{i = 1}^{n - 1} Y_i\right) = x\right)$$
I was initially expecting this to be an exact solution to the problem, but some inspection seems to indicate that it is not. For small values of $n$, there is a noticable difference in the distribution of my model and the "truth" (gathered by repeatedly drawing samples, and keeping those with the correct maximum).
Here is an example in which $n = 2$, $a = 10$, $F = B(20, 0.5)$, with the blue histogram produced from 10,000 samples:
Is there a way that I can model this distribution exactly? The code used to produce the plot in this question is available in this gist.