Editing
CombinatorialCase112
From NARS2000
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
This case produces '''Partitions of the set <apll>{⍳M}</apll> into <apll>N</apll> ordered parts'''. Essentially, this case is the same as [[CombinatorialCase102|<apll>102</apll>]], except that the order of the elements is important so that there are more results by a factor of <apll>!N</apll>. For example, the 3-subset result of <apll>1 2|3|4</apll> for [[CombinatorialCase102|<apll>102</apll>]] is expanded to <apll>!4</apll> (<apll>↔ 24</apll>) 3-subsets by permuting the values <apll>1 2 3 4</apll> in <apll>24</apll> ways. * <apll>M</apll> labeled balls (1), <apll>N</apll> labeled boxes (1), at least one ball per box (2) * Sensitive to <apll>⎕IO</apll> * Counted result is an integer scalar * Generated result is a nested vector of nested integer vectors. The count for this function is <apll>(!N)×M SN2 N</apll> where <apll>M SN2 N</apll> calculates the [https://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind Stirling numbers of the 2<sup>nd</sup> kind].. For example: If we have 4 labeled balls (❶❷❸❹) and 2 labeled boxes (<apll>12</apll>) with at least one ball per box, there are <apll>14</apll> (<apll>↔ (!2)×4 SN2 2 ↔ 2×7</apll>) ways to meet these criteria: {| border="0" cellpadding="5" cellspacing="0" | {| border="1" cellpadding="5" cellspacing="0" |valign="bottom"|❶<br />❷<br />❸ |valign="bottom"|❹ |- | | |} | {| border="1" cellpadding="5" cellspacing="0" |valign="bottom"|❹ |valign="bottom"|❶<br />❷<br />❸ |- | | |} | {| border="1" cellpadding="5" cellspacing="0" |valign="bottom"|❶<br />❷<br />❹ |valign="bottom"|❸ |- | | |} | {| border="1" cellpadding="5" cellspacing="0" |valign="bottom"|❸ |valign="bottom"|❶<br />❷<br />❹ |- | | |} | {| border="1" cellpadding="5" cellspacing="0" |valign="bottom"|<br />❶<br />❷ |valign="bottom"|❸<br />❹ |- | | |} | {| border="1" cellpadding="5" cellspacing="0" |valign="bottom"|<br />❸<br />❹ |valign="bottom"|❶<br />❷ |- | | |} | {| border="1" cellpadding="5" cellspacing="0" |valign="bottom"|❶<br />❸<br />❹ |valign="bottom"|❷ |- | | |} |} {| border="0" cellpadding="5" cellspacing="0" | {| border="1" cellpadding="5" cellspacing="0" |valign="bottom"|❷ |valign="bottom"|❶<br />❸<br />❹ |- | | |} | {| border="1" cellpadding="5" cellspacing="0" |valign="bottom"|❶<br />❸ |valign="bottom"|<br />❷<br />❹ |- | | |} | {| border="1" cellpadding="5" cellspacing="0" |valign="bottom"|<br />❷<br />❹ |valign="bottom"|❶<br />❸ |- | | |} | {| border="1" cellpadding="5" cellspacing="0" |valign="bottom"|❶<br />❹ |valign="bottom"|<br />❷<br />❸ |- | | |} | {| border="1" cellpadding="5" cellspacing="0" |valign="bottom"|<br />❷<br />❸ |valign="bottom"|❶<br />❹ |- | | |} | {| border="1" cellpadding="5" cellspacing="0" |valign="bottom"|❶ |valign="bottom"|❷<br />❸<br />❹ |- | | |} | {| border="1" cellpadding="5" cellspacing="0" |valign="bottom"|❷<br />❸<br />❹ |valign="bottom"|❶ |- | | |} |} The diagram above corresponds to the nested array <pre> ⍪112 1‼4 2 1 2 3 4 4 1 2 3 1 2 4 3 3 1 2 4 1 2 3 4 3 4 1 2 1 3 4 2 2 1 3 4 1 3 2 4 2 4 1 3 1 4 2 3 2 3 1 4 1 2 3 4 2 3 4 1 ⍝ Partitions of the set {⍳M} into ⍝ N ordered parts ⍝ Labeled balls & boxes, any # Balls per Box ⍪112 1‼3 3 1 2 3 2 1 3 2 3 1 1 3 2 3 1 2 3 2 1 ⍪112 1‼3 2 1 2 3 3 1 2 1 3 2 2 1 3 1 2 3 2 3 1 ⍪112 1‼3 1 1 2 3 </pre> In general, this case is equivalent to calculating the unlabeled boxes ([[CombinatorialCase102|<apll>102</apll>]]) and then permuting the items from that result as in <pre> a←⊃102 1‼M N b← 110 1‼N N 112 1‼M N ↔ ,⊂[⎕IO+2] a[;b] </pre> or vice-versa <pre> 102 1‼M N ↔ {(2≢/¯1,(⊂¨⍋¨⍵)⌷¨⍵)/⍵} 112 1‼N N </pre>
Summary:
Please note that all contributions to NARS2000 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
NARS2000:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
Edit source
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Tools
What links here
Related changes
Special pages
Page information