3 ms·
I've read the first one ("Grouped by Color") and isn't the solution more complicated than it needs to? It seems to me, that essentially the same process could b
by krick 11y ago
I've read the first one ("Grouped by Color") and isn't the solution more complicated than it needs to? It seems to me, that essentially the same process could be described by one simple rule: every dwarf should take place directly to the right of the rightmost dawrf with blue hat or to the left of the leftmost dwarf with red hat.
- sharkdp 11y agoIndeed, this looks like an easier description. Beware, however, that "directly to the right" could be misunderstood. If the first two are B and R, the third has to go between them... but I still like your rule. Will think about it, Thanks!
- krick 11y ago> first two are B and R, the third has to go between them Yes, exactly, and that is directly to the right of B. I assume that dwarfs can always "fit in" between the others. Actually, the rule "directly to the right of the rightmost blue one" would be enough if not the possibility that the first one can be R and then second one doesn't know where to stand and can take the place to the right wearing blue hat himself, which would fuck up the whole algorithm. Hence "to the left of the leftmost red one" part. And it still a little bothers me that, strictly speaking, separation will never happen, as the last dwarf will stand just on the right place, but will never know himself if he wears red or blue hat (others will know though).
- sharkdp 11y ago> > first two are B and R, the third has to go between them > Yes, exactly, and that is directly to the right of B. I assume that dwarfs can always "fit in" between the others. I'm okay with that, just saying that it could be misunderstood/disliked because some people would probably prefer a scheme which works for actual dwarves instead of pointlike :-) > Actually, the rule "directly to the right of the rightmost blue one" would be enough if not the possibility that the first one can be R and then second one doesn't know where to stand and can take the place to the right wearing blue hat himself, which would fuck up the whole algorithm. Hence "to the left of the leftmost red one" part. Yes... or if the first k ones are all red. > And it still a little bothers me that, strictly speaking, separation will never happen, as the last dwarf will stand just on the right place, but will never know himself if he wears red or blue hat (others will know though). True, but from a observer perspective, they definitely managed to order themselves into groups.