English
Related papers

Related papers: A loopless and branchless $O(1)$ algorithm to gene…

200 papers

Let $0<k\in\mathbb{Z}$. The anchored Dyck words of length $n=2k+1$ (obtained by prefixing a 0-bit to each Dyck word of length $2k$ and used to reinterpret the Hamilton cycles in the odd graph $O_k$ and the middle-levels graph $M_k$ found by…

Combinatorics · Mathematics 2025-05-27 Italo J. Dejter

An algorithm counting the number of ones in a binary word is presented running in time $O(\log\log b)$ where $b$ is the number of ones. The operations available include bit-wise logical operations and multiplication.

Data Structures and Algorithms · Computer Science 2015-06-12 Holger Petersen

A subsequence of a word $w$ is a word $u$ such that $u = w[i_1] w[i_2] \cdots w[i_k]$, for some set of indices $1 \leq i_1 < i_2 < \dots < i_k \leq \vert w \vert$. A word $w$ is \emph{$k$-subsequence universal} over an alphabet $\Sigma$ if…

Formal Languages and Automata Theory · Computer Science 2025-03-25 Duncan Adamson , Pamela Fleischmann , Annika Huch , Tore Koß , Florin Manea

In this paper we propose an algorithm to generate binary words with no more 0's than 1's having a fixed number of 1's and avoiding the pattern $(10)^j1$ for any fixed $j \geq 1$. We will prove that this generation is exhaustive, that is,…

Discrete Mathematics · Computer Science 2012-10-30 Stefano Bilotta , Elisabetta Grazzini , Elisa Pergola , Renzo Pinzani

A deterministic algorithm for factoring $n$ using $n^{1/3+o(1)}$ bit operations is presented. The algorithm tests the divisibility of $n$ by all the integers in a short interval at once, rather than integer by integer as in trial division.…

Number Theory · Mathematics 2016-08-01 Ghaith A. Hiary

In this paper, we study a series of algorithmic problems related to the subsequences occurring in the strings of a given language, under the assumption that this language is succinctly represented by a grammar generating it, or an automaton…

Formal Languages and Automata Theory · Computer Science 2024-10-11 Szilárd Zsolt Fazekas , Tore Koß , Florin Manea , Robert Mercaş , Timo Specht

We consider the recognition problem of the Dyck Language generalized for multiple types of brackets. We provide an algorithm with quantum query complexity $O(\sqrt{n}(\log n)^{0.5k})$, where $n$ is the length of input and $k$ is the maximal…

Quantum Physics · Physics 2021-06-18 Kamil Khadiev , Dmitry Kravchenko

A word on $q$ symbols is a sequence of letters from a fixed alphabet of size $q$. For an integer $k\ge 1$, we say that a word $w$ is $k$-universal if, given an arbitrary word of length $k$, one can obtain it by removing entries from $w$. It…

Combinatorics · Mathematics 2023-08-15 Matías Pavez-Signé , Daniel A. Quiroz , Nicolás Sanhueza-Matamala

The directed acyclic word graph (DAWG) of a string $y$ of length $n$ is the smallest (partial) DFA which recognizes all suffixes of $y$ with only $O(n)$ nodes and edges. In this paper, we show how to construct the DAWG for the input string…

Data Structures and Algorithms · Computer Science 2023-07-06 Yuta Fujishige , Yuki Tsujimaru , Shunsuke Inenaga , Hideo Bannai , Masayuki Takeda

We consider the problem of dictionary matching in a stream. Given a set of strings, known as a dictionary, and a stream of characters arriving one at a time, the task is to report each time some string in our dictionary occurs in the…

Data Structures and Algorithms · Computer Science 2015-04-24 Raphael Clifford , Allyx Fontaine , Ely Porat , Benjamin Sach , Tatiana Starikovskaya

Let $0<k\in\mathbb{Z}$. We zipper-merge integer compositions with sums $k$ and $k+1$, equal number of parts and initial entries equal at least to 1 and 2, respectively. This yields bitstrings with two initial zeros, $k-1$ remaining zeros…

Combinatorics · Mathematics 2022-04-05 Italo J. Dejter

In this paper we establish some new results similar to Lagrange's four-square theorem. For example, we prove that any integer $n>1$ can be written as $w(5w+1)/2+x(5x+1)/2+y(5y+1)/2+z(5z+1)/2$ with $w,x,y,z\in\mathbb Z$. Let $a$ and $b$ be…

Number Theory · Mathematics 2024-12-06 Zhi-Wei Sun

For any infinite word $w$ on a finite alphabet $A$, the complexity function $p_w$ of $w$ is the sequence counting, for each non-negative $n$, the number $p_w(n)$ of words of length $n$ on the alphabet $A$ that are factors of the infinite…

Dynamical Systems · Mathematics 2018-03-16 Carlos Gustavo Moreira , Christian Mauduit , Sébastien Ferenczi

In this paper we present a really simple linear-time algorithm constructing a context-free grammar of size O(g log (N/g)) for the input string, where N is the size of the input string and g the size of the optimal grammar generating this…

Data Structures and Algorithms · Computer Science 2014-03-19 Artur Jeż

We prove that for any sequence of binary alphabets $\mathcal{A}_1,\mathcal{A}_2,\dots$, there exists a cube-free word $c_1c_2\dots$ so that $c_1\in\mathcal{A}_1,c_2\in\mathcal{A}_2,\dots$. In particular, for every $n$, there are at least…

Combinatorics · Mathematics 2025-12-04 Vuong Bui , Matthieu Rosenfeld

We show how to enumerate words in $1^{m_1} \dots n^{m_n}$ that avoid the increasing consecutive pattern $12 \dots r$ for any $r \geq 2$. Our approach yields an $O(n^{s+1})$ algorithm to enumerate words in $1^s \dots n^s$, avoiding the…

Combinatorics · Mathematics 2018-05-23 Mingjia Yang , Doron Zeilberger

Suppose we want to seek the longest common subsequences (LCSs) of two strings as informative patterns that explain the relationship between the strings. The dynamic programming algorithm gives us a table from which all LCSs can be extracted…

Data Structures and Algorithms · Computer Science 2025-05-23 Yoshifumi Sakai

We exhibit the construction of a deterministic automaton that, given k > 0, recognizes the (regular) language of k-differentiable words. Our approach follows a scheme of Crochemore et al. based on minimal forbidden words. We extend this…

Discrete Mathematics · Computer Science 2015-03-18 Jean-Marc Fédou , Gabriele Fici

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…

Formal Languages and Automata Theory · Computer Science 2012-11-05 Andy Lorenz , Yann Ponty

Assuming we are in a Word-RAM model with word size $w$, we show that we can construct in $o(w)$ time an error correcting code with a constant relative positive distance that maps numbers of $w$ bits into $\Theta(w)$-bit numbers, and such…

Data Structures and Algorithms · Computer Science 2014-09-16 Djamal Belazzougui