The ``Monkey Typing Shakespeare" Problem for Compositions

By Shalosh B. Ekhad and Doron Zeilberger


.pdf   .ps   .tex  

(Exclusively published in the Personal Journal of Shalosh B. Ekhad and Doron Zeilberger and arxiv.org )

Posted: Jan. 12, 2019


Suppose that your mother gave you n candies. You have to eat at least one candy each day. One possibility is to eat all n of them the first day. Another extreme is to make them last n days, and only eat one candy a day. Altogether, you have, famously, 2n-1 choices. If each such choice is equally likely, what is the probability that you never have three consecutive days, where in the first day you ate at least 2 candies, in the second day you ate at least 5 candies, and in the third day you ate at least 3 candies? This article develops an algorithm, fully implemented in two Maple packages, to answer such important questions, and more general ones, of this kind.


Maple packages


Sample Input and Output Files for the Maple package Compositions.txt,


Sample Input and Output Files for the Maple package CompositionsPlus.txt,


Personal Journal of Shalosh B. Ekhad and Doron Zeilberger

Doron Zeilberger's Home Page