CombinatorialCase011: Difference between revisions
From NARS2000
Jump to navigationJump to search
(Created page with "This case produces <apll>L</apll> multicombinations of <apll>R</apll> items. A multicombination is a collection of Multisets (sets which may contain repeated elements) ac...") |
No edit summary |
||
Line 1: | Line 1: | ||
This case produces <apll>L</apll> | This case produces <apll>L</apll> '''Multicombinations''' of <apll>R</apll> items. A multicombination is a collection of [[Multisets]] (sets which may contain repeated elements) according to certain criteria. In particular, it produces a matrix whose rows are multisets of length <apll>L</apll>, from the values <apll>⍳R</apll>. | ||
* <apll>L</apll> unlabeled balls (0), <apll>R</apll> labeled boxes (1), any # balls per box (1) | * <apll>L</apll> unlabeled balls (0), <apll>R</apll> labeled boxes (1), any # balls per box (1) |
Revision as of 17:39, 29 April 2017
This case produces L Multicombinations of R items. A multicombination is a collection of Multisets (sets which may contain repeated elements) according to certain criteria. In particular, it produces a matrix whose rows are multisets of length L, from the values ⍳R.
- L unlabeled balls (0), R labeled boxes (1), any # balls per box (1)
- Sensitive to ⎕IO
- Counted result is an integer scalar
- Generated result is an integer matrix.
The count for this function is L!L+R-1.
For example:
If we have 2 unlabeled balls (●●) and 3 labeled boxes (123) with any # of balls per box, there are 6 (↔ 2!2+3-1) ways to meet these criteria:
|
|
|
|
|
|
The diagram above corresponds to:
011 1‼2 3 1 1 1 2 1 3 2 2 2 3 3 3 ⍝ L Multicombinations of R items ⍝ Unlabeled balls, labeled boxes, any #bpb 011 1‼3 3 1 1 1 1 1 2 1 1 3 1 2 2 1 2 3 1 3 3 2 2 2 2 2 3 2 3 3 3 3 3 011 1‼3 2 1 1 1 1 1 2 1 2 2 2 2 2 011 1‼3 1 1 1 1
In general, this case is related to that of Combinations (010) via the following identities:
010 1‼L R ↔ (011 1‼L,R-L-1)+[⎕IO+1] 0..L-1 011 1‼L R ↔ (010 1‼L,L+R-1)-[⎕IO+1] 0..L-1