public function getCentroid(array &$docs, array $choose=array())
    {
        $bitl = strlen($docs[0]);
        $buckets = array_fill_keys(
            range(0,$bitl-1),
            0
        );
        if (empty($choose))
            $choose = range(0,count($docs)-1);
        foreach ($choose as $idx) {
            $s = $docs[$idx];
            foreach ($buckets as $i=>&$v) {
                if ($s[$i]=='1')
                    $v += 1;
                else
                    $v -= 1;
            }
        }

        return implode(
            '',
            array_map(
                function ($v) {
                    return ($v>0) ? '1' : '0';
                },
                $buckets
            )
        );
    }