Module contents
Lesson 36 of 37Research 110 min

RL theory: sample complexity, regret in MDPs and function approximation

Study how much data decision learning requires: prove the simulation lemma, derive sample complexity with a generative model, examine PAC-MDP exploration and tabular episodic regret, and assess guarantees and limits under function approximation, coverage, and Bellman completeness.

After this lesson you can

  • Prove the simulation lemma and derive the empirical model's sample complexity.
  • Explain PAC-MDP exploration with R-max.
  • Outline the UCBVI regret proof and compare it with the lower bound.
  • Describe linear MDPs and the LSVI-UCB algorithm.
  • Identify assumptions of realizability, completeness, and coverage and what fails without them.

Before you start

Data for decision-making

How many interactions are enough to obtain a good policy? The answer depends on what information the agent can request, how loss is measured, and the structure of the environment. A generative model allows queries for any state-action pair; an online agent only observes transitions it reaches by acting. A PAC guarantee bounds how many decisions can be bad with high probability; a regret guarantee sums losses over a sequence of episodes. Neither automatically describes training with neural networks, correlated data, or misspecified rewards.

In this lesson we start with finite MDPs, rewards in [0,1][0,1], and discount 0<γ<10<\gamma<1, as in value iteration. We then move to undiscounted episodes with horizon HH. Do not replace HH with 1/(1−γ)1/(1-\gamma) in a theorem without checking its model and assumptions. Asymptotic bounds hide constants and logarithms: they compare dependencies rather than promise the exact number of trials in a particular environment.

InteractiveVisits, optimism, and regret
s0
47 visits
b=5.97
s1
26 visits
b=8.02
s2
10 visits
b=10.00
s3
14 visits
b=10.00
s4
7 visits
b=10.00
s5
5 visits
b=10.00
s6
5 visits
b=10.00
s7
2 visits
b=10.00
s8
3 visits
b=10.00
  • UCBVI hoeffding
  • ε-greedy Q-learning

Actual laboratory data: 3×3 grid, horizon 10, seed 0. The map calculates the next episode’s Hoeffding bonus from cumulative visits; it does not show the Bernstein bonus. The line subtracts observed returns from V* and may decrease by chance.

50
Action
Trajectory
Realized UCBVI regret254.7
Realized Q-learning regret215.7
Select an action and an episode from a reproducible run. The map calculates a Hoeffding bonus from visits in the selected trajectory; the line shows realized regret, not a theoretical bound.

The simulation lemma

Let M=(P,r,γ)M=(P,r,\gamma) and M^=(P^,r^,γ)\widehat M=(\widehat P,\widehat r,\gamma) share the same states and actions. For any fixed policy π\pi, assume ∣r(s,a)−r^(s,a)∣≤ϵr|r(s,a)-\widehat r(s,a)|\leq\epsilon_r and ∥P(⋅∣s,a)−P^(⋅∣s,a)∥1≤ϵP\|P(\cdot\mid s,a)-\widehat P(\cdot\mid s,a)\|_1\leq\epsilon_P for all pairs. In this form, the simulation lemma gives

∥VMπ−VM^π∥∞≤ϵr1−γ+γϵP(1−γ)2.\|V_M^\pi-V_{\widehat M}^\pi\|_\infty \leq \frac{\epsilon_r}{1-\gamma}+\frac{\gamma\epsilon_P}{(1-\gamma)^2}.

To prove it, subtract the Bellman equations: VMπ−VM^π=(rπ−r^π)+γPπ(VMπ−VM^π)+γ(Pπ−P^π)VM^πV_M^\pi- V_{\widehat M}^\pi=(r_\pi-\widehat r_\pi)+\gamma P_\pi(V_M^\pi-V_{\widehat M}^\pi)+\gamma(P_\pi-\widehat P_\pi)V_{\widehat M}^\pi. The norm of the last value is at most 1/(1−γ)1/(1-\gamma), since rewards lie in [0,1][0,1]. A stochastic transition does not amplify the supremum norm. Rearranging the term γ∥VMπ−VM^π∥∞\gamma\|V_M^\pi-V_{\widehat M}^\pi\|_\infty yields the inequality. This version uses L1 distance, not total variation; if TV is defined as half of L1, adjust the factor.

The bound holds simultaneously for all policies if model errors are uniform. Let π^\widehat\pi be optimal in M^\widehat M and π∗\pi^* be optimal in MM. Inserting and subtracting both values in M^\widehat M gives a nonpositive middle term by the optimality of π^\widehat\pi. The loss in MM is bounded by twice the uniform evaluation error. This transfer remains valid even if π^\widehat\pi was chosen using the data, because the accuracy event is uniform over policies.

That uniformity explains both the reliability and the pessimism of the proof. The bound requires accurate estimates even for pairs the optimal policy never visits. If you only want to evaluate a fixed policy from an initial distribution, an occupancy-weighted bound can be much more informative, but it must control the mismatch between the distributions generating data and those visited by that policy. Taking the maximum over all states protects against the worst initial state; an average under a particular initial distribution answers a different question.

The inequality also separates two sources of error. An incorrectly estimated reward accumulates as 1/(1−γ)1/(1-\gamma), while a transition error can change the distribution of all future values and in this proof brings another power of the effective horizon. If the model learns random rewards, their means must also be concentrated and the corresponding term added. The cell below takes rewards as known precisely to isolate transition error: it does not present a nonexistent reward estimate as a measurement.

A generative model and its cost

A generative model returns independent transition samples for the queried pair, without paying the cost of reaching it from the initial state. This is not the same interface as online interaction. Assume known rewards and nn independent samples per pair. For any subset of states, the difference between empirical and true probabilities is controlled by Hoeffding. A union over 2S2^S subsets and SASA pairs, followed by ∥p−q∥1=2sup⁡B∣p(B)−q(B)∣\|p-q\|_1=2\sup_B|p(B)-q(B)|, gives with probability at least 1−δ1-\delta a bound of order

ϵP=O ⁣(S+log⁡(SA/δ)n).\epsilon_P=O\!\left(\sqrt{\frac{S+\log(SA/\delta)}{n}}\right).

Inserting this into the lemma and policy transfer gives the sufficient condition n=O~(S/[ϵ2(1−γ)4])n=\widetilde O(S/[\epsilon^2(1-\gamma)^4]) per pair, or O~(S2A/[ϵ2(1−γ)4])\widetilde O(S^2A/[\epsilon^2(1-\gamma)^4]) total samples. This is a conservative direct proof. For S=100S=100, A=4A=4, γ=0.9\gamma=0.9, and ϵ=0.1\epsilon=0.1, its expression per pair without constants or logarithms is 100/(0.12⋅0.14)=108100/(0.1^2\cdot0.1^4)=10^8. That is not the number certified by the theorem: constants and confidence have been omitted.

More refined analyses exploit variance and dependence structure; under the corresponding regimes and assumptions, the total minimax order for a discounted MDP and generative model is Θ~(SA/[ϵ2(1−γ)3])\widetilde\Theta(SA/[\epsilon^2(1-\gamma)^3]). A recent result on planning with the empirical model is stated with its precise assumptions by Zurek and Chen. The simple fourth-power bound is not a lower bound and does not refute the cubic one: it is a looser sufficient guarantee. The figure compares orders with constants fixed at one and separately shows a small experiment that does not prove a minimax law.

The union over subsets is one concrete way to obtain a simultaneous guarantee. For a fixed subset, each sample gives an indicator variable in [0,1][0,1] and Hoeffding controls its mean. There are 2S2^S possible subsets, so their logarithm contributes Slog⁡2S\log 2, not 2S2^S samples. The event is then unioned over the SASA pairs. The identity relating L1 to twice total variation applies to normalized probability distributions; it would not hold without that assumption. Substituting the accuracy required for two evaluation errors to sum to at most ϵ\epsilon produces the fourth power and the factor SS in this proof.

The effective horizon is a scale of discounted accumulation: 1+γ+γ2+⋯=1/(1−γ)1+\gamma+\gamma^2+\cdots=1/(1-\gamma). It equals 10 for γ=0.9\gamma=0.9 and 100 for 0.990.99. All else fixed, the fourth-power expression changes by a factor of 10000 between those discounts; the cubic expression changes by 1000. This comparison of formulas does not imply that a particular environment requires exactly those factors. An environment with deterministic transitions or a large gap between actions can be much easier than the worst-case family.

InteractiveTheoretical scaling and a finite trial

The simple model uses S²A/[ε²(1−γ)⁴]; the minimax order uses SA/[ε²(1−γ)³], under assumptions and logarithms given in the text. These are not certified figures with constants set to 1. The curve comes from six MDPs with S=5, A=3 and known rewards; it does not change with S, A or ε.

100
4
0.90
0.10
Experiment: γ
Effective horizon10.00
Simple model: total order4.00e+10
Minimax: total order4.00e+7
The upper controls change order expressions; the curve comes from six MDPs with five states, three actions, and known rewards.

Exploring while learning

A PAC-MDP guarantee controls, with probability at least 1−δ1-\delta, the number of steps in which the value of the algorithm’s behavior from the current state is more than ϵ\epsilon below optimal. The dependence must be polynomial in the specified parameters. This differs from saying that one final policy is good after nn generative queries and from controlling cumulative regret. Strehl and colleagues distinguish these formulations.

R-max maintains an empirical model for pairs visited at least mm times. Unknown pairs are replaced with a fictitious continuation with maximum reward. It solves the optimistic model and acts: either the policy visits an unknown pair with enough probability to learn it, or it behaves nearly the same in the optimistic and real models, so optimism implies near optimality. The bound requires precise concentration bounds, a threshold, and a planning criterion; choosing m=4m=4 in the figure is only a demonstration. R-max and E³ formalize variants of this idea, each with its own assumptions and criteria.

The idea of a fictitious paradise is optimism under uncertainty: an unknown action may look excellent until sufficient evidence is gathered. Once the threshold is reached, the model replaces that expectation with the observed transition and may change its policy. A sequence of actions with small immediate reward may be chosen because it leads to a still-unknown pair. This exploration is coherent over time, unlike adding a fixed probability of random action in every state. However, poorly calibrated optimism or deterministic tie-breaking can make a small example explore very slowly.

E³ explicitly separates reasoning about exploiting known regions from searching for unknown ones; R-max encodes the search in a single optimistic model. The proofs for both algorithms control the probability that a trajectory leaves the known set and the number of times a pair can yield information before crossing the threshold. The representation of paradise depends on the horizon or return criterion: maximum reward for the remaining steps in the episodic lab is not a literal implementation of every published version for average reward or infinite discounting.

InteractiveA chain with an optimistic model
0
1
2
3
4
5
6
7
8

Episode 1, step 1; action 0. At the start of the episode, a pair with fewer than four visits is modeled as reward 1 for the remaining steps. The policy remains fixed until the next episode. True state 8 pays 1 per step.

0
Step 1 of 10
Pair at planning timeUnknown
Visits at planning / now0 / 0
Transition / reward0 → 0 / 0
The trajectory comes from R-max in the lab. At each step, current visits are compared with those present when the episode was planned.

Episodic regret and UCBVI

In KK episodes of HH steps, T=KHT=KH, pseudo-regret loss is ∑k=1K[V1∗(sk,1)−V1πk(sk,1)]\sum_{k=1}^K[V_1^*(s_{k,1})-V_1^{\pi_k}(s_{k,1})]. The policy πk\pi_k can depend on the previous history. Subtracting observed returns instead of expected values produces a random quantity that can decrease from one episode to the next. The lab reports that second quantity, realized regret, because it compares directly against sampled trajectories.

UCBVI estimates transitions, computes an optimistic value by backward induction, and adds a bonus that decreases with visits. A Hoeffding-style version uses a scale proportional to H/N(s,a)H/\sqrt{N(s,a)}; a Bernstein version exploits the variance of next values and additional safety terms. Optimism must hold on a high-probability event with appropriate constants, clipping, and corrections. The simplified bonuses in the lab illustrate the mechanism; they do not literally implement the proof by Azar, Osband and Munos.

The proof sketch has three pieces. First, concentration controls transition error applied to relevant values and supports optimism by backward induction. Second, the difference between optimistic value and policy return decomposes into bonuses and martingale differences. Third, sums such as ∑i=1n1/i≤2n\sum_{i=1}^n1/\sqrt i\leq2\sqrt n and Cauchy–Schwarz control accumulation over pairs. The adaptive dependence of estimated values on the same samples requires additional arguments: applying Hoeffding to a function chosen after seeing the data is not enough.

The Bernstein result of Azar and colleagues includes lower-order terms and, in the regime specified by its authors, reaches O~(HSAT)\widetilde O(\sqrt{HSAT}), matching the lower bound Ω(HSAT)\Omega(\sqrt{HSAT}) up to logarithms. Do not omit the lower-order terms outside that regime. Jin and colleagues show that episodic optimistic Q-learning can reach regret O~(H3SAT)\widetilde O(\sqrt{H^3SAT}) without a generative model. This is a result about a particular algorithm and steps; asymptotic convergence of tabular Q-learning does not itself imply that finite bound.

To fix the scales, the UCBVI paper gives its Bernstein variant a bound including O~(HSAT+H2S2A+HT)\widetilde O(\sqrt{HSAT}+H^2S^2A+H\sqrt T). Its leading term matches the lower bound in the regime specified in the paper, which includes conditions on T,S,A,HT,S,A,H. The Hoeffding-based variant has leading dependence O~(HSAT)\widetilde O(H\sqrt{SAT}) in that analysis. Low variance can reduce the Bernstein bonus, but the published algorithm contains corrections for statistical dependence and estimated values; changing only the square root in educational code does not reproduce the theorem.

Cumulative regret gives weight to the whole learning trajectory. A bound o(T)o(T) implies that average loss per step tends to zero under the criterion considered, but does not guarantee that every episode is good. The PAC property instead counts decisions whose loss exceeds a fixed threshold. Both can be studied for the same algorithm, although their quantifiers and results are not interchangeable. Bandit UCB is a simpler case: in an MDP an action also changes future states, so uncertainty propagates through Bellman.

Approximation and limits

A linear MDP requires more than representing Q∗Q^* linearly. For known features ϕ(s,a)∈Rd\phi(s,a)\in\mathbb R^d, it assumes that reward and transition are expressed using appropriate linear parameters: rh(s,a)=ϕ(s,a)⊤θhr_h(s,a)=\phi(s,a)\T\theta_h and Ph(⋅∣s,a)=ϕ(s,a)⊤μh(⋅)P_h(\cdot\mid s,a)=\phi(s,a)\T\mu_h(\cdot), with norm conditions and valid distributions. In LSVI-UCB, regularized regression fits each stage and adds a bonus proportional to ϕ⊤Λ−1ϕ\sqrt{\phi\T\Lambda^{-1}\phi}, analogous to LinUCB. The elliptical potential helps sum uncertainties. Under the assumptions of Jin and colleagues, regret is O~(d3H3T)\widetilde O(\sqrt{d^3H^3T}); this is not a guarantee for any network with a final linear layer.

Realizability says a target function belongs to a class. Bellman completeness requires applying the relevant operator to functions in the class to produce functions representable in the class, under the definition and assumptions of the particular result. Coverage requires the data to have enough support over decisions whose quality is to be evaluated or improved. These are distinct properties. The lower bound with linear realizability of Weisz, Amortila and Szepesvári shows hard instances even with linear Q∗Q^* and access to the type of generative model in their formulation; it does not contradict the linear MDP theorem, which imposes additional transition structure.

In offline RL, imagine two bandits identical in the data because the behavior never tries action 1. In one environment that action pays 0 and in another it pays 1; without an additional assumption the data cannot distinguish which is true. A uniform guarantee for the best action cannot come from observations that never cover the relevant action. The Bellman–Eluder dimension of Jin, Liu and Miryoosefi quantifies another form of complexity for function classes under specific assumptions, not a number that can automatically be assigned to any architecture.

The design matrix Λ=λI+∑iϕiϕi⊤\Lambda=\lambda I+\sum_i\phi_i\phi_i\T summarizes feature directions seen in a regularized linear regression. The norm ϕ⊤Λ−1ϕ\sqrt{\phi\T\Lambda^{-1}\phi} is large in poorly covered directions and small in well-observed ones. This uncertainty does not mean that every pair with similar features has been observed separately: transfer between them depends on the linear model being correct. If features do not describe transitions, the regression bonus can be small around a systematically biased prediction.

Bellman completeness refers to a particular family and operator, and can be stated exactly or approximately. Realizability of Q∗Q^* identifies only one member of that family; it does not guarantee that intermediate updates remain in it. The local-planning counterexample with linear Q∗Q^* uses a specific access model and class; it does not claim that every linear problem is exponentially hard. When reading a lower bound, check what the algorithm may query, the required error, and whether global or only local model access is allowed.

For policy gradients, tabular global convergence uses parameterization structure, gradient access, and coverage or distribution-mismatch conditions. A training distribution that rarely visits states important to the target policy can make the concentrability factor large. Estimated gradients, critic approximation, and networks do not automatically inherit the exact theorem; see Agarwal and colleagues.

Lab: exploring chains and grids

Transitions are stochastic and rewards are known. We compare educational UCBVI with Hoeffding- or Bernstein-style bonuses, R-max, Q-learning with ϵ=0.1\epsilon=0.1, and PSRL with a Dirichlet prior. Each episode begins in state 0 and lasts ten steps. The bonus is clipped to remaining return and optimistic ties are broken randomly with an explicit seed; reward uncertainty is not modeled in this version. R-max treats a pair as known after four visits. The results are realized returns, not policy expected values or proof of bounds.

[ ]Episodic algorithms from scratchBrowser
import numpy as np

def environment(kind):
    side=3;s=9;a=4;h=10
    p=np.zeros((s,a,s));r=np.zeros((s,a))
    for state in range(s):
        row,col=divmod(state,side)
        for action,(dr,dc) in enumerate(((-1,0),(1,0),(0,-1),(0,1))):
            if kind=='cadena':
                intended=min(8,state+1) if action==1 else max(0,state-1) if action==0 else state
            else:
                intended=3*min(2,max(0,row+dr))+min(2,max(0,col+dc))
            p[state,action,intended]+=.85;p[state,action,state]+=.15
            r[state,action]=float(state==8)
    return p,r,h

def plan(p,r,h):
    s,a=r.shape;v=np.zeros((h+1,s));pi=np.zeros((h,s),dtype=int)
    for t in range(h-1,-1,-1):
        q=r+p@v[t+1];pi[t]=q.argmax(axis=1);v[t]=q.max(axis=1)
    return v,pi

def experiment(kind,algorithm,seed,episodes=120):
    p,r,h=environment(kind);s,a=r.shape;rng=np.random.default_rng(seed)
    count=np.zeros((s,a),dtype=int);trans=np.zeros((s,a,s),dtype=int)
    qlearn=np.full((h,s,a),h,dtype=float);vstar,_=plan(p,r,h)
    def tie_break(values):
        maximum=values.max(axis=1,keepdims=True)
        eligible=np.isclose(values,maximum,rtol=0,atol=1e-12)
        return (rng.random(values.shape)*eligible).argmax(axis=1)
    cumulative=0.;curve=[];history=[];trajectory=[]
    for episode in range(episodes):
        counts_at_plan=count.copy()
        empirical=trans/np.maximum(count[:,:,None],1)
        if algorithm=='psrl':
            model=np.empty_like(p)
            for i in range(s):
                for j in range(a):model[i,j]=rng.dirichlet(trans[i,j]+1)
            _,policy=plan(model,r,h)
        elif algorithm=='rmax':
            known=count>=4;v=np.zeros((h+1,s));policy=np.zeros((h,s),int)
            for t in range(h-1,-1,-1):
                values=np.where(known,r+empirical@v[t+1],h-t)
                policy[t]=tie_break(values);v[t]=values.max(axis=1)
        elif algorithm in ('hoeffding','bernstein'):
            v=np.zeros((h+1,s));policy=np.zeros((h,s),int)
            for t in range(h-1,-1,-1):
                mean=empirical@v[t+1];n=np.maximum(count,1)
                if algorithm=='hoeffding': bonus=(h-t)*np.sqrt(2*np.log(2+s*a*episodes)/n)
                else:
                    variance=np.maximum(0,empirical@(v[t+1]**2)-mean**2)
                    bonus=np.sqrt(2*variance*np.log(2+s*a*episodes)/n)+3*(h-t)*np.log(2+s*a*episodes)/n
                values=np.minimum(h-t,r+mean+bonus)
                policy[t]=tie_break(values);v[t]=values.max(axis=1)
        state=0;episode_return=0.
        for t in range(h):
            if algorithm=='qlearning':
                action=int(rng.integers(a)) if rng.random()<.1 else int(tie_break(qlearn[t,state][None,:])[0])
            else: action=int(policy[t,state])
            before=int(count[state,action]);previous=state
            nxt=int(rng.choice(s,p=p[state,action]));reward=r[state,action];episode_return+=reward
            count[state,action]+=1;trans[state,action,nxt]+=1
            if algorithm=='qlearning':
                target=reward+(qlearn[t+1,nxt].max() if t+1<h else 0)
                qlearn[t,state,action]+=.3*(target-qlearn[t,state,action])
            trajectory.append([episode,t,previous,action,before,nxt,int(reward),int(counts_at_plan[previous,action])])
            state=nxt
        cumulative+=vstar[0,0]-episode_return;curve.append(cumulative);history.append(count.copy())
    return np.array(curve),count,np.stack(history),np.array(trajectory)

Run each environment separately. The figure uses seed 0 and retains the counts from that trajectory; a single seed is not enough to declare an algorithm superior.

[ ]Chain: five methodsBrowser
for method in ('hoeffding','bernstein','rmax','qlearning','psrl'):
    curve,counts,history,trajectory=experiment('cadena',method,0)
    print(method,'regret realizado',round(float(curve[-1]),3),'visitas',int(counts.sum()))
[ ]Grid: five methodsBrowser
for method in ('hoeffding','bernstein','rmax','qlearning','psrl'):
    curve,counts,history,trajectory=experiment('grid',method,0)
    print(method,'regret realizado',round(float(curve[-1]),3),'visitas',int(counts.sum()))

Each algorithm receives its own generator, so the same seed number reproduces each run but does not force paired transitions when different actions are chosen. Very conservative optimism can keep many values clipped and cause Hoeffding and Bernstein bonuses to produce identical trajectories in this example. These numbers are not evidence of UCBVI constants or a general ranking. PSRL samples independent Dirichlet transitions and plans in the sampled model; this is the tabular version related to posterior exploration.

Lab: querying the model

We generate six small MDPs with five states, three actions, and known rewards. For each sample size we query each pair the same number of times, estimate transitions, calculate an optimal policy of the empirical model, and evaluate it exactly in the true model. Error is the largest loss over initial states. Samples for different sizes are generated anew: they are not nested prefixes and the curve need not be monotonic in every run. The exact reference solves a linear system for the chosen policy.

[ ]Empirical model and true evaluationBrowser
import numpy as np

def optimal(p,r,gamma):
    v=np.zeros(len(r))
    for _ in range(5000):
        q=r+gamma*p@v;new=q.max(axis=1)
        if np.max(np.abs(new-v))<1e-10:break
        v=new
    return new,q.argmax(axis=1)

def value(p,r,pi,gamma):
    idx=np.arange(len(pi));return np.linalg.solve(np.eye(len(pi))-gamma*p[idx,pi],r[idx,pi])

def run(gamma,n,seed):
    rng=np.random.default_rng(seed);s=5;a=3
    p=rng.dirichlet(np.ones(s),size=(s,a));r=rng.uniform(0,1,size=(s,a))
    _,optimal_policy=optimal(p,r,gamma);true=value(p,r,optimal_policy,gamma)
    sampled=np.empty_like(p)
    for i in range(s):
        for j in range(a):sampled[i,j]=rng.multinomial(n,p[i,j])/n
    _,pi=optimal(sampled,r,gamma);estimated=value(p,r,pi,gamma)
    return max(0.,float(np.max(true-estimated)))
[ ]Six MDPs with discount 0.7Browser
for n in (5,20,80,320,1280):
    losses=[run(.7,n,seed) for seed in range(6)]
    print('muestras por par',n,'pérdida media',round(float(np.mean(losses)),6),'máxima',round(float(max(losses)),6))
[ ]Six MDPs with discount 0.9Browser
for n in (5,20,80,320,1280):
    losses=[run(.9,n,seed) for seed in range(6)]
    print('muestras por par',n,'pérdida media',round(float(np.mean(losses)),6),'máxima',round(float(max(losses)),6))
[ ]Six MDPs with discount 0.97Browser
for n in (5,20,80,320,1280):
    losses=[run(.97,n,seed) for seed in range(6)]
    print('muestras por par',n,'pérdida media',round(float(np.mean(losses)),6),'máxima',round(float(max(losses)),6))

The figure uses those same numbers, not new samples. With six random instances, known rewards, and a space of only five states, observed loss can be zero much earlier than the worst-case bound. Changing the discount changes both the weight of future transitions and policy values; comparing these few instances does not identify a statistical power of the horizon.

Exercises

Proof
Prove: Prove this version of the simulation lemma for a fixed policy.
0
Two finite MDPs share γ∈(0,1), policy π, and rewards in [0,1]. Their uniform reward and L1 transition errors are εr and εP.

Step 1 of 3. When subtracting Bellman equations, what appears besides immediate error?

Proof
Prove: Explain the structure of an optimistic regret proof.
0
Assume a high-probability event where bonuses control the errors needed for each update.

Step 1 of 3. What property is proved backward in each episode?

Numeric
For S=100, γ=0.9 and ε=0.1, what is S/[ε²(1−γ)⁴], omitting constants and logarithms?
Quiz
Which statements about assumptions are correct?

More than one answer may be correct.

Code
Implement valor_politica(P,r,pi,gamma) for a finite discounted MDP. P has shape (S,A,S), r has shape (S,A), pi contains one integer action per state, and 0≤gamma<1. Solve the Bellman linear system exactly without changing the inputs.
import numpy as np
def valor_politica(P,r,pi,gamma):
  pass
Shift+Enter to run
Key idea
An RL guarantee has a data interface, a criterion, a model class, and a probability event. Differences between those elements explain why apparently contradictory results can be compatible.