lean_workbook_plus_62241
ProvedLet ( ) be the probability that we have a run of heads before tails if our current streak of heads is where a streak of is a tail. Notice \begin{align*}h_4&=\tfrac{1}{2}+\tfrac{1}{2}h_{-1}\h_3&=\tfrac{1}{2}h_4+\tfrac{1}{2}h_{-1}\h_2&=\tfrac{1}{2}h_3+\tfrac{1}{2}h_{-1}\h_1&=\tfrac{1}{2}h_2+\tfrac{1}{2}h_{-1}\h_{-1}&=\tfrac{1}{2}h_1+\tfrac{1}{2}\cdot 0\end{align*} where we are considering whether the next flip is heads or tails. Repeatedly substituting yields \n\n \begin{align*}h_1&=\tfrac{1}{2}h_2+\tfrac{1}{2}h_{-1}&=\tfrac{1}{2}(\tfrac{1}{2}h_3+\tfrac{1}{2}h_{-1})+\tfrac{1}{2}h_{-1}&=\tfrac{1}{4}(\tfrac{1}{2}h_4+\tfrac{1}{2}h_{-1})+\tfrac{3}{4}h_{-1}&=\tfrac{1}{8}(\tfrac{1}{2}+\tfrac{1}{2}h_{-1})+\tfrac{7}{8}h_{-1}&=\tfrac{1}{16}+\tfrac{15}{16}h_{-1}&=\tfrac{1}{16}+\tfrac{15}{16}(\tfrac{1}{2}h_1+\tfrac{1}{2}\cdot 0)&=\tfrac{1}{16}+\tfrac{15}{32}h_1\end{align*} so and Our answer is
import Mathlib.Analysis.Complex.Basic
theorem lean_workbook_plus_62241 : (1 / 2 * (2 / 17 + 1 / 17)) = 3 / 34 := by sorry