Skip to content

4. Markov-decision-process

A Markov decision process formalizes sequential decision making with states, actions, rewards and transition probabilities. Use it to set up value and policy iteration, and as the base model that reinforcement learning methods optimize.

Reading time
9 min
Length
1,705 words
Updated
Sep 15, 2026
Total views
--

1. Preliminaries โ€‹

(1) Counting Measure โ€‹

We define the Counting Measure[1] in mathematics, the counting measure can be defined on any measurable space (for example, the set X on any Sigma-algebra, see Definition. sigma-algebra[2]), but it's often in a countable sets.

In combinatorics theory, we denote the ground set as X, then the ==sigma-algebra== ฮฃ defined by such ground set X is given by :

(1.1.1)ฮฃโŠ‚P(X)

Where P(X), or 2X means the power set of X[3] (to be more clean, all of the subsets).

After that, the (X,ฮฃ) forms a positive measure space ฮฃโ†’[0,+โˆž]. Then the counting measure is only ฯƒ-finite if and only if the space X is countable.

Then, the counting measure is the positive measure ฮฃโ†’[0,+โˆž], defined by :

(1.1.2)ฮผ(A)={|A|ifAย is a finite set+โˆžifAย is an infinite set

for all Aโˆˆฮฃ, where |A| is the cardinality(number of elements) of set A.

Notations We often use (X,ฮฃ,ฮผ) to denote a space. For this part, the first parameter is ground set, second is its subsets. Third (optional) is the measure.

(2) Integration on the counting measure โ€‹

1. Discrete representation โ€‹

We take the measure space (N,2N,ฮผ), Take any measurable function f:Nโ†’[0,+โˆž]. it can be ==represented pointwise== as follows :

(1.2.1)f(x)=f(1)+f(2)+โ€ฆf(n)+โ‹ฏ+f(โˆž)

then we got :

(1.2.2)f(x)=โˆ‘n=1โˆžf(n)1{n}(x)=limMโ†’โˆžโˆ‘n=1Mf(n)1{n}(x)โŸฯ•M(x)

where we represent the 1{n} as :

(1.2.3)1{n}(x)={1x= n0otherwise

Here, {n} means a singleton with element n, and each ฯ•M is measurable. apparently, ฯ•M+1(x)=ฯ•M+f(M+1)โ‰ฅฯ•M(x)

2. Integration of function over countable measure โ€‹

From (1.2.2), we know a function f(x) can be represented with ฯ•M(x), i.e., :

(1.2.4)f(x)=limMโ†’โˆžฯ•M(x)ฯ•M(x)=โˆ‘n=1Mf(n)1{n}(x)

here, since ฮผ is countable measure, we have ฮผ({n})=1, so, for any measure ฮผ on the space (X,ฮฃ,ฮผ) :

(1.2.5)โˆซNฯ•Mdฮผ=โˆ‘n=1Mf(n)โˆซN1{n}(x)dฮผ=โˆ‘n=1Mf(n)ฮผ({n})

So we have the integral over the countable measure is :

(1.2.6)โˆซNf(x)dฮผ=โˆ‘n=1โˆžf(n)

We note that, this integration also defines a measure ฮผ~ on (X,ฮฃ) via :

(1.2.7)ฮผ~(A):=โˆ‘aโˆˆAf(a)โˆ€AโˆˆX

the ฮผ~ is a new measure on A, with taking f(x)=1 gives counting measure.

(3) Concepts in the random, probabilistic process and RL โ€‹

These concepts can be found in [4]

STATE : a numeric representation of what the agent is observing at a particular point of time in the environment ACTION : the input the agent provides to the environments, calculated by applying a policy to the current state REWARD : feedback signal from the environment reflecting how well the agent is performing the goals.

The goal is for the current state, choose optimal action to maximize the long-term expected reward provided by the environment.

Such conceptions is also very basic in the control systems, this is. Current State + Action determines the new state [5]

2. Markov-decision-process (MDP) โ€‹

(1) Definition of MDP โ€‹

The reinforced learning is a model for a system evolves as different actions applied to the system. For a Markov decision process (MDP)[6][7], that defined by the following 4-element tuple :

(2.1.1)MDP:ย (S,A,Pa,Ra)

This means : available state, available action, model decision and reward

We describe the Markov decision process as a 4-tuple process where :

  1. S is a set of states called state space
  2. A is a set of actions called action space, and As often refers to the set of actions available from state S.
  3. Pa is a intuitive level, or called Pa(s,sโ€ฒ). For the action a in state s will lead to sโ€ฒ at the time t+1. This is defined to satisfy following relation :
(2.1.2)Pr(st+1โˆˆSโ€ฒ|st=s,at=a)โŸถaction determinedโˆซSโ€ฒPa(s,sโ€ฒ)dsโ€ฒ

Pr describes the ==probability that what probability the next state to reach, under certain state and actions==. This is integral for every Sโ€ฒโŠ‚S measurable. 4. Ra is immediate reward, or expected immediate reward received after action a is taken. and such reward is a general random variable.

Pa(s,sโ€ฒ) is the transition of the system Ra(s,sโ€ฒ) often is 1 when the state after transition is correct.

(2) Simple example โ€‹

A simple example is the robot navigation system (source: [8]):

robotics navigation system

robotics navigation system

For the above robotics navigation task shown in Fig. 2.1, we have :

  1. S is the set of states in the MDP, as the navigation gridworld shows.
  2. A is the actions that robot can take at each state, e.g., โ€œgo forwardโ€, โ€œturn rightโ€, โ€œturn leftโ€, โ€œstay at the same locationโ€.
  3. If we don't know that the robot moves exactly but only up to some approximation, this amounts to defining a transition function that from current state s to a new state sโ€ฒ.
(2.2.1)T:Sร—Aร—Sโ†’[0,1]

such that it's condition probability (here for example forwardโ†’T=0.8, turn rightโ†’T=0.1, so we said โ†’[0,1])

(2.2.2)T(s,a,sโ€ฒ)=P(sโ€ฒ|s,a)

And the transition function is a probability distribution that โˆ‘sโ€ฒโˆˆST(s,a,sโ€ฒ)=1 for all sโˆˆS and aโˆˆA. So in many cases, like (2.1.1), we use P instead of T here.

We can construct a notion using the concept of reward r:Sร—Aโ†’R, we can say that the robot gets a reward r(s,a) if robot takes an action a at state s. Such reward is designed by the user.

(3) Return Factor and Discount Factor โ€‹

For the MDP in (2.1.1), the continues taking actions to result in a trajectory :

(2.3.1)ฯ„=(s0,a0,r0,s1,a1,r1,โ€ฆ)

For each time step t, the robot is at state st, then we define the return of the trajectory as :

(2.3.2)R(ฯ„)=r0+r1+r2+โ€ฆ

The goal is to reach the final state that scores as fast as possible, if we scores at time t, the reward Ra. But if the wanted state is reached at t+1, we set the reward as ฮณRa , we also introduce the discount factor ฮณ, which is often defined by the discount rate r :

(2.3.3)ฮณ=11+r

A lower discount factor makes the decision maker more short-sighted (greedy for recent best solutions). Then the discounted return, or "reward" here, such reward is defined as :

(2.3.4)R(ฯ„)=โˆ‘t=0โˆžฮณtRat

And for a large value of the discount factor, e.g. ฮณ=0.99, then robot is encouraged to explore more and find the best trajectory. A successful value often between ฮณโˆˆ[0.9,0.99]

(4) Optimization Policy & Objective definition โ€‹

The reinforcement learning problem is typically modeled using Markov Decision Processes. We consider that we want the reach a specific final goal. So we determine state of the result as ฯ€(x) by a given policy. The objective as to maximize the cumulative function of the random rewards :

(2.4.1)ฮท(ฯ€)=E[โˆ‘t=0โˆžฮณtRat(st,st+1)]

where at=ฯ€(st), or Actions at each time step is defined given by the policy.

We note another objective function to use is the H, or the step return;

(2.4.2)E[โˆ‘t=0Hโˆ’1Rat(st,st+1)]

3. Bellman Optimality Equation โ€‹

(1) For a determined-state problem โ€‹

Firstly, we represent :

  1. policy value function as Vฯ€(s)
  2. Optimal value function as Vโˆ—(s) (We want to make policy function to approach this)

Bellman Equation[9] helps evaluate the expected reward relative to the advantage or disadvantage of each state. the Value function is defined as :

(3.1.1)Vโˆ—(s)=maxa[R(s)+ฮณVโˆ—(sโ€ฒ)]

here, R is period-specific objective function, V(sโ€ฒ) is the future objective function.

Sometimes, if R is related with a we use :

Vโˆ—(s)=maxa[R(s,a)+ฮณVโˆ—(sโ€ฒ)]

Bellman showed that a dynamicย optimizationย problem inย discrete timeย can be stated in aย recursive, step-by-step form known asย backward inductionย by writing down the relationship between the value function in one period and the value function in the next period.

Here, maxa means the choice of the best possible action. This means, to choose the best possible action, the value is the current response + weighted value of future possible states. For a more general equation, we still need to consider the probability of next option. i.e. adding P(sโ€ฒ|s) into (3.1.1) :

(3.1.2)V(s)=maxa|R(s)+ฮณโˆ‘sP(sโ€ฒ|s,a)V(sโ€ฒ)|

We note in application case, we use (3.1.1) more than (3.1.2)

The often the ideal action is to take the reward from the end state back to the start, which means, the end state has been defined (as ฯ€ later). A comprehensive picture is drawn as follows (the V is calculated by ):

394

The action is to bring us to the highest value function. So it's very easy to find the clean path.

(2) For A stochastic system โ€‹

For example, a consumer with initial wealth endowment s0, he also have instantaneous utility function u(c) (this will determine the objective depends by the consumption, so this is deemed as "reward"), discounts the next period utility at a rate of ฮฒ, and c here denotes the consumption. We should choose a consumption plan, then the current interest rate on the left money in the bank is r.

So the consumer should choose a sequence {ct} ย such a way that their lifetime expected utility is maximized, so we often use following function :

(3.2.1)max{ct}t=0โˆžโˆ‘t=0โˆžฮฒtu(ct)

Then the constraint is :

(3.2.2)st+1=(1+r)(stโˆ’ct)ct>0limtโ†’โˆžatโ‰ฅ0

the value function should be :

(3.2.3)V(s)=max0โ‰คcโ‰คa{u(c)+ฮฒV((1+r)(stโˆ’c))}

References โ€‹


  1. https://en.wikipedia.org/wiki/Counting_measure โ†ฉ๏ธŽ

  2. 1. Sigma-algebra and Lebesgue measure โ†ฉ๏ธŽ

  3. https://en.wikipedia.org/wiki/Power_set โ†ฉ๏ธŽ

  4. https://www.youtube.com/watch?v=14BfO5lMiuk โ†ฉ๏ธŽ

  5. https://en.wikipedia.org/wiki/Optimal_control โ†ฉ๏ธŽ

  6. https://en.wikipedia.org/wiki/Markov_decision_process โ†ฉ๏ธŽ

  7. https://d2l.ai/chapter_reinforcement-learning/mdp.html โ†ฉ๏ธŽ

  8. https://d2l.ai/chapter_reinforcement-learning/mdp.html โ†ฉ๏ธŽ

  9. https://en.wikipedia.org/wiki/Bellman_equation โ†ฉ๏ธŽ