arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1603.01583cs.DS
收藏

寻找多数元素的随机算法

Randomized algorithms for finding a majority element

Paweł Gawrychowski, Jukka Suomela, Przemysław Uznański

摘要:

给定$n$彩色球,我们要检测是否有超过$\lfloor n/2\rfloor$的球具有相同的颜色,如果是,则找到具有这种多数颜色的球。我们只允许选择两个球并比较它们的颜色,目标是最小化此类操作的总数。一个著名的练习是展示如何找到这样一个球,只有$2n$比较,同时只使用对数数量的位进行簿记。由此产生的算法被称为Boyer-Moore多数表决算法。众所周知,任何确定性方法都需要在最坏情况下进行$\lceil 3n/2\rceil-2$比较,这是严格的。但是,如果我们允许随机化,则不清楚所需的比较次数。我们构建了一个随机算法,总是正确地找到一个球的大多数颜色(或检测到没有),使用高概率,只有$7n/6+o(n)$比较。我们还证明了任何这样的随机化方法所使用的预期比较数至少是$1.019n$。

英文摘要:

Given $n$ colored balls, we want to detect if more than $\lfloor n/2\rfloor$ of them have the same color, and if so find one ball with such majority color. We are only allowed to choose two balls and compare their colors, and the goal is to minimize the total number of such operations. A well-known exercise is to show how to find such a ball with only $2n$ comparisons while using only a logarithmic number of bits for bookkeeping. The resulting algorithm is called the Boyer--Moore majority vote algorithm. It is known that any deterministic method needs $\lceil 3n/2\rceil-2$ comparisons in the worst case, and this is tight. However, it is not clear what is the required number of comparisons if we allow randomization. We construct a randomized algorithm which always correctly finds a ball of the majority color (or detects that there is none) using, with high probability, only $7n/6+o(n)$ comparisons. We also prove that the expected number of comparisons used by any such randomized method is at least $1.019n$.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑