Talk:Twelvefold way

message: I see that a permutation is an ordered selection with out repetition (injective) and a combination is an unordered selection with out repetition (injective).  What is an unordered selection with repetition (non-injective) called?  Is there an article for that? WilliamKF 15:48, 5 October 2007 (UTC)
replies: text: It's a multiset. /P¤ntus 14:02, 8 November 2007 (UTC)
thread_title:  Multisets 

message: If I understand the description under "Surjective functions from N to X, up to permutations of N and X" correctly, p_k(n) is different from the "Intermediate function" p(k, n) found on the Partition page. Does anyone have a formula for p_k(n)?
80.212.102.205 (talk) 22:24, 22 June 2010 (UTC)
thread_title:  Intermediate partition function 

message: The following sentence from the article seems incorrect to me:
"A possible fourth condition of being bijective is not included, since the set of such functions will be empty unless n=x, in which case the condition is equivalent both to being injective and to being surjective; therefore considering this condition would not add any interesting problems."
in that "being bijective" is not a "possible fourth condition", it is implied by requiring 'f' to be both injective and surjective.  I propose to delete this sentence from the article, but because I know I may be missing something, I'm asking about it here first. Ngvrnd (talk) 19:03, 10 September 2014 (UTC)
replies: text: That bijectivity is equivalent to injectivity + surjectivity is true, but this fact in isolation does not have implications for counting bijective functions.  (In general, knowing the sizes of two subsets of a set does not determine the size of their intersection.)  The quoted sentence, which is correct if not incredibly elegant, makes the more relevant operation that in the cases when the number of bijective functions is nonzero, the enumeration reduces to the enumeration of the injective (or, equivalently, surjective) functions. --JBL (talk) 19:19, 10 September 2014 (UTC)
replies: text:  Ah, ok.  Thank you for your response.  I see my mistake.  There might be two disjoint sets of functions which are themselves surjective, or injective, but none of which are bijective.  I had read the conditions as applying to all 'f', not as categorizing them. I think the article would benefit from clarification of this point, although I do not have a proposal for a clarification. Ngvrnd (talk) 12:14, 11 September 2014 (UTC)
thread_title:  Bijective? 

message: Dear main authors;
first of all: congratulations, you did a very good job in organizing the extensive material of this article. 
I have a few suggestions on how to improve the article. Pick what you like. Any feedback or discussion is welcome.
=== Section "Overview" ===
Let N and X be finite sets. Let n=|N| and x=|X| be the cardinality of the sets. Thus N is an n-set, and X is an x-set. 
The general problem we consider is the enumeration of equivalence classes of functions f: N \to X.
The functions are subject to one of the three following restrictions:
# No condition: each a in N may be sent by f to any b in X, and each b may occur multiple times.
# f is injective: each value f(a) for a in N must be distinct from every other, and so each b in X may occur at most once in the image of f.
# f is surjective: for each b in X there must be at least one a in N such that f(a) = b, thus each b will occur at least once in the image of f.
A possible fourth condition of f being bijective is not included, since it doesn't add any new problems (the set of such functions will be empty unless n=x, in which case the condition is equivalent to f being both injective and surjective).
There are four different equivalence relations which may be defined on the set of functions f from N to X:
# equality;
# equality up to a permutation of N;
# equality up to a permutation of X;
# equality up to permutations of N and X.
Any of these equivalence relations produces a decomposition of the set of functions into equivalence classes. 
(An equivalence class is the orbit of a function f under the group action considered: , or , or , or , where  is the symmetric group of N, and  is the symmetric group of X.)
The 3 conditions on the functions and the 4 equivalence relations can be paired in 3 × 4 = 12 ways.
The 12 problems of counting equivalence classes of functions do not involve the same difficulties, and there is not one systematic method for solving them. 2 of the problems are trivial (the number of equivalence classes is 0 or 1), 5 problems have an answer in terms of a multiplicative formula of n and x, and the remaining 5 problems have an answer in terms of combinatorial functions (Stirling numbers and the partition function for a given number of parts).
=== Small stuff ===
Now:
This case is equivalent to counting multisets with n elements (also called n-multicombinations) of elements from X. 
Suggestion:
This case is equivalent to counting multisets with n elements from X (also called n-multicombinations).  
→ highlight only one name.
Now:
This case is equivalent to counting partitions of N into x (non-empty) subsets, or counting equivalence relations on N with exactly x classes. 
Suggestion:
This case is equivalent to counting partitions of N into x (non-empty) subsets, or counting equivalence relations on N with exactly x classes.   
→ highlight only one name.
Now:
This case is equivalent to counting multisets with n elements of elements from X, for which each element of X occurs at least once.  
Suggestion:
This case is equivalent to counting multisets with n elements from X, for which each element of X occurs at least once.
Now:
:  \binom{x+n-1}n = \frac{(x+n-1)(x+n-2)\cdots(x+1)x}{n(n-1)\cdots2\cdot1} = \frac{(x+n-1)^{\underline n}}{n!}. 
Suggestion:
:  \binom{x+n-1}n = \frac{(x+n-1)(x+n-2)\cdots(x+1)x}{n(n-1)\cdots2\cdot1} = \frac{x^{\overline n}}{n!}.
→ In this case the rising factorial must be explained in the section Formulas.
Now:
compositions of n with x (non-zero) parts
Suggestion:
compositions of n with x (non-zero) terms
Now:
This case is equivalent to counting partitions of the number n into x parts with parts 0 allowed. 
Suggestion:
This case is equivalent to counting partitions of the number n into ≤ x parts. 
Now:
This case is equivalent to counting subsets of n elements of X, also called n-combinations of X:
Suggestion:
This case is equivalent to counting subsets with n elements of X, also called n-combinations of X: 
→ seems simpler to me.
Now:
The association is the same as for the previous case, including onto the partitiona part 0 for each element of X not in the image of the function. 
→ probably needs some straightening out.
=== Another table? ===
 Enumeration formulas for the twelvefold way
            	Any f                                	Injective f     	Surjective f
Distinct    	x^n\,                                	x^{\underline n}	\textstyle x!\{{n\atop x}\}\,
Sn orbits   	\binom{x+n-1}n                       	\binom xn       	\binom{n-1}{n-x}
Sx orbits   	\sum_{k=0}^x\left\{{n\atop k}\right\}	[n\leq x]       	\left\{{n\atop x}\right\}
Sn×Sx orbits	p_x(n+x)\,                           	[n\leq x]       	p_x(n)\,
 Table of the 12 combinatorial objects
	Any f                          	Injective f                     	Surjective f
	n-sequence in X                	n-permutation in X              	composition of N with x subsets
	n-multisubset of X             	n-subset of X                   	composition of n with x terms
	partition of N into ≤ x subsets	partition of N into ≤ x elements	partition of N into x subsets
	partition of n into ≤ x parts  	partition of n into ≤ x parts 1 	partition of n into x parts
The first table is in the article.
Could a second table like the one shown below be useful? Or may be the two tables could be merged?
The two entries (3,2) and (4,2) look funny, but that's part of the twelvefold way. 
Regards, Herbmuell (talk) 11:03, 13 July 2015 (UTC)
replies: text:  Broadly speaking your suggestions look reasonable to me.  I suggest you boldly go ahead and make changes, and then if anyone is unhappy we can come back and discuss them afterward.  (Maybe one small suggestion: I would write out the words "2" and "5" as "two" and "five" in the sentence "2 of the problems are trivial ..." and perhaps in similar places.)  Possibly you could do it not all as one single edit so that it's easier for others to understand what changes you've made.  --JBL (talk) 17:58, 13 July 2015 (UTC)
thread_title:  Suggestions 

message: Enumeration formulas for the twelvefold way
            	Any f                                	Injective f     	Surjective f
Distinct    	x^n\,                                	x^{\underline n}	\textstyle x!\{{n\atop x}\}\,
Sn orbits   	\binom{x+n-1}n                       	\binom xn       	\binom{n-1}{n-x}
Sx orbits   	\sum_{k=0}^x\left\{{n\atop k}\right\}	[n\leq x]       	\left\{{n\atop x}\right\}
Sn×Sx orbits	p_x(n+x)\,                           	[n\leq x]       	p_x(n)\,
 Table of the 12 combinatorial objects
	Any f                          	Injective f                     	Surjective f
	n-sequence in X                	n-permutation in X              	composition of N with x subsets
	n-multisubset of X             	n-subset of X                   	composition of n with x terms
	partition of N into ≤ x subsets	partition of N into ≤ x elements	partition of N into x subsets
	partition of n into ≤ x parts  	partition of n into ≤ x parts 1 	partition of n into x parts
The first table is in the article.
Could a second table like the one shown below be useful? Or may be the two tables could be merged?
The two entries (3,2) and (4,2) look funny, but that's part of the twelvefold way. 
Regards, Herbmuell (talk) 11:03, 13 July 2015 (UTC)
replies: text:  Broadly speaking your suggestions look reasonable to me.  I suggest you boldly go ahead and make changes, and then if anyone is unhappy we can come back and discuss them afterward.  (Maybe one small suggestion: I would write out the words "2" and "5" as "two" and "five" in the sentence "2 of the problems are trivial ..." and perhaps in similar places.)  Possibly you could do it not all as one single edit so that it's easier for others to understand what changes you've made.  --JBL (talk) 17:58, 13 July 2015 (UTC)
thread_title:  Another table? 

message: Dear frequent editors of this article:
I know that in the beginning of this section a particular justification for the order of subsections within a section is given, but nonetheless, given the fact that this section immediately follows the twelvefold table, the fact that the order is different from both the table and the "Intuitive meaning of the rows and columns" section, the section at hand is rather confusing to read. Can we collectively consider re-ordering the subsections so that they follow the same order as in the table? I can do it, but I wanted to first to obtain a consensus.
Nyq (talk) 01:04, 19 February 2018 (UTC)
thread_title:  Possibly reorder subsections in "Details of different cases" section? 

message: In last table there are references Twelvefold way#Generalizations ..., but they are not defined in text... Jumpow (talk) 10:15, 15 November 2018 (UTC)
replies: text: What is not defined in the text that should be?  --JBL (talk) 12:27, 15 November 2018 (UTC)
thread_title:  Twelvefold way#Generalizations ... 

message: It is explained in the article that equivalence under permutations of both  and  together amounts to either sorting followed by renumbering, or renumbering followed by sorting.  I am starting to believe this is wrong (after an afternoon of confused Python hacking).  Consider N = \{1,2,3\}, X = \{1, 2\}.  Then there are eight possible sequences drawn with replacement, namely A = \{ 111, 112, 121, 122, 211, 212, 221, 222 \}.  This set A is our starting point for counting.  Next, sorting the sequences in A by the item number yields S = \{ 111, 112, 122, 222 \}, which are the possible outcomes of unordered sampling.  According to the page, we expect \begin{pmatrix}x+n-1 \\ n \end{pmatrix} = C(4,3) = 4 equivalence classes, which we indeed got. Alternatively, renumbering the sequences in A yields R = \{ 111, 112, 121, 122 \}, which are said to represent the possible partitions of the integer 3 into one or two nonzero parts.  According to the page, we expect S(3,0) + S(3,1) + S(3,2) = 0 + 1 + 3 = 4 equivalence classes, which is what we got.
Next, according to the page, to get representatives of the equivalence classes under permutation of both N and X, we may either sort then renumber, or renumber then sort.  I get SR = \{111, 112, 122\} and RS = \{111, 112, 122\}; either way, I have calculated three classes.  Note, however, that 112 ought to be equivalent to 122, if I understand correctly.  So, the classes ought to be \{111, 112\}.  The table states that there ought to be p_x(n+x) = p_2(3+2) = 2 classes.  (There are indeed two integer partitions, 3 = 3 and 3 = 2 + 1.)
Perplexingly, neither sorting nor renumbering will prove that 112 \equiv 122.  Anybody know what the deal is? -- Plisdku (talk) 04:53, 12 February 2021 (UTC)
replies: text: I have not looked at the section of the article that you are referring to, but relabeling allows 112 \equiv 221 and sorting allows 221 \equiv 122 and so sorting and relabeling together allow 112 \equiv 221 \equiv 122. --JBL (talk) 14:21, 12 February 2021 (UTC)
replies: text:  Yes, a renumbering is possible which makes 112 \equiv 122, but it's not the renumbering stated in the article ("Before counting, renumber the items seen so that the first item seen has number 1, the second 2, etc.").  Is there a simple procedure that leads one to renumber 122 starting from 2 and eventually determine equivalence? -- Plisdku (talk) 20:25, 12 February 2021 (UTC)
replies: text:  Which section specifically are you talking about? --JBL (talk) 21:59, 12 February 2021 (UTC)
replies: text:  Twelvefold way#Intuitive meaning of the rows and columns -- Plisdku (talk) 22:55, 12 February 2021 (UTC)
replies: text:  Yes, you're right: the rule described in the last case is just wrong.  (Not totally shocking, given that the whole section is uncited.)  To find a canonical representative for the combined action you have to be more thoughtful.  The section was added in this edit by  in 2012 and has been substantively unchanged since.  Well. --JBL (talk) 23:21, 12 February 2021 (UTC)
thread_title:  Sorting and renumbering method seems wrong?