# What's the shape of this “addsTo” function …?

Note that in this combinatronics question,

How many lists of 100 numbers (1 to 10 only) add to 700?

For an array of 100 numbers, each 1 to 10 inclusive, and the total is T - how many such arrays exist?

In fact due to the ASTOUNDING answers there, we now know

for T=700 the answer is 1.2 e92

Being curious I now wonder about the shape of this result for various T.

Sadly, all I know are the points T<100, T=100, T=700 (thanks, MSE!), and T=1000.

Many questions arise, is there a T that makes a maximum, is it the same all over except the ends, is it bumpy or erratic ... does it make any difference if T is prime, even, etc ... and, since 19^92 is pretty small and there's only 600 Ts, in fact, is T=700 just freakishly small for some reason (what reason?) ...... or?

• The rough shape is a bell curve with center at $550$ and symmetric around that point. – Thomas Andrews Sep 11 '14 at 14:42
• Yeah, I didn't read the linked-to question, so I didn't realize I duplicated a lot of work, so just made the comment. Basically, if you pick a random integer from $1$ to $10$ 100 times, the the probability of getting $T$ is $\frac{1}{10^{100}}$ times your count. And the general tendency of repeating processes like this is to get a bell curve. – Thomas Andrews Sep 11 '14 at 14:45
• It's $$\sum_{j=0}^{45} (-1)^j \binom{100}{j}\binom{549-10j}{99}$$ Need some time to find a program to calculate it. – Thomas Andrews Sep 11 '14 at 14:51
• The approximation of the distribution as a bell curve appeared as @mjqxxxx's answer to your other problem. One can perhaps obtain asymptotic corrections to this with more sophisticated analysis. – Semiclassical Sep 12 '14 at 16:32
• ah, i didn't notice that, thanks semi. still it would be interesting to know the max etc - still thanks – Fattie Sep 12 '14 at 16:35

According to the Central Limit Theorem, when you add a large number of independent, identically distributed random variables (each variable can be a sum of other random variables), the distribution of the sum tends to a normal distribution whose mean is the sum of the means of the individual distributions, and whose variance is the sum of the variances of the individual distributions.

For example, if we sum $1$ number ($1$-$10$), the distribution looks like

$\hspace{3cm}$

If we sum $2$ numbers ($1$-$10$), the distribution looks like

$\hspace{3cm}$

If we sum $3$ numbers ($1$-$10$), the distribution starts to looks like a normal distribution

$\hspace{3cm}$

If we sum $10$ numbers ($1$-$10$), the distribution looks even more like a normal distribution

$\hspace{3cm}$

Now lets look at the sum of $100$ numbers ($1$-$10$)

$\hspace{3cm}$

The number of ways for $100$ numbers ($1$-$10$) to sum to $700$, which was computed in this answer, is pointed to by the arrow. Note that the range of the sum is $9n$ where $n$ is how many numbers are added; however, the standard deviation is $\sqrt{8.25n}$. Thus, the relative spread gets smaller; that is, the distribution becomes narrower about the mean as $n$ get bigger.

The maximum number of ways to sum to $T$ is at the mean of the distribution; that is, at $T=550$, where the number of ways is $$13868117806391314648666325510838589167047653141664\\4888545033078503482282975641730091720919340564340$$ which is approximately $1.3868117806391314649\times10^{98}$.

• Wow - you guys are amazing. I'm so dense I didn't even realise, of course the question is just equivalent to looking at the random distribution. one question - you see the final graph, in fact the answer to the question ........ – Fattie Sep 13 '14 at 9:30
• ...... would we still call that "a bell curve," a normal distribution, since it's so incredibly pointy? As the answer explains, for 1 or 2 numbers, I guess you'd say, "it is not" a Normal distribution. Well now, when you get to very high numbers (300, 500, 10,000) again does it become "not" a Normal distribution? Or, is it still perfectly a "bell curve" but just very pointy? Is bell curvey -ness subjective? Or conversely, just by definition, is every result here officially a normal distribution (even the 1 or 2 cases)? Cheers!!!!! – Fattie Sep 13 '14 at 9:31
• @JoeBlow: A scaled bell curve looks pointy, and that is what this is: a scaled bell curve. If scaled so that the standard deviation is $1$, its total sum is $1$, and translated so that the mean is $0$, it would look very close to a normal distribution bell curve. Scaled this way would map the total range of possibilities to the whole real line. – robjohn Sep 13 '14 at 9:39
• Gotchya, I'll have to think about that. If I'm not mistaken, in your graphs, indeed they all start and end at the zero points (so, for "10" it's 10-->100, and for "100" it's 100-->1000 etc). And the scale heights are the same so there's no "trick". But it seems to me they are radically different: the shapes of "100" and "10million" would be terribly different right? Recall I was asking "is 700 just freakishly small for some reason?" Indeed, that is the reason: there is no such "freakish smallness" in the (say) "10" or "15" case when you are still equally near the middle .... but ... – Fattie Sep 13 '14 at 9:53
• ... indeed this function becomes "amazingly pointy" as the count gets higher. I'm thinking like a video game programmer, if something depended on that shape, play would be spectacularly different with the "10" shape versus the "500" shape. (You'd almost always, versus never, run in to the goblin or whatever.) Anyways - I'm wasting your time - I'll go take a refresher course in normal curves THANK YOU SO MUCH. Do you often provide such good answers that nobody else even has to bother? ;-) – Fattie Sep 13 '14 at 9:55