Problem bank

Problem 247 of 333MediumCodingP247

Streaks of either kind

  1. A strategy wins each trading day with probability pp, independently. Over 50 trading days, what is the probability of a run of at least 5 consecutive days with the same result, meaning 5 wins in a row or 5 losses in a row? Give the answer for p=1/2p = 1/2 and p=0.55p = 0.55, write an exact algorithm for general nn days, run length kk and win probability pp, and state its complexity.