Model a stochastic gym exercise.
An entertaining game for elementary school children in gym class is set up as follows:
- N baskets are placed at various locations on the gym floor, each with a distinguishing picture on them.
- Each basket contains some index cards. Each index card has a destination written on them.
The game proceed as follows: the children gather at a specified start basket. They each take a turn picking a random card from the basket, memorizing the destination, and returning the card before the next child picks one. When the teacher blows the whistle, all the children move to the basket indicated on the notecard.
Given the configuration of index cards at each basket, you are to determine the probabiliites a kindergardener will appear at each basket for the first ten steps of the game.
For example, suppose there are four baskets, "tree," "house," "car" and "park." Each basket has the following index cards:
- The "tree" basket has 2 cards with "tree" on it, 1 card with "house", and 2 cards with "car."
- The "house" basket has 1 card with "tree" on it, 1 card with "car" on it, and 2 cards with "park" on it.
- The "car" basket has 1 card with "tree" on it.
- The "park" basket has one of each card in it.
This arrangement is summarized by the following table:
| destination |
basket | tree | house | car | park |
tree | 2 | 1 | 2 | 0 |
house | 1 | 0 | 1 | 2 |
car | 1 | 0 | 0 | 0 |
park | 1 | 1 | 1 | 1 |
Everyone starts at the tree, so initially,
P0(tree)=1, and P0(else where)=0
In the middle of the game, the probablity of being at some new location is equal to the sum of the probabilities of being at any location on the previous step, times the probablity of moving to the destination location from that past location. For the example,
Ps+1(tree)=0.40*Ps(tree)+0.25*Ps(house)+1.00*Ps(car)+0.25*Ps(park)