\begin{algorithm}
\caption{Bernoulli factory for continuous $f : [0, 1] \mapsto [0, 1]$ satisfying \eqref{polynomially_bounded}.}
\label{alg_1}
\begin{algorithmic}[1]
\Require Sequences $\{ f_k \}_{k \geq 1}$, $\{ \eta( f, k ) \}_{k \geq 1}$.
\State Sample $L \sim \operatorname{Geo}(1 / 4)$. 
\State Sample $X_{\eta( f, L ) }( p ) \sim \operatorname{Bin}( \eta( f, L ), p )$.
\If{$f_L( X_{\eta( f, L ) } ( p ) / L ) \geq 1/2$} 
	\State Return 1.
\Else
	\State Return 0.
\EndIf
\end{algorithmic}
\end{algorithm}

\begin{algorithm}
\caption{Bernoulli factory for continuous $f : [0, 1] \mapsto [0, 1]$ satisfying \eqref{polynomially_bounded}.}
\begin{algorithmic}
[1]
\Require Sequences $\{ f_k \}_{k \geq 1}$, $\{ \eta( f, k ) \}_{k \geq 1}$.
\State Sample $L \sim \operatorname{Geo}(1 / 4)$.
\State Sample $X_{\eta( f, L ) }( p ) \sim \operatorname{Bin}( \eta( f, L ), p )$.
\If{$f_L( X_{\eta( f, L ) } ( p ) / L ) \geq 1/2$}
\State Return 1.
\Else
\State Return 0.
\EndIf
\end{algorithmic}
\end{algorithm}
{
    "title": "bernoulli factories and duality in wright-fisher and allen-cahn models   of population genetics",
    "id": "2306.03539",
    "abstract": "mathematical models of genetic evolution often come in pairs, connected by a so-called duality relation. the most seminal example are the wright-fisher diffusion and the kingman coalescent, where the former describes the stochastic evolution of neutral allele frequencies in a large population forwards in time, and the latter describes the genetic ancestry of randomly sampled individuals from the population backwards in time. as well as providing a richer description than either model in isolation, duality often yields equations satisfied by quantities of interest. we employ the so-called bernoulli factory - a celebrated tool in simulation-based computing - to derive duality relations for broad classes of genetics models. as concrete examples, we present wright-fisher diffusions with general drift functions, and allen-cahn equations with general, nonlinear forcing terms. the drift and forcing functions can be interpreted as the action of frequency-dependent selection. to our knowledge, this work is the first time a connection has been drawn between bernoulli factories and duality in models of population genetics.",
    "categories": "math.pr q-bio.pe",
    "doi": "",
    "created": "2023-06-06",
    "updated": "2024-02-01",
    "authors": [
        "jere koskela",
        "krzysztof \u0142atuszy\u0144ski",
        "dario span\u00f2"
    ],
    "affiliation": [],
    "url": "https://arxiv.org/abs/2306.03539"
}
{
    "ToxicityFilter": {
        "text_to_toxicity_attributes": {
            "wfb-diffusion_Google.tex": {
                "toxicity_score": 0.0109324735,
                "severe_toxicity_score": 0.0010824203,
                "identity_attack_score": 0.0035517942,
                "insult_score": 0.007322875,
                "profanity_score": 0.015147334,
                "threat_score": 0.007417747,
                "sexually_explicit_score": 0.012208274,
                "flirtation_score": 0.21162485
            },
            "wfb-diffusion_Google.bbl": {
                "toxicity_score": 0.010429831,
                "severe_toxicity_score": 0.0012159348,
                "identity_attack_score": 0.0034777985,
                "insult_score": 0.007360875,
                "profanity_score": 0.01535229,
                "threat_score": 0.0072882893,
                "sexually_explicit_score": 0.011500548,
                "flirtation_score": 0.23954658
            }
        },
        "reason": null
    }
}
{
    "num_done": {
        "figure": 0,
        "algorithm": 2,
        "plot": 0
    }
}
{
    "NonTrivialRenderingFilter": {
        "white_pixels_ratio": 92.32758476489971,
        "hash": "000f1f0f3f7f3f3f",
        "most_frequent_color_ratio": 92.32758476489971
    }
}