No, joe_the_user is exactly correct. The expectation they compute in step 7 requires that A is a constant. The formula seems to just be the regular formula for expectation: Value that B can take times probability that it takes that value, summed over all possible values.
But the "possible values" they put in are A/2 and 2A, which makes no sense. A is a random variable.
Don't forget that random variables are really functions on a probability space with an implicit argument, so (1) when multiple random variables appear in a formula, they're implicitly evaluated at the same argument omega, and the formula must hold for all omega from the probability space, and more importantly, (2) there can't be free-standing omegas in a formula for expectation because expectation is an integral (or sum in this case where the probability space is discrete) over all possible omegas.
But the "possible values" they put in are A/2 and 2A, which makes no sense. A is a random variable.
Don't forget that random variables are really functions on a probability space with an implicit argument, so (1) when multiple random variables appear in a formula, they're implicitly evaluated at the same argument omega, and the formula must hold for all omega from the probability space, and more importantly, (2) there can't be free-standing omegas in a formula for expectation because expectation is an integral (or sum in this case where the probability space is discrete) over all possible omegas.