What is the difference between the state-value Vπ(s) and the action-value Qπ(s,a), and how are they related? If π(a1∣s)=0.7, π(a2∣s)=0.3, Qπ(s,a1)=4 and Qπ(s,a2)=2, what is Vπ(s)?

Reinforcement learning, Value functions
Level L1 Beginner. Length Short. Nature Th+Mat Both.

What's being asked

Whether you can state both definitions and convert one into the other.

Key idea

Vπ(s) is the expected return from s when following π. Qπ(s,a) is the expected return from taking a in s first, then following π. They are linked by Vπ(s)=∑aπ(a∣s) Qπ(s,a).

Steps

  1. Define Vπ(s)=Eπ[Gt∣st=s], where Gt is the discounted sum of future rewards.
  2. Define Qπ(s,a)=Eπ[Gt∣st=s,at=a]. The first action is fixed to a, and π is used from the next step on.
  3. Relate them. Vπ(s) averages Qπ(s,a) over the policy's action probabilities: Vπ(s)=∑aπ(a∣s) Qπ(s,a).
  4. Compute the example: Vπ(s)=0.7×4+0.3×2=2.8+0.6=3.4.
  5. Say why Q is useful: given Q, the greedy action is arg⁡max⁡aQ(s,a) with no model needed, whereas with V alone you need the transition model to look one step ahead.

Common mistakes

How long your answer should be

3–5 sentences and one line of arithmetic.

Last checked on 4 December 2026.

Read this

Previous in Reinforcement learning: What are the three stages of reinforcement learning from human feedback (RLHF) used to fine-tune a language model, and what does each stage produce?
Next in Reinforcement learning: A deterministic MDP has two states, A and B, and γ=0.9. In A you can "stay" (reward 1, remain in A) or "go" (reward 0, move to B). In B the only action is "stay" (reward 2, remain in B). Starting from V0=0, what are the values after three iterations of value iteration, and what are V∗ and the optimal policy?