Is there a better way to find the number of integer solutions

  • Thread starter Thread starter Rijad Hadzic
  • Start date Start date
  • Tags Tags
    Integer
Click For Summary

Homework Help Overview

The discussion revolves around finding the number of integer solutions to the equation x1 + x2 + x3 + x4 = 32, with the constraints that x1, x2, and x3 are positive integers and x4 is a positive integer less than or equal to 25. Participants explore various methods to approach this combinatorial problem.

Discussion Character

  • Exploratory, Assumption checking, Mathematical reasoning

Approaches and Questions Raised

  • Participants discuss the method of using combinatorial counting to determine the number of solutions, with some suggesting the original poster's approach is valid but may lack clarity. There are questions about the consistency of the values used in the calculations, particularly regarding the total sum and the constraints on x4.

Discussion Status

The discussion is ongoing, with some participants providing insights into the combinatorial reasoning behind the problem. There is recognition of potential errors in the original poster's calculations, and suggestions for clearer presentation of the method. Multiple interpretations of the constraints are being explored.

Contextual Notes

There are discussions about the implications of the constraints on x4, particularly whether it is less than or equal to 25 or strictly less than 25, which affects the counting of solutions. Some participants also note the need for clarity in the representation of the variables involved in the equation.

Rijad Hadzic
Messages
321
Reaction score
20

Homework Statement


# of integer solutions of x1+x2+x3+x4 = 32

where x1,x2,x3>0 and 0<x4≤25

Homework Equations

The Attempt at a Solution


So in the case where x4 = 25 we have

x1+x2+x3= 4

in the case where x4 = 24 we have

x1+x2+x3 = 5

...

in the case where x4 = 1 we have

x1+x2+x3 = 28so we can do x1+x2+x3+x4 = 28

which will give us f = 31!/3!28!
now we subtract f - g where g =

x1+x2+x3 < 4

(31!/(3!28!)) - (6!/(3!3!))

= 4475

The answer is correct but I don't know if my method is a good one. Can anyone let me know?
 
  • Like
Likes   Reactions: Charles Link
Physics news on Phys.org
That should be by far the easiest approach.
Rijad Hadzic said:
which will give us f = 31!/3!28!
To motivate this a bit (not for you, but for other readers): Imagine 28 written as 28 "1"s with three separators to form four groups: 111|11||11111111111111111111111. Now let x1 be the size of the first group plus one, x2 be the size of the second group plus one and so on. My example corresponds to 32 = 4+3+1+24. There is a one to one relation between the sums and the 1/separator strings. There are (31 choose 3) options for the places of the separators. This is the total number of ways to write 32 as sum of four positive integers. Afterwards the ways with x4>25 are subtracted.
 
  • Like
Likes   Reactions: Charles Link
OP, your post doesn't make sense. First it is 32, then it is 28. Which is it? Also I get a different answer: 4460 (no, it is 4475, I thought x4 < 25). You'll need to be much more clear before I give any further information about my method.
 
The OP apparently is doing the case of 28, but I think he is also doing ## x_4<25 ##. If it is ## x_4 \leq 25 ##, the second term should be ## \frac{5!}{2! \, 3!} ## because the term that would be subtracted is the number of ways that ## x_1+x_2+x_3 ## can be 2 or less.
 
Let's check the excluded cases individually:
x4=26 gives x1+x2+x3=6 which has just the options 1+1+4, 1+2+3, 2+2+2 and permutations of it (total: 3+6+1=10).
x4=27 gives x1+x2+x3=5 which has just the options 1+1+3, 1+2+2 and permutations of it (total: 3+3=6).
x4=28 gives x1+x2+x3=4 which has just the option 1+1+2 and permutations of it (total: 3).
x4=29 gives x1+x2+x3=3 which has just the option 1+1+1 (total: 1).

-> we have to subtract 20. Or (6 choose 3) as can be derived in the same way as the (31 choose 3). This time we are interested in the number of ways x1+x2+x3 ≤ 6, or x1+x2+x3+y ≤ 7 with a positive y to get the same situation as before. The answer in post 1 is correct.
 
  • Like
Likes   Reactions: Charles Link
My mistake. I was working it with ## x1,x2,x3,x4 \geq 0 ##, (instead of ## >0 ##). ## \\ ## Additional comment: In his solution in the original post, I think the OP changed what ## x1,x2, ## and ## x3 ## represent. He is letting them be additional amounts that get added to the group which are already assumed to have one unit in them. The OP has a very good solution, but I don't think he presented his solution as clearly as he could have.
 
Last edited:

Similar threads

  • · Replies 9 ·
Replies
9
Views
3K
Replies
10
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 15 ·
Replies
15
Views
2K
Replies
2
Views
2K
Replies
3
Views
2K
Replies
7
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 24 ·
Replies
24
Views
3K