ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Partition + Grouping (https://www.excelbanter.com/excel-programming/386606-partition-grouping.html)

Longshot

Partition + Grouping
 
Hi All,

I'd like to have a program that calculates all the partitions of a
string as follows:

The partitions of (1, 2, 3) should be:

((1, 2, 3))
((1, 2), (3))
((1, 3), (2))
((1), (2, 3))
((1), (2), (3))

Thanks in advance,

Ram.


Dana DeLouis

Partition + Grouping
 
I'd like to have a program that calculates all the partitions

Hi. Do you have a size limit in mind?
The reason I ask is that with just 10 items, the number of "SetPartitions"
are 115,975 and exceeds the number of Rows in Excel 2003. The number of
SetPartitions of 12 items jumps to 4,213,597 and exceeds the number of rows
in Excel 2007.

--
Dana DeLouis
Windows XP & Office 2007


"Longshot" wrote in message
oups.com...
Hi All,

I'd like to have a program that calculates all the partitions of a
string as follows:

The partitions of (1, 2, 3) should be:

((1, 2, 3))
((1, 2), (3))
((1, 3), (2))
((1), (2, 3))
((1), (2), (3))

Thanks in advance,

Ram.




Longshot

Partition + Grouping
 
On Mar 31, 11:34 pm, "Dana DeLouis" wrote:
I'd like to have a program that calculates all the partitions


Hi. Do you have a size limit in mind?
The reason I ask is that with just 10 items, the number of "SetPartitions"
are 115,975 and exceeds the number of Rows in Excel 2003. The number of
SetPartitions of 12 items jumps to 4,213,597 and exceeds the number of rows
in Excel 2007.

--
Dana DeLouis
Windows XP & Office 2007


Dear Dana,

Thank you for your reply, I am aware of this limitation

In reality, I will merely use four elements.

Thanks again,

Ram.


Lori

Partition + Grouping
 
If you only have a maximum of four elements, it's probably easiest
just to list the possibilities in the top row and enter the other 14
possibilities below, referring to the first line. A pictorial
representation of this case is given in the wikipedia article:

http://en.wikipedia.org/wiki/Partition_of_a_set

Based on the recursion given for Bell's numbers, the following formula
filled down from A2 gives the total number of partitions of n elements
(with A1=1):

=SUMPRODUCT(COMBIN(COUNT($A$1:A1)-1,ROW($A$1:A1)-1),$A$1:A1)



On 2 Apr, 14:03, "Longshot" wrote:
On Mar 31, 11:34 pm, "Dana DeLouis" wrote:

I'd like to have a program that calculates all the partitions


Hi. Do you have a size limit in mind?
The reason I ask is that with just 10 items, the number of "SetPartitions"
are 115,975 and exceeds the number of Rows in Excel 2003. The number of
SetPartitions of 12 items jumps to 4,213,597 and exceeds the number of rows
in Excel 2007.


--
Dana DeLouis
Windows XP & Office 2007


Dear Dana,

Thank you for your reply, I am aware of this limitation

In reality, I will merely use four elements.

Thanks again,

Ram.





All times are GMT +1. The time now is 12:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com