P, Q, R and S are four towns. One can travel between P and Q along 3 direct paths, between Q and S along 4 direct paths, and between P and R along 4 direct paths. There is no direct path between P and S, while there are few direct paths between Q and R, and between R and S. One can travel from P to S either via Q, or via R, or via Q followed by R, respectively, in exactly 62 possible ways. One can also travel from Q to R either directly, or via P, or via S, in exactly 27 possible ways. Then, the number of direct paths between Q and R is
Solution
Let Q–R have x paths and R–S have y paths.
P to S: 3×4+4y+3xy=62⇒y(4+3x)=50.
Q to R: x+3×4+4y=27⇒x+4y=15.
Try y=2: x=7, and 2(4+21)=50 ✓.
Direct Q–R paths =7.
Answer: 7