An algorithm is presented that, taking a sequence of independent Bernoulli random variables with parameter $1/2$ as inputs and using only rational arithmetic, simulates a Bernoulli random variable with possibly irrational parameter $\tau$. It requires a series representation of $\tau$ with positive, rational terms, and a rational bound on its truncation error that converges to $0$. The number of required inputs has an exponentially bounded tail, and its mean is at most $3$. The number of arithmetic operations has a tail that can be bounded in terms of the sequence of truncation error bounds. The algorithm is applied to two specific values of $\tau$, including Euler's constant, for which obtaining a simple simulation algorithm was an open problem.
翻译:提出一个算法, 使用一系列独立的伯努利随机变量( 参数为1/2美元作为投入, 并仅使用理性算术), 模拟伯努利随机变量( 可能不合理的参数为$\ tau$ ) 。 它需要一系列正数、 理性的值表示$\ tau$, 并按其脱轨错误的合理值约束在一连串的折叠错误中。 所需输入的数量有一个指数性捆绑尾, 平均值为$3美元。 算术操作的数量有一个尾巴, 可以按脱轨错误的顺序来捆绑 。 该算法应用到两个特定的值 $\ tau$, 包括 Euler 的常数, 获得简单的模拟算法是一个尚未解决的问题 。