Abstract
We analyse a simple storage allocation scheme in which two stacks grow and shrink inside a shared memory area. To that purpose, we provide analytic expressions for the number of 2-dimensional random walks in a triangle with two reflecting barriers and one absorbing barrier.
We obtain probability distributions and expectations of characteristic parameters of that shared memory scheme, namely the sizes of the stacks and the time until the system runs out of memory.
This provides a complete solution to an open problem posed by Knuth in "The Art of Computer Programming", Vol. 1, 1968 [Ex. 2.2.2.13].
Preview
Unable to display preview. Download preview PDF.
References
N. De Bruijn, D. E. Knuth, and S. O. Rice, “The Average Height of Binary Trees and Other Simple Trees,” pp. 15–22 in Graph Theory and Computing, Academic Press, New-York (1972).
L. Comtet, Advanced Combinatorics, Reidel, Dordrecht (1974).
P. Flajolet, “Combinatorial Aspects of Continued Fractions,” Discrete Math. 32 pp. 125–161 (1980).
P. Flajolet, J. Francon, and J. Vuillemin, “Sequence of Operations Analysis for Dynamic Data structures,” J. of Alg. 1 pp. 111–141 (1980).
J. Francon, “Histoires de Fichiers,” RAIRO Inf. Theor. 12 pp. 49–62 (1979).
A. Jonassen and D. E. Knuth, “A Trivial Algorithm Whose Analysis Isn't,” Stanford University Report STAN-CS-77-598 (1977).
D. E. Knuth, The Art of Computer Programming: Fundamental Algorithms, Addison Wesley, Reading, Mass (1968).
J. K. Percus, Combinatorial Methods, Springer Verlag (Applied Mathematical Sciences 4), New-York (1971).
F. Spitzer, Principles of Random Walk, Springer Verlag, New-York (1976). (2nd ed.).
E. T. Whittaker and G. N. Watson, A Course in Modern Analysis, Cambridge University Press (1927).
A. C. Yao, “An Analysis of a Memory Allocation Scheme for Implementing Stacks,” SIAM J. Comput. 10(2), pp. 398–403 (1981).
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1986 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Flajolet, P. (1986). The evolution of two stacks in bounded space and random walks in a triangle. In: Gruska, J., Rovan, B., Wiedermann, J. (eds) Mathematical Foundations of Computer Science 1986. MFCS 1986. Lecture Notes in Computer Science, vol 233. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0016257
Download citation
DOI: https://doi.org/10.1007/BFb0016257
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-16783-9
Online ISBN: 978-3-540-39909-4
eBook Packages: Springer Book Archive