Number of positive integer solutions for given equation

  • Thread starter Thread starter songoku
  • Start date Start date
  • Tags Tags
    Integer Positive
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
5 replies · 3K views
songoku
Messages
2,514
Reaction score
395

Homework Statement


Let n be an odd integer ≥ 5. Find the number of triplets (x, y, z) of positive integers which satisfy the equation
x + y + 2z = n

Homework Equations


Do not know

The Attempt at a Solution


Let n = 2k + 1, k ≥ 2

x + y + 2z = n
2z = 2k + 1 - (x + y) ≤ 2k + 1 - 2 (because x + y ≥ 2)
2z ≤ 2k - 1
Then stuck

The answer is (n - 1)(n - 3)/4

Thanks
 
Physics news on Phys.org
Sometimes these are easiest to look at with a few examples.
If n = 5, then (1,2,1) and (2,1,1) are your only choices.
If n = 7, you have more. For z = 1, you have (1,4,1), (2,3,1),(3,2,1),(4,1,1) and for z=2 you have (1,2,2),(2,1,2).
What I see is that for any z, of which you are limited in choices, you will have an appropriate number of choices for (x+y)=n-2z.

So how many options for z?
For each of those options how many choices for y do you have? Once z and y and defined, you have only one choice for x.
 
Reply
  • Like
Likes   Reactions: songoku
RUber said:
Sometimes these are easiest to look at with a few examples.
If n = 5, then (1,2,1) and (2,1,1) are your only choices.
If n = 7, you have more. For z = 1, you have (1,4,1), (2,3,1),(3,2,1),(4,1,1) and for z=2 you have (1,2,2),(2,1,2).
What I see is that for any z, of which you are limited in choices, you will have an appropriate number of choices for (x+y)=n-2z.

So how many options for z?
For each of those options how many choices for y do you have? Once z and y and defined, you have only one choice for x.

I think I get it. Thanks
 
This is a combinatorics question, not really a pre-calculus question.

Throughout, order matters and duplicates are allowed.

How many ways are there to write n as the sum of k nonnegative integers? Answer: (n+k-1) choose (k-1). Why? Place n 1s and k-1 separators.

How many ways are there to write n as the sum of k positive integers? Answer: (n-1) choose (k-1). Why? Write n-k as the sum of k nonnegative integers and then add 1 to each of them.

Assume that n is even. How many ways are there to write n as the sum of k even positive integers? Answer: (n/2 - 1) choose (k-1). Why? Write n/2 as the sum of k positive integers and then multiply each of them by 2.

Assume that n is odd. How many ways are there to write n as the sum of k positive integers where the last is even and exactly one of the others is odd? (k-1) (((n-1)/2) choose (k-1))
Why? Write n+1 as the sum of k positive even integers and then subtract 1 from one of the first k-1.

To answer your question, let k=3.
 
Reply
  • Like
Likes   Reactions: songoku
Correction: Partitions into k positive integers where order matters are actually called k-compositions. I don't know what name is given to partitions into k natural numbers where order matters.