1

You can solve this as a Markov decision problem (stochastic dynamic programming) as follows. Let $D = \{\text{blue}, \text{red}\}$ be the set of two possible draws. Given $n$, let the states be
$$\{(k,b,r,d): k \in \{0,\dots,n\}, b \in \{1,\dots,n+1\}, r \in \{1,\dots,n-k+2-b\}, d \in D\},$$
wh...