ShangtongZhang / reinforcement-learning-an-introduction

Python Implementation of Reinforcement Learning: An Introduction
MIT License
13.45k stars 4.81k forks source link

problem about chapter04/car_rental.py #150

Open shaoeChen opened 3 years ago

shaoeChen commented 3 years ago

image

as show above,
you define a variable POISSON_UPPER_BOUND = 11 ,
and you have a comment , # If n is greater than this value, then the probability of getting n is truncated to 0

image

then the loop, just consider 0 to 10, not 0 to 20,
In fact, we should execute 0-20, but because of probability issues, we only execute 0-10, right?

I just want to confirm that my concept is correct, thank you for your guidance

lmc8133 commented 2 years ago

it's because poisson disstribution has an infinite upper limit, so the author just take a limit of 10 cars. what you said about execute 0-20, it is reflected in this part, it's about all the 400 states 217N~2S77`YD T)DGTZCW9F