cis32 homework #2

sklar/spring-2006

• The homework is due BY EMAIL on Friday March 24.

• Send the homework to: sklar@sci.brooklyn.cuny.edu as PLAIN TEXT or PDF.

• This homework is worth 6 points in total. The distribution of points is indicated below.

• All of the questions here refer to the robot which is described in lecture #3:

• Here you will get to write a line-following program for this robot in two ways: (1) as a production system and (2) using a neural network.

• clarification added: You can assume that there are no breaks in the line.

and the questions are...

1. (2 points) The robot (represented by the `@` symbol in the figures below) has 4 sensors (one in the front, one in the back and one on each side):
```front
1
4@2
3
back
```
If there is a line under a sensor, the sensor returns 1; otherwise it returns 0. For example:
``` |
@
|
```
returns 1010. If the robot is in the middle of a crossroads, e.g.:
``` |
-@-
|
```
the sensors return 1111.

1a. How many possible states are there? Enumerate them. For convenience in completing the next two steps, label each state (e.g., x1, x2, etc.).

1b. revised and clarified description:
First, define the possible actions for the robot (hint: there are only four). For convenience in completing the next two steps, label each action (e.g., a1, a2, etc.).
Then, define one recommended action for each state.
For example, if the robot is in this state:

``` |
@
|
```
then the robot could either go forward or backward; since it is doing line-following, it won't make sense for it to go left or right (oops---I've just given away all of the possible actions...). You decide whether you prefer for the robot to go forward or backward when it encounters that state; then add that to your list of recommended actions.
Each state should have one recommended action.

2. (2 points) Define a production system (see lecture #3) that the robot can use for doing line-following.

3. (2 points) Define a series of TLU's (see lecture #11) that the robot can use for doing line-following.