Answers.Body: <blockquote>
    <p>Isn't the environment constantly changing in this game?</p>
  </blockquote>
  
  <p>The current state of the agent and the environment is constantly changing as you play, but not necessarily the transition probabilities. For simplicity, you may assume that the transition probabilities do not change (e.g. if the dealer and the deck are the same every time you play).</p>
  
  <blockquote>
    <p>How would the transition probabilities be fixed in such an environment, when both you and the dealer draw cards?</p>
  </blockquote>
  
  <p>The actions of the dealer will be incorporated into the transition probabilities of the environment. Whenever the player (or RL agent) takes an action, then it will receive a reward, according to the reward function of the environment (the rules of the game), and the agent and the environment will be moved to the next state, according to the transition probabilities, which do not have to change for stochasticity to occur in the environment. In fact, these transition probabilities already incorporate this stochasticity.</p>
  
  <p>Also, if even the environment was changing, you could still model your problem as an MDP, but the MDP would change accordingly.</p>
  
  <p>The <a href="https://web.stanford.edu/class/psych209/Readings/SuttonBartoIPRLBook2ndEd.pdf#page=129" rel="nofollow noreferrer">example 5.1 of the book</a> (that you mention) actually explains in detail how to formulate this game as a finite MDP.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-09T12:01:02.227Z
Answers.Text: In fact the book ignores drawn cards and (unrealistically) assumes drawing with replacement, because it is simpler to formulate. Drawing without replacemant still results in a valid MDP as you suggest, but the state model becomes far more complex for little gain when used as a teaching example
Answers.UserDisplayName: Neil Slater
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-09T11:37:28.120Z
Answers.LastActivityDate: 2020-05-09T11:37:28.120Z
Answers.UserDisplayName: nbro
Body: <p>I am reading <a href="https://web.stanford.edu/class/psych209/Readings/SuttonBartoIPRLBook2ndEd.pdf" rel="nofollow noreferrer">sutton barton's reinforcement learning textbook</a> and have come across the finite Markov decision process (MDP) example of the blackjack game (Example 5.1). </p>
  
  <p>Isn't the environment constantly changing in this game? How would the transition probabilities be fixed in such an environment, when both you and the dealer draw cards?</p>
  
Tags: <reinforcement-learning><markov-decision-process>
Title: How can blackjack be formulated as a Markov decision process?
UserDisplayName: calveeen
ThreadText: # How can blackjack be formulated as a Markov decision process?
  
  (Asked by: username_0 on 2020-05-09)
  
  I am reading [sutton barton's reinforcement learning textbook](https://web.stanford.edu/class/psych209/Readings/SuttonBartoIPRLBook2ndEd.pdf) and have come across the finite Markov decision process (MDP) example of the blackjack game (Example 5.1).
  
  Isn't the environment constantly changing in this game? How would the transition probabilities be fixed in such an environment, when both you and the dealer draw cards?
  
  **Tags:** reinforcement-learning, markov-decision-process
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-05-09. Score: 2 | Accepted answer
  
  > Isn't the environment constantly changing in this game?
  
  The current state of the agent and the environment is constantly changing as you play, but not necessarily the transition probabilities. For simplicity, you may assume that the transition probabilities do not change (e.g. if the dealer and the deck are the same every time you play).
  
  > How would the transition probabilities be fixed in such an environment, when both you and the dealer draw cards?
  
  The actions of the dealer will be incorporated into the transition probabilities of the environment. Whenever the player (or RL agent) takes an action, then it will receive a reward, according to the reward function of the environment (the rules of the game), and the agent and the environment will be moved to the next state, according to the transition probabilities, which do not have to change for stochasticity to occur in the environment. In fact, these transition probabilities already incorporate this stochasticity.
  
  Also, if even the environment was changing, you could still model your problem as an MDP, but the MDP would change accordingly.
  
  The [example 5.1 of the book](https://web.stanford.edu/class/psych209/Readings/SuttonBartoIPRLBook2ndEd.pdf#page=129) (that you mention) actually explains in detail how to formulate this game as a finite MDP.
  
  > **Comments:**
  > **username_2**: In fact the book ignores drawn cards and (unrealistically) assumes drawing with replacement, because it is simpler to formulate. Drawing without replacemant still results in a valid MDP as you suggest, but the state model becomes far more complex for little gain when used as a teaching example  
  
  ---
  
  