Calculate the value of a stochastic action

Keep each reward, discount and value next to its number. · 172 words

At a museum gift shop, state S means a shopper is ready to buy a souvenir. Action A is to use a discount coupon. It is stochastic because the clerk may approve it with probability 0.7 or reject it with probability 0.3. Approval gives reward 2 dollars and moves the shopper to S1, whose estimated future value is 4 dollars. Rejection gives reward 0 and moves the shopper to S2, whose estimated future value is 10 dollars. A state value estimates expected discounted return from that state onward.

The discount factor gamma is 0.9, so a future dollar at the next step counts as 0.9 dollars today. For each outcome, calculate reward + gamma times the next-state value, then average using the outcome probabilities. Here, Q(S,A) = 0.7[2 + 0.9(4)] + 0.3[0 + 0.9(10)] = 0.7(5.6) + 0.3(9) = 6.62 dollars. An action value Q(s,a) is the expected return from taking that action in that state. Probabilities weight each possible return before averaging, since a stochastic action has no single certain outcome.

Check your recall

What is Q(S,A), and what do the numbers 0.7 and 0.3 represent?

Check your answer

Q(S,A) = 6.62 dollars. The numbers 0.7 and 0.3 are the probabilities of approval and rejection. They weight the two possible returns before they are averaged.

Sources and credits

Original KeyTouch lesson. Background reading · UC Berkeley · Introduction to Artificial Intelligence.