{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/optimal-computation-of-avoided-words","title":"Optimal Computation of Avoided Words","arxiv_id":"1604.08760","date":"2016-04-29","proceeding":null,"authors":["Yannis Almirantis","Panagiotis Charalampopoulos","Jia Gao","Costas S. Iliopoulos","Manal Mohamed","Solon P. Pissis","Dimitris Polychronopoulos"],"abstract":"The deviation of the observed frequency of a word $w$ from its expected frequency in a given sequence $x$ is used to determine whether or not the word is avoided. This concept is particularly useful in DNA linguistic analysis. The value of the standard deviation of $w$, denoted by $std(w)$, effectively characterises the extent of a word by its edge contrast in the context in which it occurs. A word $w$ of length $k>2$ is a $\\rho$-avoided word in $x$ if $std(w) \\leq \\rho$, for a given threshold $\\rho < 0$. Notice that such a word may be completely absent from $x$. Hence computing all such words na\\\"{\\i}vely can be a very time-consuming procedure, in particular for large $k$. In this article, we propose an $O(n)$-time and $O(n)$-space algorithm to compute all $\\rho$-avoided words of length $k$ in a given sequence $x$ of length $n$ over a fixed-sized alphabet. We also present a time-optimal $O(\\sigma n)$-time and $O(\\sigma n)$-space algorithm to compute all $\\rho$-avoided words (of any length) in a sequence of length $n$ over an alphabet of size $\\sigma$. Furthermore, we provide a tight asymptotic upper bound for the number of $\\rho$-avoided words and the expected length of the longest one. We make available an open-source implementation of our algorithm. Experimental results, using both real and synthetic data, show the efficiency of our implementation.","url_abs":"http://arxiv.org/abs/1604.08760v1","url_pdf":"http://arxiv.org/pdf/1604.08760v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"optimal-computation-of-avoided-words","repo_url":"https://github.com/solonas13/aw","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":null}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":null,"mcp":null,"developers":"https://syntology.ai/developers"},"arxiv_metadata":null,"syntology_extracted_results":null}