Now take the expectation under policy π:
Vπ(s)=Eπ[Rt+γGt+1∣st=s]
Split expectation over the action, then over the next state:
Vπ(s)=a∑π(a∣s)s′∑P(s′∣s,a)[R(s,a)+γVπ(s′)]
States S, Actions A, Transition P(s′∣s,a), Reward R, Discount γ.
What is the Markov property?
The next state depends only on the current state and action, not on earlier history.
Why do we discount future rewards with γ<1?
To keep infinite-horizon returns finite/convergent and to value near-term rewards more than distant ones.
State the Bellman optimality equation for Q∗.
Q∗(s,a)=∑s′P(s′∣s,a)[R(s,a)+γmaxa′Q∗(s′,a′)].
Write the Q-learning update rule.
Q(s,a)←Q(s,a)+α[r+γmaxa′Q(s′,a′)−Q(s,a)].
What is the TD error?
δ=r+γmaxa′Q(s′,a′)−Q(s,a): the gap between Bellman target and current estimate.
Why is Q-learning called "model-free" and "off-policy"?
Model-free: it samples real transitions instead of using P. Off-policy: the max target learns the optimal policy while exploring with a different (ε-greedy) policy.
Difference between Q-learning and SARSA in the target?
Q-learning uses maxa′Q(s′,a′); SARSA uses Q(s′,a′) for the action actually taken next.
How do you recover the optimal policy from Q∗?
π∗(s)=argmaxaQ∗(s,a).
What does ε-greedy balance?
Exploration (random actions) vs exploitation (greedy best-known action).
Given α=0.5,γ=0.9,Q=2,r=1,maxQ′=6, new Q?
target=1+0.9⋅6=6.4, δ=4.4, Q←2+0.5⋅4.4=4.2.
Recall Feynman: explain to a 12-year-old
Imagine a video game where you don't get points immediately — sometimes the good move now only pays off ten moves later. You keep a scorebook that guesses "how many points can I eventually get if I press this button in this situation?" Every time you play, you peek at where you ended up, see how many points you could get from there, and gently fix your guess to be a little more correct. Do this thousands of times and your scorebook tells you the best button for every situation — even though nobody ever told you the rules of the game. That scorebook is Q, and fixing-your-guess is Q-learning.
Dekho, Reinforcement Learning ka core idea simple hai: ek agent (maano autopilot) kisi environment mein actions leta hai, aur turant answer nahi milta — sirf reward milta hai, kabhi late bhi. Problem yeh hai ki abhi liya gaya action future ke rewards ko affect karta hai (smooth landing tabhi hoga jab tumne kai steps pehle sahi throttle diya). Isko model karne ke liye hum MDP use karte hain: states, actions, transition probability P, reward R, aur discount γ. Markov property ka matlab — future sirf current state pe depend karta hai, poori history yaad rakhne ki zaroorat nahi, bas state mein saari relevant cheezein (velocity, angle) daal do.
Bellman equation bas ek recursion hai: aaj ki value = abhi ka reward + γ times "jahan pahuchoge uski value". Yeh peeche ki taraf value propagate karta hai — goal ka reward slowly-slowly pichhle states tak pahuchta hai, har step pe γ se multiply hote hue. Isiliye door ka reward bhi aaj ke decision ko guide karta hai.
Q-learning ka magic yeh hai ki humein P (physics model) pata hone ki zaroorat nahi. Turbulence, unknown dynamics — koi baat nahi. Bas real experience (s,a,r,s′) se seekho: target banao r+γmaxa′Q(s′,a′), apne purane guess se compare karo (yeh gap hai TD error), aur chhota sa step α lo target ki taraf. Yeh baar-baar karo, aur Q table batayega har situation mein best action. Exploration ke liye ε-greedy use karo — kabhi-kabhi random action, warna tum apne early galat estimate mein hi phas jaoge. Aerospace mein guidance, control, aur autonomous decision-making ke liye yeh foundational hai.
Test yourself — Machine Learning (Aerospace Applications)