<s>[INST] How do I solve this recurrence relation? Given a recursive relation
$$a_n = \begin{cases}
(1 - 2b_n)a_{n-1} + b_n, & n > 1 \\
\frac{1}{2}, & n =1
\end{cases}
$$, how can I expression $a_n$ in term of $b_i, i \in \{1, 2, \dots n\}$?
 [/INST] Suppose that $a_n=\frac{1}{2}$ for some $n$. Then according to the recurrence:
\begin{align*}
a_{n+1}&=(1-2b_{n+1})a_n+b_{n+1} \\
&= \frac{1}{2}-b_{n+1}+b_{n+1} \\
&= \frac{1}{2}
\end{align*}
Since $a_1=\frac{1}{2}$, by induction this shows that $a_n=\frac{1}{2}$ for all $n$.
</s>