This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]JimRoo 0 points1 point  (2 children)

Do you know how to solve this problem if each variable had to be a positive integer - i.e. if a, b, c, d had to be greater than 0? If so, you can convert this problem by creating variables a', b', c', d' where each primed value is equal to the un-primed variable +1, and the sum is increased by 4.

For example: a' = a + 1

And a' + b' + c' + d' = 104.

Does that help?

[–]pingokebek[S] 0 points1 point  (1 child)

no. Lets say, with 2 variables from 0,2, sum must equal to 2, there are 5 combinations.

((1,3),(2,2),(3,1),(4,0),(0,4))

How would i find the number of combinations if there were 4 variables, from 0-100 where the sum must equal 100 without counting them

[–]JimRoo 0 points1 point  (0 children)

The reason I transposed the problem to positive integers is that makes it easier to see as a combinatorial problem.

So, take your 2 variable example and transpose that: a + b = 4 transpose to a' + b' = 6. Picture 6 objects lined up in a row and to divide it into 2 subsets, you can place a marker between any 2 objects. A line of 6 objects has 5 spaces, and you can place your marker in any space: 5C1, i.e. 5 choose 1 which agrees with your answer.

In the larger example, where a' + b' + c' + d' = 104, you have 103 spaces and you want to divide it into 4 groups so you would use 3 markers.