![](/files/happy5.png)
Linear-size circuits for stable $0,1 < 2$ sorting?
Problem Can
-size circuits compute the function
on
defined inductively by
,
,
, and
?
![$ O(n) $](/files/tex/ee18510ab4140627d7a8df7949d309533b39ebca.png)
![$ f $](/files/tex/43374150a8a220f67049937b9790b7d28eb17fb9.png)
![$ \{0,1,2\}^* $](/files/tex/f56a45854cf589f1da72c2f64d21b7b4dec2305f.png)
![$ f(\lambda) = \lambda $](/files/tex/f9b67009adb2fef4eb52dc06e1b0a722f93a1168.png)
![$ f(0x) = 0f(x) $](/files/tex/24d43faf8ea499bed579c16f679f7b353a7c4b2f.png)
![$ f(1x) = 1f(x) $](/files/tex/b0231ba1329cb9e05670a22b6d96677b863e84cd.png)
![$ f(2x) = f(x)2 $](/files/tex/5a41555dd8b0fff8646036b2ec77a62f2e24b2cb.png)
This function moves all 2s in flush-right, leaving the sequence of 0s and 1s the same, and represents stable topological sort of the partial order
. It is linear-time computable in any model that supports the operations of a double-ended queue in
time, including multi-tape Turing machines, but is to me the "easiest" function for which I do not know linear-size circuits. By contrast sorting
, called the "Dutch National Flag Problem", has
-size circuits by counting. It suffices to compute
when
is a power of
and exactly half the entries are
. For this and more see my Computational Complexity blog item, PDF file here.
Bibliography
* indicates original appearance(s) of problem.