Assignment 3Due Feb 10 on line
Part of
the homework for CS:2820, Spring 2021
|
a) is wrong because it describes an undirected edge or is the same as c), which is wrong for the same reason d) is wrong, because both describe just one-way links when the street is a two way link.
e) descibes something very complex, where both streets and intersections are vertices in the graph; it must be wrong because edges only go from streets to intersectins, making it impossible to find which streets lead away from an intersection.
b) is right because knowing where a person is at any moment is central to all other things you might do with a person. Where the person is right now determines (based on who else is there now) whether and how likely that person is to get infected right now. As we advance the simulation, where the person is will change, allowing the person to spread the infeciton or get infected.
In contrast, all the others might be relevant to some refinement of the model. a) and d) involve keeping historical records. This might be interesting, but to generate these records, you need to start with where the person is at each time. c) and e) are the kinds of things you might want to use to plan a person's future actions. Nothing we have discussed suggests plans of that complexity but we might want to add such planning in the future.
It must be e), none of the above. None of the other alterntives match the crucial feature of an event: That it describes something that takes place at a single instant. In contrast, a), b) and c) describe things that take time, passing through an intersection may only take a second, while all the others are longer. d) is not an event because it describes a state that may be caused by one or more other vehicles passing through an intersection.
Scanners do everything but d). Perhaps you could write a pattern that describes some set of anticipated misspellings of a word, but people's ability to misspell seems to be unbounded and everyone these days has experienced spelling recognizers that do a far more remarkable job than you could do with just an enumeration of expected misspellings.
All of the above are true except d), which is absolutely false. The && operator is a boolean and, requiring the two operands to be boolean values, either true or false. In contrast, & operator is a bitwise operator that applies to integer values, where 12&5 is 4. (Note that in C and C++, there is no boolean type, boolean values are represented by integers, so both & and && take integer operands. Even so, they do very different things, serving the same purpose they do in Java.