Answer: now, the expected value will be x = p1*0$ + p2*1$
where p1 is te probabilty of a fail and p2 the probability of succes.
Ok, we will have 4 steps here.
1) there are 4 balls, and if we chose a spesific colour, there are 50% chance of succes. x = 0.5$
2) there are 3 balls, but yo know that if in the first step you graved a blue ball, then here you have a 66% of getting a red one, so if you play optimaly, you will guess red. x = 0.6$
3a) now there are two posibilities, in the last step yo get the other blue ball, so now are two red balls in the box, and you have guaranted 2 bucks. x = 2$ (but you failed in the last step)
3b) if in 2 you get a red ball, then again you have a 50/50 chance for each colour. x= 0.5$
4) there's only one ball in the box, you get a dollar x = 1 $
so if you go with the 3b path, te expected value will be 2.6$
with 3a) x = 2.5$