a) The choice between the two rooms disqualifies this procedure from being called an algorithm, because algorithms have to be unambiguous.

b) The robot has to perform some particular action. If it is to make a "choice", it has to do so based on algorithmic criteria. It does not have a preference between the rooms. In fact, the choice in the instructions as given is intended to allow you to choose whichever room is less busy, or otherwise more pleasant for the user. If the robot is supposed to choose whichever room is less busy, this should be stated as part of the algorithm.

c) There are many possible ways to do this, but the most obvious is simply to say to go to BA 2220. Alternatively, the criteria for deciding between these two rooms could be explicated as part of the algorithm.


Some student answers were incorrect in a way which I think bears mentioning here. Saying that the instruction should note that "BA" stands for "Bahen Centre" was mentioned by a few students, but this is not helpful -- suppose the robot doesn't know what the "Bahen Centre" is either? There always has to be an assumption as to what steps are "already implemented" (as opposed to your having to write instructions to implement them). The map I have of the U of T St George campus says "BA"; I think that's at least as useful as "Bahen Centre" in finding the building.

Also, some answers basically constituted criticism that the algorithm didn't do something else, e.g. it doesn't tell you what to do in that room, etc. This is not a defect in the algorithm. One algorithm doesn't do everything. The question starts by saying "Suppose that you are writing a procedure to tell someone how to go to the CDF computer labs." That's the basis upon which the algorithm must be judged -- whether or not, if the algorithm is followed, the person will "go to the CDF computer labs".


(press 'back' in your web browser to get back to where you were in the exam)