Captain dungeness wrote:Nice post Slindur and Haron.
I agree with 1 assumption but not another:
I agree that 3-port routes: 21 options, then 18 options then 15 options (because going to the same resource as the first port would be 'invalid'.
But for 4-port routes there are: 21 options, then 18, then 18, then 15 (an example is Goroum-Hannes-Goroum-Pania 1-2-1-3) the last port can't be the same resource as the first or third port's resource but the 3rd port can be the same as the first resource.
You're wrong about the 4-port routes, Dungeness. And I'm not guessing the answer, I'm STATING the answer
Since so many seem to get this wrong, let me elaborate. This'll probably be too much text, but it seems a lengthy explaination is needed. I'll refer to my previous post to keep it shorter.
It seems most people understand that there are 21 options for the first port and 18 for the second. Good. Now, Dungeness stated that there are also 18 options for the third port. That is true, in a way. And you'll see that I have counted all 18 in my post - 15 in the first segment, the same 2 others in segments 2 and 3, and the 18th in segment 4. Why separate them? There are two reasons: 1) The number of legal ports in port four depends on the type of port three. 2) We must remember to remove duplicates. Different segments have different number of duplicates.
OK, first part first - number of legal ports in port 4 as a consequense of the type of port 3 (ignoring that duplicates must be removed). If the third port sells same good as port 1, there are 18 legal ports for port 4. However, if port 3 sells a different kind of good than port 1, there are only 15 legal options for port 4. Thus, we have to distinguish between these cases. In my segment 1, port 3 sells a different kind of good than port 1, and there are 15 legal options for that.
Now to the second part - removing duplicates. I said that if port 1 and port 3 sell different goods, there are 15 legal ports for port 4. Yet, in my segment 1, I only included 12 of them, specifically, those 12 ports that does not sell the same good as port 2. Why? This is to avoid duplicates. Let's see what happens if I let port 4 sell the same good (good A) as port 2. The ports then become: B, A1, C, A2. Note that this is a duplicate of A1, C, A2, B, which appears in later segments. I therefore have to leave those out. When two ports sell the same good, I make sure that is always port 1 and 3, to avoid duplicates. The only situation where I let port 2 and 4 sell the same good, is when port 1 and 3 ALSO does so (segment 3). So, in segment 1, I only allow the 12 ports selling a different good than the 3 first ports. I get quadruples since I get the same trading route starting in any of the four ports of the trading route, so I must divide my answer by 4.
That (segment 1) takes care of 15 of the possible ports for port 3. Now I look at the last 3. One is the same port as port 1, I look at that separately (segment 4). The remaing 2 I ALSO have to look at differently. Why? Because of duplicates. In segment 2, I let port 4 sell a different good than port 2. In this case, I only get pairs of identical trading routes (A1, B, A2, C - A2, C, A1, B) because I have made sure that only ports 1 and 3 can sell the same good, so I must divide my answer by 2. In segment 3, I let port 4 sell the same good as port 2 (yet it cannot BE the same port as port 2, because that would make it a duplicate of my segment 4). It so happens that A1, B1, A2, B2 generates quadruples (any of the four ports can be the first port), so I must divide my answer in this segment by 4. The reason for distingusihing between segment 2 and 3 was therefore becasuse I knew I had to divide by different numbers.
The 4th segment has port 1 and 3 be identical. This is an easy case; port 2 can be any of the 18 selling another good, and port 4 can be any of the 17 others selling another good than 1. It can't be the same as port 2, because that would give A, B, A, B, which is a duplicate of 2-port trading routes. This segment produces pairs of identical routes (A, B, A, C vs A, C, A, B), so I must divide by 2.
I hope I made it clearer, and not harder, to understand