Calculation of the chance of discovering a mineral resource in many worked mines

frob2900

Deity
Joined
Oct 21, 2006
Messages
2,117
Have you ever wondered what the actual probability is to discover a resource deposit in one of your mines? What is the actual chance of getting such an event?

According to the game XML, the chance of discovering a certain resource (which must be known to you) is 1/10000 (see e.g. http://forums.civfanatics.com/showthread.php?t=140111) per known resource. So the chances are higher if you know more (e.g. bronze, iron, coal etc. in addition to the precious metals which are known from the start).

Based on this little tidbit, I tried to make an analysis which shows the probability of discovering a mineral deposit as a function of turns elapsed, assuming that you know of five resources (e.g. copper, iron, gold, gems, silver) and that you have a fixed number of mines (yes, this is a bit silly).

The results are presented in two ways,:

A. Percentage chance to find a resource as a function of turns elapsed:

The horizontal-axis is the number of turns elapsed
The vertical-axis is the probability of discovering at least one deposit (so 1.0 corresponds to 100%)

So e.g. after a hundred turns, with 10 mines, you have roughly 40% chance of finding a mineral resource.

B. Turns elapsed to get a certain percentage chance, as a function of mines worked

The horizontal-axis is the number of mines worked
The vertical-axis is the turns elapsed to get a certain probability of discovery

So e.g. with 20 mines worked, you'd have to wait roughly 160 turns to have an 80% of discovering a resource.

This is based on the following calculations (there might be faults, if so post here and I'll fix the graphs!)
Part A

P=1/10000 (base probability of discovery)

(1-P) is the probability of not finding the first resource
(1-P)^2 is the probability of finding neither the first or second resource
etc.
So (1-P)^5 is the probability of not finding a mineral in a mine, assuming you know of 5 types.

Now if you have M mines, the probability of not finding a mineral in any of them is (1-P)^(5*M), and if you wait T turns the probability for not having found any mineral in all your mines is (1-P)^(5*M*T), where T is the number of turns elapsed.
and since we are interested in the chance of having found something, the graph is of
f(T) = 1-(1-P)^(5*M*T)


Part B
Fixing f to a certain value, one has
(1-P)^(5*M*T)=1-f
so that, taking logarithms:
ln(1-f)=ln(1-P)*5*M*T, leading to
T=1/(5*M)*ln(1-f)/ln(1-P)
 
How about fixing P at 50% and graphing mines vs turns? ;)

Until you start worrying about the probability of popping more than one resource, 1 mine worked for 200 turns is equivalent to 200 mines worked for one turn.

So the curve looks like 1/x.

On the back of the envelope:

50% = ((1-p)^5)^t = (1-p)^5t

ln( 50% ) = ln ( 1-p ) ^5t ;
ln(50%) = 5t * ln (1-p)
t = ln (50%) / ( 5 * ln (1-p) )

t = 1536 mine * turns.
 
Mines are good. Mine everything, even hills not in the BFC.

I discover several resources per game (marathon).
 
Mines are good. Mine everything, even hills not in the BFC.

Unworked mines never discover resources.

Actually, let me amend that - unworked mines don't discover resources in this way. BtS has introduced events, which could lead to a resource appearing in a mine outside of the fat cross. To the best of my knowledge, the presence of the mine is irrelevant. In ALC-17.2, Sisiutil had an event pop Uranium (and a mine and a road) in the middle of a forest, within his cultural borders but outside of the working radius of any city.
 
Actually, let me amend that - unworked mines don't discover resources in this way. BtS has introduced events, which could lead to a resource appearing in a mine outside of the fat cross. To the best of my knowledge, the presence of the mine is irrelevant. In ALC-17.2, Sisiutil had an event pop Uranium (and a mine and a road) in the middle of a forest, within his cultural borders but outside of the working radius of any city.

Yes, events are a completely different cup of tea :)

Still, it might be possible to predict likelihoods of events also, given the distribution of terrain in your empire or your technology level etc. I shall check the XML/Python when I get home to see if I can find anything useful.
 
Are you positive about that ? It would suck, i used to mine outside of the BFC to increase the likelihood of finding resources... I guess i just wasted my time then =D

Yep, it's a definite.
Also working a mine which will pop a later resource (e.g. coal or uranium) won't pop anything as there is already a resource assigned. So the odds are slightly lower than shown (as you can't predict whether a mine has a future resource or not).
 
Yep, it's a definite.
Also working a mine which will pop a later resource (e.g. coal or uranium) won't pop anything as there is already a resource assigned. So the odds are slightly lower than shown (as you can't predict whether a mine has a future resource or not).
Yes, indeed. Unfortunately adding a good estimate for this would probably require data dependant on the exact map/map settings in the Custom Game screen.

If one made a rough estimate that e.g. 5% of the hill tiles contain coal, uranium or aluminium, one could just set M->0.95 M in the equations, but I have no idea if 5% is a good estimate for all map types.
 
Also, you cannot pop a resource on a tile that already has a hidden resource. - THis means that the number of mines needed is usually a bit more than you'd think.
 
Also, you cannot pop a resource on a tile that already has a hidden resource. - THis means that the number of mines needed is usually a bit more than you'd think.

I dont get it, these are invisible in world builder, yet they are assigned from the beginning ?


another question : is the probability per turn the same on normal speed and marathon speed ?
 
I dont get it, these are invisible in world builder, yet they are assigned from the beginning ?

He means that you cannot pop another resource on a mine that already has one, i.e. some aluminium or uranium, which are usually hidden at start.

another question : is the probability per turn the same on normal speed and marathon speed ?

Yes.
 
Top Bottom