CombinatorialCase111: Difference between revisions
From NARS2000
Jump to navigationJump to search
(Created page with "This case produces <apll>L</apll>-'''Tuples''' of <apll>R</apll> items. That is, all length <apll>L</apll> vectors with all possibilities of <apll>R</apll> items in each posi...") |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
This case produces <apll> | This case produces '''<apll>M</apll>-Tuples of <apll>N</apll> items'''. That is, all length <apll>M</apll> vectors with all possibilities of <apll>N</apll> items in each position, <apll>N*M</apll> rows all together. | ||
* <apll> | * <apll>M</apll> labeled balls (1), <apll>N</apll> labeled boxes (1), any # balls per box (1) | ||
* Sensitive to <apll>⎕IO</apll> | * Sensitive to <apll>⎕IO</apll> | ||
* Allows Lexicographic order | |||
* Counted result is an integer scalar | * Counted result is an integer scalar | ||
* Generated result is an integer matrix. | * Generated result is an integer matrix. | ||
The count for this function is <apll> | The count for this function is <apll>N<sup>M</sup></apll> (<apll>↔ N*M</apll>). | ||
For example: | For example: | ||
Line 108: | Line 109: | ||
<pre> | <pre> | ||
111 1‼2 3 ⍝ Tuples in unspecified order | |||
1 1 | 1 1 | ||
1 2 | 1 2 | ||
Line 118: | Line 119: | ||
3 2 | 3 2 | ||
3 3 | 3 3 | ||
⍝ | 111 2‼2 3 ⍝ Tuples in Lexicographic order | ||
⍝ Labeled balls & boxes, any # | 1 1 | ||
1 2 | |||
1 3 | |||
2 1 | |||
2 2 | |||
2 3 | |||
3 1 | |||
3 2 | |||
3 3 | |||
111 3‼2 3 ⍝ Gray Code order for Tuples not implemented as yet | |||
NONCE ERROR | |||
111 3‼2 3 | |||
∧ | |||
⍝ M-tuples of N items | |||
⍝ Labeled balls & boxes, any # Balls per Box | |||
111 0‼3 2 | 111 0‼3 2 | ||
8 | 8 |
Latest revision as of 16:47, 21 October 2017
This case produces M-Tuples of N items. That is, all length M vectors with all possibilities of N items in each position, N*M rows all together.
- M labeled balls (1), N labeled boxes (1), any # balls per box (1)
- Sensitive to ⎕IO
- Allows Lexicographic order
- Counted result is an integer scalar
- Generated result is an integer matrix.
The count for this function is NM (↔ N*M).
For example:
If we have 2 labeled balls (❶❷) and 3 labeled boxes (123) with any # of balls per box, there are 9 (↔ 3*2) ways to meet these criteria:
|
|
|
|
|
|
|
|
|
The diagram above corresponds to
111 1‼2 3 ⍝ Tuples in unspecified order 1 1 1 2 1 3 2 1 2 2 2 3 3 1 3 2 3 3 111 2‼2 3 ⍝ Tuples in Lexicographic order 1 1 1 2 1 3 2 1 2 2 2 3 3 1 3 2 3 3 111 3‼2 3 ⍝ Gray Code order for Tuples not implemented as yet NONCE ERROR 111 3‼2 3 ∧ ⍝ M-tuples of N items ⍝ Labeled balls & boxes, any # Balls per Box 111 0‼3 2 8 111 1‼3 2 1 1 1 1 1 2 1 2 1 1 2 2 2 1 1 2 1 2 2 2 1 2 2 2