Talk:Twelvefold way

Multisets
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)


 * It's a multiset. /P¤ntus 14:02, 8 November 2007 (UTC)

Intermediate partition function
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) Finn

Bijective?
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)


 * 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)


 * 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)

I do see that the article clearly states "one of the following" but I missed that on my first reading.Ngvrnd (talk) 12:26, 11 September 2014 (UTC)

Suggestions
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: 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).
 * 1) No condition: each $$a$$ in $$N$$ may be sent by $$f$$ to any $$b$$ in $$X$$, and each $$b$$ may occur multiple times.
 * 2) $$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$$.
 * 3) $$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$$.

There are four different equivalence relations which may be defined on the set of functions $$f$$ from $$N$$ to $$X$$: Any of these equivalence relations produces a decomposition of the set of functions into equivalence classes.
 * 1) equality;
 * 2) equality up to a permutation of $$N$$;
 * 3) equality up to a permutation of $$X$$;
 * 4) equality up to permutations of $$N$$ and $$X$$.

(An equivalence class is the orbit of a function $$f$$ under the group action considered: f, or f ∘ Sn, or Sx ∘ f, or Sx ∘ f ∘ Sn, where Sn is the symmetric group of N, and Sx is the symmetric group of X.)

The 3 conditions on the functions and the 4 equivalence relations can be paired in 3 &times; 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). &rarr; 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. &rarr; 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!}.$$

&rarr; 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: &rarr; 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. &rarr; probably needs some straightening out.

Another table?
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)


 * 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)

Hello JBL, thank you for your feedback, I did it the way you suggested. Herbmuell (talk) 06:07, 16 July 2015 (UTC)

Update: I finally merged the two tables (that was 2 years ago). Just now I did a few small edits in the article and also on this talk page (my own stuff only, of course), in the hope that it's getting clearer what was going on. --Herbmuell (talk) 03:16, 29 June 2017 (UTC)

Possibly reorder subsections in "Details of different cases" section?
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)

Twelvefold way#Generalizations ...
In last table there are references Twelvefold way#Generalizations ..., but they are not defined in text... Jumpow (talk) 10:15, 15 November 2018 (UTC)


 * What is not defined in the text that should be? --JBL (talk) 12:27, 15 November 2018 (UTC)

Too technical
Combinations and permutations redirects here; this article should be explaining the difference in a way that's understandable to a high school audience. That audience is lost from the first line of the overview, which is currently: "Let n = | N | {\displaystyle n=|N|} n=|N| and x = | X | {\displaystyle x=|X|} x=|X| be the cardinality of the sets. Thus N is an n-set, and X is an x-set." And personally even having taken a math class from Rota, I find this way of explaining to be overly heavy with math jargon. It would be a lot more accessible if the difference between combinations and permutations, and the other ten things, was done using the ball example. It's fine if all the math stuff is repeated later on or included as an aside. -- Beland (talk) 23:45, 9 March 2019 (UTC)


 * I’ve been bold and changed the redirect page into my first disambiguation page (my first!) Maybe this fixes the issue in some way? Please feel free to improve the disambiguation page or let me know what is to be done; I’m learning…


 * I understand that this article itself needs simplification as well, but at least people looking for "combinations and permutations" won’t land in this baffling article by default anymore.--Geke (talk) 16:19, 5 January 2020 (UTC)


 * That seems like a pretty good solution, but (predictably?) it didn't last long :/. --JBL (talk) 16:38, 5 January 2020 (UTC)


 * Yeah, this is ridiculous. I've done a technical university but I don't have the know how to read this. You shouldn't have to be a career mathematician to understand permutations. — Preceding unsigned comment added by Hvm2hvm (talk • contribs) 20:06, 14 December 2020 (UTC)

Perhaps this particular viewpoint and systematic presentation is rather technical. (I'm not saying that it's impossible to make it more accessible, but rather that the more accessible presentations do not (perhaps with good reason) synthesize all the stuff as "the twelvefold way". The two problems relating to stars and bars have their own article, which is rather accessible. Perhaps the solution is just writing more articles about specific problems and viewpoints, which can be made "standard accessible". Is "balls and bins" a separate article? -St.nerol (talk) 16:13, 11 October 2021 (UTC)

Sorting and renumbering method seems wrong?
It is explained in the article that equivalence under permutations of both $N$ and $X$ 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)


 * 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)
 * 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)
 * Which section specifically are you talking about? --JBL (talk) 21:59, 12 February 2021 (UTC)
 * Twelvefold way -- Plisdku (talk) 22:55, 12 February 2021 (UTC)
 * 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)