Uniform random generations and rejection method(II) with trivial majorant
Résumé
We present a simple algorithm to help generate simple structures: 'Fibonacci words' (i.e., certain words that are enumerated by Fibonacci numbers), Motzkin words, Schröder trees of size n. It starts by choosing an initial integer with uniform probability (i.e., 1/n for some n), then uses a basic rejection method to accept or reject it. We show that at least for these structures, this leads to very simple and efficient algorithms with an average complexity of O(√ n log n) that only use small integers (integers smaller than n^2). More generally, for structures that satisfy a basic condition, we prove that this leads to an algorithm with an average complexity of O(n). We then show that we can extend it to be more efficient if a distribution has a long 'trail' by showing how we can generate Partial Injections of size n in O(n^(1/4) log n) and Motzkin left factors of size n and final height h in O(√ n log n).
Domaines
Mathématique discrète [cs.DM]Origine | Fichiers produits par l'(les) auteur(s) |
---|