An urn contains two balls, each ball is red with probability $p$ and blue with probability $1-p$.
(a) It is known that at least one ball is red, what is the probability that exactly one ball is red?
(b) We draw a ball from the urn $k$ times and replace it, every time the color of the ball is red. Now what is the probability that exactly one ball is red?
Let's denote $1-p$ by $q$.
More information is needed here. It can be for instance that with probability $p$ one has chosen for colour red and with probability $q$ for colour blue, and that after that choice both balls have been given this chosen color. Then they have the same colour while for both it is true that the probability that the colour is red equals indeed $p$. In that case the answer on (a) is $0$.
By independency (the color of a ball does not depend on the color of the other ball) one comes to another answer on (a). Let $X$ denote the number of red balls in the urn. Then:
$P\left\{ X=0\right\} =q^{2}$,
$P\left\{ X=1\right\} =2pq$ and:
$P\left\{ X=2\right\} =p^{2}$.
You are asked to calculate: $P\left\{ X=1\mid X\geq1\right\}$.
Let $R$ denote the number of red balls that show up by drawing $k$ balls with repacement.
In (b) you are asked to calculate: $P\left\{ X=1\mid R=k\right\} $.
Then $P\left\{ R=k\right\}$ equals:
$P\left\{ R=k\mid X=0\right\} P\left\{ X=0\right\} +P\left\{ R=k\mid X=1\right\} P\left\{ X=1\right\} +P\left\{ R=k\mid X=2\right\} P\left\{ X=2\right\} $
Here:
$P\left\{ R=k\mid X=0\right\} =0$,
$P\left\{ R=k\mid X=1\right\} =2^{-k}$ and
$P\left\{ R=k\mid X=2\right\} =1$
So we find:
$P\left\{ R=k\right\} =2^{-k}\times2pq+p^{2}=2^{-k+1}pq+p^{2}$.
Finally $P\left\{ X=1\mid R=k\right\} $ can be found based upon the equality:
This leads to $P\left\{ X=1\mid R=k\right\} =\frac{q}{q+2^{k-1}p}$