I am trying to calculate total no of sequences possible with given sum k, out of a die (with m outcomes), tossed n times.
I could go after each combination, but $m^n$ grows very large quickly, so want a faster way to generate this. For coin flip, I simply grabbed binomial coefficients of respective row from Pascal's triangle, but here I am stuck on how to proceed. Can you kindly help?
Big picture:I am trying to understand how underlying nature of combinations evolve into normal distribution both theoretically and statistically.
Below is when I throw dice with 3 outcomes (0,1,2), 2 times. I get $[1,2,3,2,1]$ as the frequency of sequence as you see on LHs of the diagram.
Below is when I throw dice with 3 outcomes (0,1,2), 3 times. I get $[1,3,6,7,6,3,1]$ as frequency of sequence.
I have generated these, by directly generating all possible combinations and counting. When n is large, computing time is exponentially large. So I want a formula shortcut to come up with these frequency values pro grammatically. This is why above question.