Document

# Computing the Pattern Waiting Time: A Revisit of the Intuitive Approach

## File

LIPIcs.ISAAC.2016.39.pdf
• Filesize: 460 kB
• 12 pages

## Cite As

Kai Jin. Computing the Pattern Waiting Time: A Revisit of the Intuitive Approach. In 27th International Symposium on Algorithms and Computation (ISAAC 2016). Leibniz International Proceedings in Informatics (LIPIcs), Volume 64, pp. 39:1-39:12, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2016)
https://doi.org/10.4230/LIPIcs.ISAAC.2016.39

## Abstract

We revisit the waiting time of patterns in repeated independent experiments. We show that the most intuitive approach for computing the waiting time, which reduces it to computing the stopping time of a Markov chain, is optimum from the perspective of computational complexity. For the single pattern case, this approach requires us to solve a system of m linear equations, where m denotes the length of the pattern. We show that this system can be solved in O(m + n) time, where n denotes the number of possible outcomes of each single experiment. The main procedure only costs O(m) time, while a preprocessing rocedure costs O(m + n) time. For the multiple pattern case, our approach is as efficient as the one given by Li [Ann. Prob., 1980]. Our method has several advantages over other methods. First, it extends to compute the variance or even higher moment of the waiting time for the single pattern case. Second, it is more intuitive and does not entail tedious mathematics and heavy probability theory. Our main result (Theorem 2) might be of independent interest to the theory of linear equations.
##### Keywords
• Pattern Occurrence
• Waiting Time
• Penney’s Game
• Markov Chain

## Metrics

• Access Statistics
• Total Accesses (updated on a weekly basis)
0

## References

1. Anonymous. Penney’s game. Technical report, Wikipedia, 2016. URL: https://en.wikipedia.org/wiki/Penney%27s_game.
2. J. A. D. Aston and D. E. K. Martin. Waiting time distributions of competing patterns in higher-order markovian sequences. Journal of Applied Probability, 42(4):977-988, 2005.
3. N. Balakrishnan and M. V. Koutras. Runs and Scans with Applications. Wiley, 2002.
4. S. Breen, M. S. Waterman, and N. Zhang. Renewal theory for several patterns. Journal of Applied Probability, 22(1):228-234, 1985.
5. O. Chrysaphinou and S. Papastavridis. The occurrence of sequence patterns in repeated dependent experiments. Theory of Probability &Its Applications, 35(1):145-152, 1991. URL: http://dx.doi.org/10.1137/1135015.
6. J. A. Csirik. Optimal strategy for the first player in the penney ante game. Combinatorics, Probability and Computing, 1:311-321, 1992. URL: http://dx.doi.org/10.1017/S0963548300000365.
7. W. Feller. An Introduction to Probability Theory and its Applications, volume 1. Wiley, 3 edition, 1968.
8. J. C. Fu and W. Y. W. Lou. Distribution Theory of Runs and Patterns and Its Applications. World Scientific Publishing, 2003.
9. I. Fudos, E. Pitoura, and W. Szpankowski. On pattern occurrences in a random text. Information Processing Letters, 57(6):307-312, 1996.
10. M. Gardner. On the paradoxical situations that arise from nontransitive relations. Scientific American, 231(4), 1974.
11. R. L. Graham, D. E. Knuth, and O. Patashnik. Concrete Mathematics: A Foundation for Computer Science. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 2nd edition, 1994.
12. L. J. Guibas and A. M. Odlyzko. String overlaps, pattern matching, and nontransitive games. Journal of Combinatorial Theory, Series A, 30(2):183-208, 1981. URL: http://dx.doi.org/10.1016/0097-3165(81)90005-4.
13. D. E. Knuth, Jr. J. H. Morris, and V. R. Pratt. Fast pattern matching in strings. SIAM Journal on Computing, 6(2):323-350, 1977. URL: http://dx.doi.org/10.1137/0206024.
14. S. R. Li. A martingale approach to the study of occurrence of sequence patterns in repeated experiments. The Annals of Probability, 8(6):1171-1176, 1980.
15. M. E. Lladser, M. D. Betterton, and R. Knight. Multiple pattern matching: a markov chain approach. Journal of Mathematical Biology, 56(1):51-92, 2007. URL: http://dx.doi.org/10.1007/s00285-007-0109-3.
16. M. Lothaire. Applied Combinatorics on Words. Cambridge University Press, 2005.
17. W. Penney. Problem 95: Penney-ante. Journal of Recreational Mathematics, page 241, 1969.
18. V. Pozdnyakov. On occurrence of patterns in markov chains: Method of gambling teams. Statistics &Probability Letters, 78(16):2762-2767, 2008. URL: http://dx.doi.org/10.1016/j.spl.2008.03.023.
19. V. Pozdnyakov and M. Kulldorff. Waiting times for patterns and a method of gambling teams. The American Mathematical Monthly, 113(2):134-143, 2006.
20. M. Régnier. A unified approach to word occurrence probabilities. Discrete Applied Mathematics, 104:259-280, 2000.
21. M. Régnier and W. Szpankowski. On pattern frequency occurrences in a markovian sequence. Algorithmica, 22(4):631-649, 1998. URL: http://dx.doi.org/10.1007/PL00009244.
22. G. Reinert, S. Schbath, and M. S. Waterman. Probabilistic and statistical properties of words: An overview. Journal of Computational Biology, 7(2):1-46, 2000.
23. A. D. Solov'ev. A combinatorial identity and its application to the problem concerning the first occurrence of a rare event. Theory of Probability &Its Applications, 11(2):276-282, 1966. URL: http://dx.doi.org/10.1137/1111022.
X

Feedback for Dagstuhl Publishing