Given a set of variables, a binary operation on is called *simple* if it satisfies for all and for all . Given a simple operation on , any string of elements in can be reduced to a single element, such as . A string of variables in is called *full* if it contains each variable in at least once, and two strings are *equivalent* if they evaluate to the same variable regardless of which simple is chosen. For example, , , and are equivalent, but these are only full if . Suppose is a set of strings such that any full string is equivalent to exactly one element of . Determine the number of elements of .
(This problem was suggested by John Berman.)
Problem 1923
Official solution
Solution 1. The answer is .
We use to denote that strings and are equivalent. If is any string in , we can see that
because . But also, if are strings in and , then
To prove this, it suffices to show that . Suppose that for some , these did not evaluate to the same element of . Then , since otherwise . Similarly, . This means that
so by assumption . But if , then in particular , , and all must hold, the latter of which is a contradiction. Similarly if we reach a contradiction. Thus this equivalence holds.
Given any full string , we claim that it is equivalent to some string consisting of two concatenated permutations of , i.e. where is a permutation of the variables of and is also. Note that . This string may be reduced by our second observation above so that in any case where an element appears more than two times, all but the outermost instances of are removed. Because was full, the new string will have each element of occurring exactly twice. But the first occurrences of each variable all occur in the first instance of , and the last occurrences all occur in the second instance of (in ), so consists of two concatenated permutations of , of which there are possibilities.
It remains to show that two double-permutations and are not equivalent. Suppose otherwise. Without loss of generality we may assume that ; otherwise we reverse the order of the operation found below. Choose two elements such that occurs before in but their order is reversed in . Then choose some operation such that for any ,
This operation clearly satisfies , and some easy casework on which of are in shows that for all . Hence, the operation is simple. Furthermore evaluates to under this operation, while evaluates to . We conclude that the two strings are not equivalent, finishing the solution.
Solution 2 (Based on an idea of Alex Zhai). Given an operation , construct a complete directed graph with vertices, each vertex corresponding to a variable of . Construct an edge marked going from to if , and an edge marked from to if . In this way each pair of vertices will have two edges between them, either both going in the same direction or both having the same marking.
Suppose we have an edge from to marked and an edge from to marked . Through some simple casework on and use of the associative condition on , we can verify this implies there is an edge from to marked . Call this the *associativity condition* on .
Now suppose two vertices are such that there are two edges from to , one and one . We claim this means there is no path from to . Suppose that were such a path. Then the associativity condition on means that has two edges marked and from to . Through the same methods we can inductively show that the two edges between to are directed away from for all . But we need an edge from to , so this is a contradiction.
Consider the strongly connected components of , meaning components such that a pair of vertices has a path from to and a path from to if and only if are in the same component. The above paragraph implies that for any in the same component, the two edges between go in opposite directions and have the same marking. The associativity condition implies the markings between all pairs of vertices in the same component are equal, so we can consider each component to be either as a whole or as a whole.
Let be the component such that no other component has an edge going into , and call this the top component of . Then by the way we have constructed the graph, any full expression evaluates to a variable corresponding to a vertex in under . Since all the edges in are either or , the value of the full expression is either the leftmost variable out of those appearing in , or the rightmost variable. In this way, we have completely characterized how a full expression can be evaluated under a simple operation : take a nonempty subset of the variables, then evaluates the expression to either the leftmost occurrence of a variable in , or the rightmost occurrence of a variable in .
From here the problem is straightforward to finish. Given a full expression , consider only the leftmost occurrence of each variable in . This gives a permutation of the variables of . Similarly construct from the rightmost occurrence of each variable in . By our above characterization is equivalent to , and there are ways to make a word from appending two permutations. Finally, suppose we have a different appending (without loss of generality we may assume that ). We have some pair such that appears to the left of in but their order is reversed in . Then we can construct such that are the only two elements of the top component marked of . This operation gives and , so the two are not equivalent.