English subtitles

← 05-05 Concept Inventory

dummy description

Get Embed Code
1 Language

Showing Revision 1 created 05/13/2012 by Amara Bot.

  1. At the low level--I count as low-level things like the roll of a die,
  2. the implementation of scores,
  3. the implementation of the players and of the player to move,
  4. the goal--so these are all things that we're going to have to represent.
  5. And then at the high level, I'm going to have a function play-pig, that
  6. plays a game between two players,
  7. and I have the notion of a strategy--a strategy that a player is taking
  8. in order to play the game.
  9. Now let's think about how to implement these things,
  10. and when I'm doing the implementation,
  11. I'm going to move top-down.
  12. So I started sort of middle-out saying these are the kinds of things I think I'm going to need;
  13. now I have a good enough feel for them that I feel confident in moving top-down.
  14. I don't see any difficulties in implementing any of these pieces.
  15. If I start at the top, then I'll be able to make choices later on without feeling constrained.
  16. If I thought there was something down here that was difficult to deal with,
  17. I might spend more time now, at the low level, trying to resolve
  18. what the right representation is for one of these difficult pieces,
  19. and that would inform my high-level decisions.
  20. But since I don't see any difficulty, I'm going to jump to the high level.
  21. Now, what's play-pig?
  22. Well, I think that's going to be a function,
  23. and let's just say that its input is two players, A and B,
  24. and we haven't decided yet how we're going to represent those.
  25. And its output is--let's say it's going to be the winner of the game.
  26. Maybe A is the winner.
  27. And we'll have to make a choice of how we represent these players.
  28. Now what's a strategy?
  29. Well, a strategy--people sometimes use the word "policy" for that.
  30. We can also represent that as a function.
  31. And it takes as input a state, and it returns an action or a move in the game.
  32. In this game we said that the actions are roll and hold.
  33. We're starting to move down.
  34. Let's just say now how are we going to represent these actions?
  35. Well, we can call the actions just by strings,
  36. so we use the strings "roll" and "hold"
  37. and that could be what the strategy returns.
  38. But then we'll also need something that implements these actions,
  39. so we'll have to have something that's a function that says--let's say--
  40. the function "roll" takes a state and returns a new state;
  41. function "hold" takes a state and returns a new state.
  42. But that doesn't seem quite right; there's a problem here.
  43. What about the die? That seems to take and effect
  44. that roll by itself is not a function from state to state.
  45. Rather, roll--if we wanted to specify it--would be a function from a state to a set of states,
  46. and that represents the fundamental uncertainty.
  47. That's why we need probability to deal with it.
  48. That's why we have an uncertain or a nondeterministic domain
  49. is because an action doesn't have a single result;
  50. rather, it can have a set of possible results.
  51. And, in some cases it makes sense to go ahead and implement these actions as functions
  52. that look like that, that return sets of states.
  53. And I considered that as a possibility, but I ended up with an implementation
  54. where I talk about the different possibilities for the dice.
  55. So the dice can come up as D, one of the numbers 1 to 6,
  56. and now roll, from a particular state with the particular die roll,
  57. that is going to return a single state rather than a set of states.
  58. And I just think it's easier to deal this way, although in other applications
  59. you might want to deal that way.
  60. Now the rest seems to be pretty easy.
  61. The die can be represented as an integer.
  62. Scores can be represented as integers.
  63. Likewise the goal.
  64. The player to move--we can represent that as an index, 0 or 1,
  65. into an array of players.
  66. And the players themselves?
  67. Well, the simplest way to do it is just to represent the player by their strategy.
  68. The strategy is a function, and that could represent the player.
  69. We could have something more complex,
  70. but it seems like we don't need anything more than that.
  71. So players will be strategy functions.