Solution (source code)

= Solution

By the definition of <conditional probability>, or <Bayes' theorem>,
$$
\boxed{P(R\mid B_1\cap B_2)=\frac{P(B_1\cap R\cap B_2)}{P(B_1\cap B_2)}=\frac{4r/25}{(5+3r)/50}=\frac{8r}{5+3r}.}
$$
Its denominator is positive throughout the specified range. Observing two blue balls raises the <probability> of replacement for $0<r<1$, because replacement makes a repeated colour more likely.