Efficient random sampling of binary and unary-binary trees via holonomic equations

Abstract

We present a new uniform random sampler for binary trees with n internal nodes consuming 2n + ((n)2) random bits on average. This makes it quasi-optimal and out-performs the classical Remy algorithm. We also present a sampler for unary-binary trees with n nodes taking (n) random bits on average. Both are the first linear-time algorithms to be optimal up to a constant.

0

Turn this paper into a lesson

ArcXiv compiles a structured reading guide from this paper's metadata: plain-English importance, contributions, prerequisite concepts, which sections to read first, flashcards, and a quiz. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…