In this paper, we consider several efficient data structures for the problem of sampling from a dynamically changing discrete probability distribution, where some prior information is known on the distribution of the rates, in particular the maximum and minimum rate, and where the number of possible outcomes N is large. We consider three basic data structures, the Acceptance-Rejection method, the Complete Binary Tree and the Alias method. These can be used as building blocks in a multi-level data structure, where at each of the levels, one of the basic data structures can be used, with the top level selecting a group of events, and the bottom level selecting an element from a group. Depending on assumptions on the distribution of the rates of outcomes, different combinations of the basic structures can be used. We prove that for particular data structures the expected time of sampling and update is constant when the rate distribution follows certain conditions. We show that for any distribution, combining a tree structure with the Acceptance-Rejection method, we have an expected time of sampling and update of $O\left(\log\log{r_{max}}/{r_{min}}\right)$ is possible, where $r_{max}$ is the maximum rate and $r_{min}$ the minimum rate. We also discuss an implementation of a Two Levels Acceptance-Rejection data structure, that allows expected constant time for sampling, and amortized constant time for updates, assuming that $r_{max}$ and $r_{min}$ are known and the number of events is sufficiently large. We also present an experimental verification, highlighting the limits given by the constraints of a real-life setting.
翻译:在本文中,我们从动态变化的离散概率分布中为取样问题考虑若干高效的数据结构,这些结构是动态变化的离散概率分布,事先知道一些关于费率分布的信息,特别是最高和最低比率,以及可能的结果数量很大。我们考虑三个基本数据结构,即接受-拒绝方法、完整的二进制树和别式方法。这些结构可以用作多层次数据结构的构件,每个层次都可使用一个基本数据结构,由顶层选择一组事件,底层从一组中选择一个要素。根据对结果分布的假设,特别是最高和最低比率,可以使用基本结构的不同组合。我们证明,对于特定数据结构,在比率分布符合某些条件的情况下,预期的取样和更新时间是固定的。我们表明,在任何分布中,将树结构与接受-反馈方法结合起来,我们预计的取样和更新时间是美元(log\log{max%{r{r{min=rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr), 从一组中选择一个要素。 元素。取决于一个要素元素元素元素元素元素元素元素元素元素。取决于一个要素。根据对结果的计算,根据对结果的计算,对于结果的计算,对于结果的当前最大比率的更新也是一个固定比率,对于一个固定的基数,对于一个固定的基数的基值的更新,对于一个固定的基值,对于一个固定的基数也是可能的基值,对于一个固定的基值,对于一个固定的基值,也是可能的基数。