figure indicates that the true long-run average reward lies between and with high confidence more preciselythe bootstrap confidence interval (percentile methodis here ( the following python script spells out the procedure ratioest py import numpy as np matplotlib pyplot as plt seaborn as sns from numba import jit np random seed ( np array ([[ [ , ][ ][ ]] np array ([ , , , ]corg np array (np zeros (( , ))rorg np array (np zeros (( , ))rho = @jit (#for speed -upsee appendix def generate_cyclereward ( )for in range ( ) = xreg regenerative state (out of , , , reward [ xnp amin(np argwhere (np cumsum ( [xreg - ,:]np random rand ()) while !xregt + reward +rho **( - )* [ - np amin(np where (np cumsum ( [ - ,:]np random rand ()) corg[it rorg[ireward return corg rorg corg rorg generate_cyclereward (naorg np mean(rorg)/np mean(corgk np array (np zeros (( , )) np array (np zeros (( , )) np array (np zeros (( , ))for in range ( )ind np ceil( *np random rand ( , )astype (int)[ - corg[indr rorg[inda[inp mean( )/np mean(cplt xlabel ('long -run average reward 'plt ylabel ('density 'sns kdeplot ( flatten (,shade =trueplt show (