Calculate no of sequences with sum k, out of die toss n times, with die having m outcomes

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












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.



enter image description here



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.



enter image description here



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.







share|cite|improve this question





















  • here is a discussion of a related problem.
    – lulu
    Aug 2 at 11:52










  • checked it, could not relate directly. can you please transform that to this problem?
    – Paari Vendhan
    Aug 2 at 12:28










  • $a_i$ is the value of the $i^th$ die (or one less than that). Your problem is the case where all the $r_i$ are equal. Specifically, if you are dealing with ordinary dice, all of your $r_i$ are $6$. The fact that your rolls are all at least $1$ is not a significant difference, as you can just subtract $n$ from the total and remove that constraint.
    – lulu
    Aug 2 at 12:31











  • Worth noting: the first answer specifically addresses the case where all the $r_i$ are equal.
    – lulu
    Aug 2 at 12:33










  • Please check if my inference is correct. Suppose I have a die with 3 outcomes (say 0,1,2). I flip it 2 times. Let X be sum of outcomes. I want to calculate $X_2$, that is, how many outcomes where sum is 2. So, $a_1 + a_2 + a_3 = 2$. If so, we need to solve $(1+X+X^2+X^3)^2 = dfrac (1-X^4)^2(1-X)^2$?
    – Paari Vendhan
    Aug 2 at 13:49














up vote
0
down vote

favorite












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.



enter image description here



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.



enter image description here



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.







share|cite|improve this question





















  • here is a discussion of a related problem.
    – lulu
    Aug 2 at 11:52










  • checked it, could not relate directly. can you please transform that to this problem?
    – Paari Vendhan
    Aug 2 at 12:28










  • $a_i$ is the value of the $i^th$ die (or one less than that). Your problem is the case where all the $r_i$ are equal. Specifically, if you are dealing with ordinary dice, all of your $r_i$ are $6$. The fact that your rolls are all at least $1$ is not a significant difference, as you can just subtract $n$ from the total and remove that constraint.
    – lulu
    Aug 2 at 12:31











  • Worth noting: the first answer specifically addresses the case where all the $r_i$ are equal.
    – lulu
    Aug 2 at 12:33










  • Please check if my inference is correct. Suppose I have a die with 3 outcomes (say 0,1,2). I flip it 2 times. Let X be sum of outcomes. I want to calculate $X_2$, that is, how many outcomes where sum is 2. So, $a_1 + a_2 + a_3 = 2$. If so, we need to solve $(1+X+X^2+X^3)^2 = dfrac (1-X^4)^2(1-X)^2$?
    – Paari Vendhan
    Aug 2 at 13:49












up vote
0
down vote

favorite









up vote
0
down vote

favorite











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.



enter image description here



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.



enter image description here



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.







share|cite|improve this question













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.



enter image description here



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.



enter image description here



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.









share|cite|improve this question












share|cite|improve this question




share|cite|improve this question








edited Aug 2 at 14:31
























asked Aug 2 at 11:47









Paari Vendhan

355




355











  • here is a discussion of a related problem.
    – lulu
    Aug 2 at 11:52










  • checked it, could not relate directly. can you please transform that to this problem?
    – Paari Vendhan
    Aug 2 at 12:28










  • $a_i$ is the value of the $i^th$ die (or one less than that). Your problem is the case where all the $r_i$ are equal. Specifically, if you are dealing with ordinary dice, all of your $r_i$ are $6$. The fact that your rolls are all at least $1$ is not a significant difference, as you can just subtract $n$ from the total and remove that constraint.
    – lulu
    Aug 2 at 12:31











  • Worth noting: the first answer specifically addresses the case where all the $r_i$ are equal.
    – lulu
    Aug 2 at 12:33










  • Please check if my inference is correct. Suppose I have a die with 3 outcomes (say 0,1,2). I flip it 2 times. Let X be sum of outcomes. I want to calculate $X_2$, that is, how many outcomes where sum is 2. So, $a_1 + a_2 + a_3 = 2$. If so, we need to solve $(1+X+X^2+X^3)^2 = dfrac (1-X^4)^2(1-X)^2$?
    – Paari Vendhan
    Aug 2 at 13:49
















  • here is a discussion of a related problem.
    – lulu
    Aug 2 at 11:52










  • checked it, could not relate directly. can you please transform that to this problem?
    – Paari Vendhan
    Aug 2 at 12:28










  • $a_i$ is the value of the $i^th$ die (or one less than that). Your problem is the case where all the $r_i$ are equal. Specifically, if you are dealing with ordinary dice, all of your $r_i$ are $6$. The fact that your rolls are all at least $1$ is not a significant difference, as you can just subtract $n$ from the total and remove that constraint.
    – lulu
    Aug 2 at 12:31











  • Worth noting: the first answer specifically addresses the case where all the $r_i$ are equal.
    – lulu
    Aug 2 at 12:33










  • Please check if my inference is correct. Suppose I have a die with 3 outcomes (say 0,1,2). I flip it 2 times. Let X be sum of outcomes. I want to calculate $X_2$, that is, how many outcomes where sum is 2. So, $a_1 + a_2 + a_3 = 2$. If so, we need to solve $(1+X+X^2+X^3)^2 = dfrac (1-X^4)^2(1-X)^2$?
    – Paari Vendhan
    Aug 2 at 13:49















here is a discussion of a related problem.
– lulu
Aug 2 at 11:52




here is a discussion of a related problem.
– lulu
Aug 2 at 11:52












checked it, could not relate directly. can you please transform that to this problem?
– Paari Vendhan
Aug 2 at 12:28




checked it, could not relate directly. can you please transform that to this problem?
– Paari Vendhan
Aug 2 at 12:28












$a_i$ is the value of the $i^th$ die (or one less than that). Your problem is the case where all the $r_i$ are equal. Specifically, if you are dealing with ordinary dice, all of your $r_i$ are $6$. The fact that your rolls are all at least $1$ is not a significant difference, as you can just subtract $n$ from the total and remove that constraint.
– lulu
Aug 2 at 12:31





$a_i$ is the value of the $i^th$ die (or one less than that). Your problem is the case where all the $r_i$ are equal. Specifically, if you are dealing with ordinary dice, all of your $r_i$ are $6$. The fact that your rolls are all at least $1$ is not a significant difference, as you can just subtract $n$ from the total and remove that constraint.
– lulu
Aug 2 at 12:31













Worth noting: the first answer specifically addresses the case where all the $r_i$ are equal.
– lulu
Aug 2 at 12:33




Worth noting: the first answer specifically addresses the case where all the $r_i$ are equal.
– lulu
Aug 2 at 12:33












Please check if my inference is correct. Suppose I have a die with 3 outcomes (say 0,1,2). I flip it 2 times. Let X be sum of outcomes. I want to calculate $X_2$, that is, how many outcomes where sum is 2. So, $a_1 + a_2 + a_3 = 2$. If so, we need to solve $(1+X+X^2+X^3)^2 = dfrac (1-X^4)^2(1-X)^2$?
– Paari Vendhan
Aug 2 at 13:49




Please check if my inference is correct. Suppose I have a die with 3 outcomes (say 0,1,2). I flip it 2 times. Let X be sum of outcomes. I want to calculate $X_2$, that is, how many outcomes where sum is 2. So, $a_1 + a_2 + a_3 = 2$. If so, we need to solve $(1+X+X^2+X^3)^2 = dfrac (1-X^4)^2(1-X)^2$?
– Paari Vendhan
Aug 2 at 13:49















active

oldest

votes











Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2869990%2fcalculate-no-of-sequences-with-sum-k-out-of-die-toss-n-times-with-die-having-m%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2869990%2fcalculate-no-of-sequences-with-sum-k-out-of-die-toss-n-times-with-die-having-m%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What is the equation of a 3D cone with generalised tilt?

Color the edges and diagonals of a regular polygon

Relationship between determinant of matrix and determinant of adjoint?