Partition a Number n into k Parts: 7 Possible Solutions

  • Context: Undergrad 
  • Thread starter Thread starter ziad1985
  • Start date Start date
  • Tags Tags
    Partition
Click For Summary

Discussion Overview

The discussion revolves around the problem of partitioning a number n into k parts, specifically focusing on the case of partitioning the number 9 into 3 non-zero parts. Participants explore the mathematical implications of this partitioning, including the discrepancies between combinatorial calculations and actual outcomes.

Discussion Character

  • Exploratory
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant suggests that partitioning a number n into k parts is akin to combinations with repetition, but notes that the combinatorial formula C(n-1, n-k) does not yield the expected number of partitions.
  • Another participant points out that partitioning 9 into 3 positive parts can be transformed into partitioning 6 into 3 nonnegative parts, referencing a specific sequence for further context.
  • A participant expresses confusion regarding the nature of the problem, asserting that the actual number of distinct partitions is 7, not 28, and seeks clarification on the terminology used.
  • One participant emphasizes that certain permutations of the same partition (e.g., (1,1,7), (1,7,1), and (7,1,1)) should be considered identical due to the context of the problem, and notes the addition constraint involved.
  • Another participant mentions a generalized version of the problem that allows for partitioning into N parts, suggesting that it may have interesting properties as well.
  • One participant inquires about resources for further information on the topic.
  • A participant shares a code snippet and questions the programming language used, leading to a response identifying it as QBasic.

Areas of Agreement / Disagreement

Participants express differing views on the correct number of partitions and the applicability of combinatorial methods, indicating that multiple competing perspectives remain unresolved.

Contextual Notes

Participants highlight the importance of considering the constraints of non-zero parts and the identity of permutations in their calculations, which complicates the application of standard combinatorial formulas.

ziad1985
Messages
244
Reaction score
0
I want to partition a number n into k parts
for example 9 into 3 parts
x+y+z=9
and each element must be non zero , first look tells me it's combination with repetition.
however C(n-1,n-k) doesn't give the same number of possibilities when trying all of them.
x+y+z=9 C(8,6)=28
while trying them give only 7 possibilities
(7,1,1) (6,2,1) (5,2,2) (5,3,1) (4,4,1) (4,3,2) (3,3,3)
(1,7,1) is the same as (1,1,7) and (7,1,1) this small condition is changing the outcome , what kind of problem is this called ?
 
Physics news on Phys.org
ziad1985 said:
I want to partition a number n into k parts
for example 9 into 3 parts
x+y+z=9
and each element must be non zero , first look tells me it's combination with repetition.

9 into 3 positive parts, is the same as 6 into 3 nonnegative parts, which is http://www.research.att.com/~njas/sequences/A038505 (6) = 28. I don't know a term for this better than "partitioning".
 
Last edited by a moderator:
first thing , i didn't quiet understand what this is , plus i already stated that the number actually is 7 not 28.
any help with what I'm dealing with here?
 
if you really "partitioning" that I believe that (1,1,7), (1,7,1) and (7,1,1) are identical in this context. nCr doesn't work because you have an addition constraint namely, x+y+z=constant. There is also a generalised version of this problem where you partition a number into[tex]N[/tex] parts (not just 3) where [tex]N\geq 1[/tex]. more interesting properties will ensure there too.
 
where i can i find more info regarding this ?
 
already find some stuff , but one question , in what language is this program written in?
INPUT m
DIM a(m),p(m)
FOR i = 0 TO m: p(i) = 1: NEXT i

FOR u = 2 TO m
FOR i = 0 TO m: a(i) = p(i): p(i) = 0: NEXT i
FOR j = 0 TO m STEP u
FOR k = j TO m
p(k) = p(k) + a(k-j)
NEXT k
NEXT j
NEXT u

REM
 
I think it looks like qbasic
 

Similar threads

  • · Replies 29 ·
Replies
29
Views
6K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 18 ·
Replies
18
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
Replies
4
Views
2K
  • · Replies 66 ·
3
Replies
66
Views
8K
  • · Replies 0 ·
Replies
0
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 61 ·
3
Replies
61
Views
12K