What is the formula for calculating partitions for a given set of numbers?

  • Level: High School 
  • Thread starter Thread starter xeon123
  • Start date Start date
  • Tags Tags
    Partition
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
4 replies · 2K views
xeon123
Messages
90
Reaction score
0
I've a set of [itex]N[/itex] numbers with n size, and I want to find to each partition they belong. E.g., a set with numbers from 1 to 210, with 3 partitions. So, the numbers from 1 to 70 goes to partition 1, from 71 to 140 goes to partition 2, and from 141 to 210 goes to partition 3. How can I calculate this?

Thanks,
 
Mathematics news on Phys.org
A "partition" of a set is any collection of subsets such that each member of the set belongs to one and only one of the subsets. But you seem to be thinking of something much more specific- you want a partition in which every subset (except possibly one) contains a sequence of numbers from the set: 1 to m, in one subset, m+1 to 2m in another, etc. Is that correct?

In that case it is very simple: to partition a set with n members into m such subsets:
1) if m evenly divides n, as in the example given, there will be n/m subsets, the first containing 1 through m, the second m+1 through 2m, etc. n That is, the kth subset contains (k-1)m+ 1 through km.

2) if m does not evenly divide m, let [itex]\lfloor n/m\rfloor[/itex] be the largest integer less than or equal to m/n. There will be [itex]\lfloor n/m\rfloor[/itex] subsets containing exactly m members of the set, again, the kth such subset containing (k-1)m+1 through km, and one additional set with only the last [itex]n- m\lfloor n/m\rfloor[/itex] members.
 
But I want the an equation that gives me the partition number. E.g.,
1*(something)=1
2*(something)=1
...
69*(something)=1
70*(something)=1
71*(something)=2
...
139*(something)=2
140*(something)=2
141*(something)=3
...
210*(something)=3
 
I think the solution is:

If I put the values in a matrix, row 0 goes from 1 to m, row1 goes from m+1 to 2m, etc... So let me define the variables,
n is a number from 1 to 210
i is the number of the column
j is the number of the row
m is the number of partitions
p is the size of the partition (n/m)

So, n=i*p+j

Is it correct?
 
Here's a slight variation on your setup. Instead of the integers 1, 2, ..., 210, let's say you have 0, 1, 2, ..., 209. You still have 210 numbers. Also, instead of having partition 1, 2, and 3, let's number them 0, 1, and 2.

The first partition will be 0, 1, ..., 69
The second will be 70, 71, ..., 139
The third will be 140, 141, ..., 209

If N is a number in your list, then INT(N/70) will evaluate to 0, 1, or 2, with INT being a function in Excel and other spreadsheets.
Some examples.
1. N = 37
INT(37/70) = 0

2. N = 75
INT(75/70) = 1

3. N = 70
INT(70/70) = 1

4. N = 208
INT(208/70) = 2