Alex Joannou

30 Reputation

5 Badges

16 years, 147 days

MaplePrimes Activity


These are answers submitted by Alex Joannou

The commands in Maple are:

Count (Partition (n) ) This gives you the number of all possible partitions of the integer n (all sizes of non empty sets).

For example : if you use the command: Count (Partition (10) ) the system will return the answer 42.

If you want to list the partitions: first you have to call the command: with (combstruct). This will allow you to list.

Then use the command : allstructs (Partition (10)) . This will list all the partition sets each of which sums to 10. 42 sets.

You can also specify the size k of the partition sets.

The command is : Count ( Partition (n) , size= k ) . For example:

Count ( Partition (10) , size= 5 ) will return 7 which is the number of size 5 partition sets of integer 10.

If you want to list the sets use the command :  allstructs (Partition (10) , size = 5). This will list the 7 partition sets of the count.

 

Hope this helps

 

Page 1 of 1