Skip to main content
Post Closed as "Duplicate" by Parcly Taxel combinatorics
deleted 28 characters in body
Source Link
Mike Earnest
  • 78.4k
  • 11
  • 67
  • 136

Given:

$x_1 + x_2 + ... + x_n = k$

where each $x_i$ can have some value between $0$ and $10$ (we might have $0\leq x_1\leq 7$ and we might have $0\leq x_2\leq 9$ and so on...)

How many nonnegative integer solutions are there to an equation like this, where each $x_i$ can take on any of the values in its range restrictions?

Is Mick A's answer applicable to this from the following? Number of solutions to equation, range restrictions per variable

If so, how would Mick A's answer be extended for equations of arbitrary lengths of the left-hand side? How could this be solved for programmatically?

EDIT: My thoughts are that we calculate $S$ and then subtract $S_1, S_2, ..., S_n$ from it, after which we add all intersections $S_1 \cap S_2, ...$ and then we subtract all "three-way intersections" $S_1 \cap S_2 \cap S_3, ... $ and then we add all the "four-way intersections" $S_1 \cap S_2 \cap S_3 \cap S_4,...$ and then we subtract all the "five-way intersections" etc...

Is this a correct approach?

EDIT2: Each $x_i$ is a non-negative integer.

Given:

$x_1 + x_2 + ... + x_n = k$

where each $x_i$ can have some value between $0$ and $10$ (we might have $0\leq x_1\leq 7$ and we might have $0\leq x_2\leq 9$ and so on...)

How many solutions are there to an equation like this, where each $x_i$ can take on any of the values in its range restrictions?

Is Mick A's answer applicable to this from the following? Number of solutions to equation, range restrictions per variable

If so, how would Mick A's answer be extended for equations of arbitrary lengths of the left-hand side? How could this be solved for programmatically?

EDIT: My thoughts are that we calculate $S$ and then subtract $S_1, S_2, ..., S_n$ from it, after which we add all intersections $S_1 \cap S_2, ...$ and then we subtract all "three-way intersections" $S_1 \cap S_2 \cap S_3, ... $ and then we add all the "four-way intersections" $S_1 \cap S_2 \cap S_3 \cap S_4,...$ and then we subtract all the "five-way intersections" etc...

Is this a correct approach?

EDIT2: Each $x_i$ is a non-negative integer.

Given:

$x_1 + x_2 + ... + x_n = k$

where each $x_i$ can have some value between $0$ and $10$ (we might have $0\leq x_1\leq 7$ and we might have $0\leq x_2\leq 9$ and so on...)

How many nonnegative integer solutions are there to an equation like this, where each $x_i$ can take on any of the values in its range restrictions?

Is Mick A's answer applicable to this from the following? Number of solutions to equation, range restrictions per variable

If so, how would Mick A's answer be extended for equations of arbitrary lengths of the left-hand side? How could this be solved for programmatically?

EDIT: My thoughts are that we calculate $S$ and then subtract $S_1, S_2, ..., S_n$ from it, after which we add all intersections $S_1 \cap S_2, ...$ and then we subtract all "three-way intersections" $S_1 \cap S_2 \cap S_3, ... $ and then we add all the "four-way intersections" $S_1 \cap S_2 \cap S_3 \cap S_4,...$ and then we subtract all the "five-way intersections" etc...

Is this a correct approach?

added 48 characters in body
Source Link

Given:

$x_1 + x_2 + ... + x_n = k$

where each $x_i$ can have some value between $0$ and $10$ (we might have $0\leq x_1\leq 7$ and we might have $0\leq x_2\leq 9$ and so on...)

How many solutions are there to an equation like this, where each $x_i$ can take on any of the values in its range restrictions?

Is Mick A's answer applicable to this from the following? Number of solutions to equation, range restrictions per variable

If so, how would Mick A's answer be extended for equations of arbitrary lengths of the left-hand side? How could this be solved for programmatically?

EDIT: My thoughts are that we calculate $S$ and then subtract $S_1, S_2, ..., S_n$ from it, after which we add all intersections $S_1 \cap S_2, ...$ and then we subtract all "three-way intersections" $S_1 \cap S_2 \cap S_3, ... $ and then we add all the "four-way intersections" $S_1 \cap S_2 \cap S_3 \cap S_4,...$ and then we subtract all the "five-way intersections" etc...

Is this a correct approach?

EDIT2: Each $x_i$ is a non-negative integer.

Given:

$x_1 + x_2 + ... + x_n = k$

where each $x_i$ can have some value between $0$ and $10$ (we might have $0\leq x_1\leq 7$ and we might have $0\leq x_2\leq 9$ and so on...)

How many solutions are there to an equation like this, where each $x_i$ can take on any of the values in its range restrictions?

Is Mick A's answer applicable to this from the following? Number of solutions to equation, range restrictions per variable

If so, how would Mick A's answer be extended for equations of arbitrary lengths of the left-hand side? How could this be solved for programmatically?

EDIT: My thoughts are that we calculate $S$ and then subtract $S_1, S_2, ..., S_n$ from it, after which we add all intersections $S_1 \cap S_2, ...$ and then we subtract all "three-way intersections" $S_1 \cap S_2 \cap S_3, ... $ and then we add all the "four-way intersections" $S_1 \cap S_2 \cap S_3 \cap S_4,...$

Is this a correct approach?

Given:

$x_1 + x_2 + ... + x_n = k$

where each $x_i$ can have some value between $0$ and $10$ (we might have $0\leq x_1\leq 7$ and we might have $0\leq x_2\leq 9$ and so on...)

How many solutions are there to an equation like this, where each $x_i$ can take on any of the values in its range restrictions?

Is Mick A's answer applicable to this from the following? Number of solutions to equation, range restrictions per variable

If so, how would Mick A's answer be extended for equations of arbitrary lengths of the left-hand side? How could this be solved for programmatically?

EDIT: My thoughts are that we calculate $S$ and then subtract $S_1, S_2, ..., S_n$ from it, after which we add all intersections $S_1 \cap S_2, ...$ and then we subtract all "three-way intersections" $S_1 \cap S_2 \cap S_3, ... $ and then we add all the "four-way intersections" $S_1 \cap S_2 \cap S_3 \cap S_4,...$ and then we subtract all the "five-way intersections" etc...

Is this a correct approach?

EDIT2: Each $x_i$ is a non-negative integer.

Given:

$x_1 + x_2 + ... + x_n = k$

where each $x_i$ can have some value between 0$0$ and 10$10$ (we might have $0<=x_1<=7$$0\leq x_1\leq 7$ and we might have $0<=x_2<=9$$0\leq x_2\leq 9$ and so on...)

How many solutions are there to an equation like this, where each $x_i$ can take on any of the values in its range restrictions?

Is Mick A's answer applicable to this from the following? Number of solutions to equation, range restrictions per variable

If so, how would Mick A's answer be extended for equations of arbitrary lengths of the left-hand side? How could this be solved for programmatically?

EDIT: My thoughts are that we calculate $S$ and then subtract $S_1, S_2, ..., S_n$ from it, after which we add all intersections $S_1 \cap S_2, ...$ and then we subtract all "three-way intersections" $S_1 \cap S_2 \cap S_3, ... $ and then we add all the "four-way intersections" $S_1 \cap S_2 \cap S_3 \cap S_4,...$

Is this a correct approach?

Given:

$x_1 + x_2 + ... + x_n = k$

where each $x_i$ can have some value between 0 and 10 (we might have $0<=x_1<=7$ and we might have $0<=x_2<=9$ and so on...)

How many solutions are there to an equation like this, where each $x_i$ can take on any of the values in its range restrictions?

Is Mick A's answer applicable to this from the following? Number of solutions to equation, range restrictions per variable

If so, how would Mick A's answer be extended for equations of arbitrary lengths of the left-hand side? How could this be solved for programmatically?

EDIT: My thoughts are that we calculate $S$ and then subtract $S_1, S_2, ..., S_n$ from it, after which we add all intersections $S_1 \cap S_2, ...$ and then we subtract all "three-way intersections" $S_1 \cap S_2 \cap S_3, ... $ and then we add all the "four-way intersections" $S_1 \cap S_2 \cap S_3 \cap S_4,...$

Is this a correct approach?

Given:

$x_1 + x_2 + ... + x_n = k$

where each $x_i$ can have some value between $0$ and $10$ (we might have $0\leq x_1\leq 7$ and we might have $0\leq x_2\leq 9$ and so on...)

How many solutions are there to an equation like this, where each $x_i$ can take on any of the values in its range restrictions?

Is Mick A's answer applicable to this from the following? Number of solutions to equation, range restrictions per variable

If so, how would Mick A's answer be extended for equations of arbitrary lengths of the left-hand side? How could this be solved for programmatically?

EDIT: My thoughts are that we calculate $S$ and then subtract $S_1, S_2, ..., S_n$ from it, after which we add all intersections $S_1 \cap S_2, ...$ and then we subtract all "three-way intersections" $S_1 \cap S_2 \cap S_3, ... $ and then we add all the "four-way intersections" $S_1 \cap S_2 \cap S_3 \cap S_4,...$

Is this a correct approach?

added 350 characters in body
Source Link
Loading
Source Link
Loading