How many possible trade routes contest. 15M gold prize!

General chit-chat about anything in-game here.
In-game trade offers should be published here
Roleplaying is recommended (Write like as if your character is speaking)

Re: How many possible trade routes contest. 15M gold prize!

Postby PhoenixKnight » Mon Apr 18, 2016 2:05 pm

That is a combination without repetition problem.
2 port trade route combinations =210
3 port trade route combinations= 1330
4 port trade route combinations=5985
Total = 7525
Now as the discussion mention, there are missing factors in this math which would take some time to calculate that I currently do not have. But based on my guessing having a port appear twice in a 4 port route adds only 210 same as 2 port trade route.
To remove same merchandize,
2 port trade route combinations =171
3 port trade route combinations = 969
4 Port trade route combinations= 5985+210 = 6195

Total=7335
Last edited by PhoenixKnight on Mon Apr 18, 2016 2:18 pm, edited 1 time in total.
Phoenix Knight
Dragon of the desert and the two seas
User avatar
PhoenixKnight
 
Posts: 1318
Joined: Sat Feb 09, 2013 9:27 pm

Re: How many possible trade routes contest. 15M gold prize!

Postby Haron » Mon Apr 18, 2016 2:07 pm

Great thinking, Grapefruit. I admit I forgot about that. However, the trade ROUTS are still possible. You could set the fleets to stock in port, buy gold or whatever. I agree that these trade routes would often (though not always) be very impractical, but not impossible. In fact, I've had trade routes between two cities producing the same goods, just to trade gold from one to the other.

So, it depends what the contest maker really meant: The number of unique, POSSIBLE trade routes (as I assumed), or the number of unique, MEANINGFUL trade routes when trading ordinary goods (not gold). That would require a new calculation. Shouldn't be TOO hard, since there are exactly three ports producing each good, but it has to be done if that is indeed what the contest is about.

Let's see (ignoring the stupid "no reverse trade routes" rule):

2 ports: 21*18/2 = 189
3 ports: 21*18*15/3 = 1890
4 ports (all different): 21*18*15*12/4 + 21*18*2*15/2 + 21*18*2*2/4 = 17010 + 5670 + 378
(First part assumes all different goods, second part assumes 1st and 3rd sell the same, but not 2nd and 4th, third part assumes 1st and 3rd sell same, as does 2nd and 4th)
A-B-A-C: 21*18*17/2 = 3213

That should be a total of 28350 possible routes. However, this was a bit messy, so I may have missed somthing along the way...
The T'zak Ryn offers Naval Combat Solutions for the Quality Conscious Customer
User avatar
Haron
Forum Rambler
 
Posts: 1926
Joined: Tue Mar 29, 2016 10:04 am

Re: How many possible trade routes contest. 15M gold prize!

Postby Sir Colchian Niveus » Mon Apr 18, 2016 2:16 pm

2.097.152 results, from where duplicates, and trade routes that can't take place ( like between 5,6,7,8...,19,20,21 ports ) need to be removed. You actually need a math type, that i'm missing right now, to solve it. It's too big to do it on papper with the solution i found.. :) Captain Dungness i'll just wait your results. :D
I'm here to listen, everybodys beliefs. What i'm expressing, is only my opinion. The name "Dragon" comes from the Greek "drakeîn" meaning "to see clearly".

Sir Colchian Niveus, first of his kind. The White Dragon, Lord.
User avatar
Sir Colchian Niveus
 
Posts: 563
Joined: Fri Nov 28, 2014 11:39 pm

Re: How many possible trade routes contest. 15M gold prize!

Postby Grimrock Litless » Mon Apr 18, 2016 2:21 pm

PhoenixKnight wrote:That is a combination without repetition problem.
2 port trade route combinations =210
3 port trade route combinations= 1330
4 port trade route combinations=5985
Total = 7525
Now as the discussion mention, there are missing factors in this math which would take some time to calculate that I currently do not have. But based on my guessing having a port appear twice in a 4 port route adds only 210 same as 2 port trade route.
To remove same merchandize,
2 port trade route combinations =171
3 port trade route combinations = 969
4 Port trade route combinations= 5985+210 = 6195

Total=7335


First, I do want to ask why is the 3 and 4 port trade route become higher then 2?

It should be lower as the chances of duplicated trade routes are more likely.
"Got ya."
User avatar
Grimrock Litless
 
Posts: 2591
Joined: Thu Aug 13, 2015 2:50 pm
Location: Under the sea, in a submarine!

Re: How many possible trade routes contest. 15M gold prize!

Postby Haron » Mon Apr 18, 2016 2:22 pm

Only 4 ports are allowed in a trade route, Colchian Niveus, or else it would indeed be lots of possibilities...
The T'zak Ryn offers Naval Combat Solutions for the Quality Conscious Customer
User avatar
Haron
Forum Rambler
 
Posts: 1926
Joined: Tue Mar 29, 2016 10:04 am

Re: How many possible trade routes contest. 15M gold prize!

Postby Sebena » Mon Apr 18, 2016 2:23 pm

PhoenixKnight wrote:2 port trade route combinations =171
3 port trade route combinations = 969
4 Port trade route combinations= 5985+210 = 6195

Total=7335



I did same math and I got same result.

If this is not true than peson who helds competition should explain it better.
“The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man.”
User avatar
Sebena
 
Posts: 1697
Joined: Wed Jul 22, 2015 3:20 pm

Re: How many possible trade routes contest. 15M gold prize!

Postby Haron » Mon Apr 18, 2016 2:29 pm

Guluere:

With two ports, the first can be any of the 21 ports, and the 2nd any of the 20 others. However, now you get both A-B and B-A, so you must divide by 2.
With 3 ports, the first port can be any of the 21 ports, the next port can be any of the 20 others, and the third can be any of the remaining 19. Sure, you now get A-B-C, B-C-A and C-A-B, so you must divide by 3 (phoenixknight divided by 6, which is correct only if ALL permutations are identical, which is not true). This give a higher number (even if you divide by 6), since multiplying with 19 outweights the higher chance of duplicates. Even more so with 4 ports (and there you get additional trouble, since you can have A-B-A-C alternatives in addition to those handled with "combination without permutation", which is even wrong here, as some permutations are allowed).
The T'zak Ryn offers Naval Combat Solutions for the Quality Conscious Customer
User avatar
Haron
Forum Rambler
 
Posts: 1926
Joined: Tue Mar 29, 2016 10:04 am

Re: How many possible trade routes contest. 15M gold prize!

Postby Sebena » Mon Apr 18, 2016 2:45 pm

Haron wrote:Guluere:

With two ports, the first can be any of the 21 ports, and the 2nd any of the 20 others. However, now you get both A-B and B-A, so you must divide by 2.
With 3 ports, the first port can be any of the 21 ports, the next port can be any of the 20 others, and the third can be any of the remaining 19. Sure, you now get A-B-C, B-C-A and C-A-B, so you must divide by 3 (phoenixknight divided by 6, which is correct only if ALL permutations are identical, which is not true). This give a higher number (even if you divide by 6), since multiplying with 19 outweights the higher chance of duplicates. Even more so with 4 ports (and there you get additional trouble, since you can have A-B-A-C alternatives in addition to those handled with "combination without permutation", which is even wrong here, as some permutations are allowed).



Mate, I hate math and I spent last hour writting each port down and writting possible routes, there is no other result than what I quoted from PhoenixKnight.
“The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man.”
User avatar
Sebena
 
Posts: 1697
Joined: Wed Jul 22, 2015 3:20 pm

Re: How many possible trade routes contest. 15M gold prize!

Postby PhoenixKnight » Mon Apr 18, 2016 3:16 pm

Ok. I made a small code to calculate it.
I hope I have the logic right
Results are
two ports= 147
three ports= 2793;
four ports = 3822;

Total =6762

s=1;
z=1;
w=1;
q=0;
same=0;
two=[0 0];
three=[0 0 0];
four=[0 0 0 0];
port={'a' 'b' 'c' 'a' 'b' 'c' 'a' 'b' 'c' 'a' 'b' 'c' 'a' 'b' 'c' 'a' 'b' 'c' 'a' 'b' 'c'};
for i=1:length(port);
a=i;
for j =1:length(port)
if port{j}==port{i}||j==i;
q=q+1;
else
b=j;
for g=1:z-1;
if two(g,:)==[b a];
same=1;
end
end
if same==0;
two(z,:)=[a b];
z=z+1;
else
same=0;
end
for k=1:length(port)
if k==i||k==j||port{k}==port{i}|| port{k}==port{i}
q=q+1;
else
c=k;
for d=1:s-1;
if three(d,:)==[c b a];
same=1;
end
end
if same==0;
three(s,:)=[a b c];
s=s+1;
else
same=0;
end
four(w,:)=[a b a c];
w=w+1;
end
end
end
end
end
Phoenix Knight
Dragon of the desert and the two seas
User avatar
PhoenixKnight
 
Posts: 1318
Joined: Sat Feb 09, 2013 9:27 pm

Re: How many possible trade routes contest. 15M gold prize!

Postby Haron » Mon Apr 18, 2016 3:33 pm

You got it wrong, Phoenix. I'm not exactly sure where, though. The math is not complicated for two ports, however.

The first port can be any of the 21 ports in Avonmorra. The second port can be any port in avonmorra NOT producing the same port as the first one; and there are 18 such ports (since three ports produce the same good). However, now I have counted both A-B and B-A, so I must divide by 2. Thus, there are 21*18/2 possible trading routes, assuming they must produce different goods to be considered "valid" (which I don't really think they should, but that's not for me to decide).
The T'zak Ryn offers Naval Combat Solutions for the Quality Conscious Customer
User avatar
Haron
Forum Rambler
 
Posts: 1926
Joined: Tue Mar 29, 2016 10:04 am

PreviousNext

Return to Tavern