Q-learning Mathematical Background
Prerequisites: Q-Learning.
In the following derivations, the symbols defined as in the prerequisite article will be used.
The Q-learning technique is based on the Bellman Equation.
![]()
where,
E : Expectation
t+1 : next state
: discount factor
Rephrasing the above equation in the form of Q-Value:-
![]()
![]()
The optimal Q-value is given by
![]()
Policy Iteration: It is the process of determining the optimal policy for the model and consists of the following two steps:-
- Policy Evaluation: This process estimates the value of the long-term reward function with the greedy policy obtained from the last Policy Improvement step.
- Policy Improvement: This process updates the policy with the action that maximizes V for each of the state. This process is repeated until convergence is achieved.
Steps Involved:-
- Initialization:
= any real random number
= any A(s) arbitrarily chosen - Policy Evaluation:
while(
)
{
for each s in S
{
}
}
- Policy Improvement:
while(true)
for each s in S
{
if(
)
if(
)
break from both loops
}
return V,
- Value Iteration: This process updates the function V according to the Optimal Bellman Equation.

Working Steps:
- Initialization: Initialize array V by any random real number.
- Computing the optimal value:
while(
)
{
for each s in S
{
}
}
return
Recommended Posts:
- Mathematical explanation for Linear Regression working
- ML | Mathematical explanation of RMSE and R-squared error
- Chi-Square Test for Feature Selection - Mathematical Explanation
- Writing files in background in Python
- Python | Background subtraction using OpenCV
- Background Subtraction in an Image using Concept of Running Average
- Python | Multiple Sliders widgets Controlling Background Screen or WindowColor in Kivy
- Mathematical Functions in Python | Set 4 (Special Functions and Constants)
- Mathematical Functions in Python | Set 3 (Trigonometric and Angular Functions)
- Mathematical Functions in Python | Set 2 (Logarithmic and Power Functions)
- Mathematical Functions in Python | Set 1 (Numeric Functions)
- Change current working directory with Python
- Gradual typing in Python
- How to move Files and Directories in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


