pith. sign in

arxiv: 1211.0303 · v1 · pith:3JDDKX7Onew · submitted 2012-11-01 · 💻 cs.FL · cs.DM· cs.DS

Non-redundant random generation algorithms for weighted context-free languages

classification 💻 cs.FL cs.DMcs.DS
keywords generationwordsalgorithmsnon-redundantapproachcdotcomplexitycontext-free
0
0 comments X
read the original abstract

We address the non-redundant random generation of $k$ words of length $n$ in a context-free language. Additionally, we want to avoid a predefined set of words. We study a rejection-based approach, whose worst-case time complexity is shown to grow exponentially with $k$ for some specifications and in the limit case of a coupon collector. We propose two algorithms respectively based on the recursive method and on an unranking approach. We show how careful implementations of these algorithms allow for a non-redundant generation of $k$ words of length $n$ in $\mathcal{O}(k\cdot n\cdot \log{n})$ arithmetic operations, after a precomputation of $\Theta(n)$ numbers. The overall complexity is therefore dominated by the generation of $k$ words, and the non-redundancy comes at a negligible cost.

This paper has not been read by Pith yet.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.