Question 1181443
.


This problem, with exactly the same words/numbers, is discussed/solved in these sources



http://cgm.cs.mcgill.ca/~avis/courses/567/notes/stoch1.pdf


http://user.engineering.uiowa.edu/~dbricker/Stacks_pdf1/SLPwR_Farmer.pdf


https://webspace.science.uu.nl/~akker103/ALP/stochprogfarmer.pdf