Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

CS homework. Thank you Background: In the lectures for this week, our descriptio

ID: 3871105 • Letter: C

Question

CS homework. Thank you

Background: In the lectures for this week, our description of a road network assumes that all roads into a particular intersection are interchangable. In fact, this is not true. Coming into the intersection of lowa Avenue and Madison St. from lowa Avenue, there are 3 lanes, a right-turn lane, a left turn lane, and a center lane that can turn either right or left. This means that the lane you enter the intersection on matters because it determines the choice of lanes you have when you exit the intersection. Thus, the file describing a road network must state not merely that road a leads to intersection b, it must state which incoming lane of that intersection it connects to. For example, we might say that road a leads to the eastbound right-turn lane of intersection b. Similarly, while and, or and exclusive or functions are symmetrical, other functions such as the and not function discussed in the previous homework are not. For such functions, we cannot just say that a wire connects to a gate, we must state which input to that gate it connects to. So we might say that wire a connects to the inverting input of gate b. A Problem: Suggest a syntactic notation allowing you to write the fact that a road leads from a specific outgoing lane of one intersection to a specific incoming lane of another (a similar notation could connect a specific output of one logic gate to a specific input another).

Explanation / Answer

Answer: To represent such kind of facts, a triplet or 3-tuple kind of syntactic notation can be used. Such that (a,b,r) where 'a' and 'b' are related entities and 'r' is the relation between them.

Example:

i) For given road intersection example, 'a' will be outgoing road, 'b' will be intersection and 'r' will be "leads to eastbound right-turn lane" and it will be written as (a,b,"leads eastbound right-turn lane").

ii) For given logic gate example, 'a' will be wire, 'b' will be gate, and 'r' will be "connects to the inverting input". This can be written as (a,b,"connects to the inverting input").