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

  • Thread starter Thread starter xeon123
  • Start date Start date
  • Tags Tags
    Partition
Click For Summary
To calculate partitions for a set of numbers, the formula involves dividing the total number of elements, n, by the number of desired partitions, m. If m evenly divides n, each partition will contain a sequence of numbers, with the kth subset containing numbers from (k-1)m+1 to km. If m does not evenly divide n, the largest integer less than or equal to n/m will determine the number of complete subsets, with one additional subset for any remaining numbers. A practical approach is using the INT function in spreadsheets, where INT(N/p) gives the partition number for a number N. This method effectively categorizes numbers into their respective partitions based on their values.
xeon123
Messages
90
Reaction score
0
I've a set of N 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 \lfloor n/m\rfloor be the largest integer less than or equal to m/n. There will be \lfloor n/m\rfloor 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 n- m\lfloor n/m\rfloor 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
 
Here is a little puzzle from the book 100 Geometric Games by Pierre Berloquin. The side of a small square is one meter long and the side of a larger square one and a half meters long. One vertex of the large square is at the center of the small square. The side of the large square cuts two sides of the small square into one- third parts and two-thirds parts. What is the area where the squares overlap?

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
5
Views
3K
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K