Solution:
Let pn be the probability that the nth head is flipped after a tail and Jude has yet to flip 3 heads consecutively to this point. For example, p2=32, as it is impossible for 3 heads to be flipped consecutively and the second head comes after a tail exactly when the first flip after the first head is a tail, which happens with probability 32. Similarly, p3=43. We now establish a recursion between values of pn:
pn=n+1npn−1+n+11pn−2.
The first term comes from when the previous head had tails both before and after, and the second term comes from when the previous 2 heads were consecutive. Of course there cannot be other terms, as this would imply that 3 heads were flipped consecutively. This enables us to easily compute the next few terms: 1511, 7253, 140103, and so on. Notably, the differences between consecutive terms (starting from p3−p2) are 242,−1202,7202,−50402, and so on. This leads us to guess that pn=2∑i=0n+1i!(−1)i, which indeed satisfies the given recurrence relation. Then
n→∞limpn=2i=0∑∞i!(−1)i=e2
But since the probability that the nth head comes after a tail approaches 1 as n increases, this limit is the same as the limit of the probability that the first n heads do not include 3 that came consecutively. Then this limit is just the probability that we never flip 3 consecutive heads. Then the desired probability is just p=1−e2. We are asked to compute ⌊180p⌋. This is the floor of 180−e360. To compute 360/e, note that we can just truncate the infinite sum
e360=n=0∑∞n!360(−1)n
as it converges rather quickly. The first several terms are 360−360+180−60+15−3+21, and the rest are insignificant. This sums to about 132.5, giving an answer of ⌊180−132.5⌋=47.