Donovans mine formula

Here you can find, hints, strategies and other info for VGA Planets, PHost and it's many addon's and utilities.

Moderators: BitMask, Havok

User avatar
FireAge
Posts: 424

Donovans mine formula

Post#1 » Sat Mar 31, 2012 5:01 am

I was looking into mine hits on donovans and was wondering about an inconsistency (or mistake on my part).
http://www.donovansvgap.com/info/spacemines.htm

They state:
The Probability of Hitting a Mine Over A Given Distance

So how can we calculate the probability of hitting one mine when travelling a given distance (x)? To do this we use a probability concept known as: the binomial distribution. To put it simply, if you have some basic notion of probabilities, it is obvious that chance of a minehit follow a binomial distribution.

The probability of hitting a number x of mines when travelling d lightyears is B(x,d,p) if p is the minehit probability per light year travelled.

The function B is therefore:

B(x,d,p) = (d/x) * (p^x) * ((1 - p)^(d-1))

Where (d/x) = d!/(x!*(d - x)!)
and n!=1*2*...*n
But then in the example for 30 ly, they state:
Assume a 30 light year mine field, with normal configuration p=1% (which means 0.01). We want to know what the probability is of crossing it without minehits:

B(0,30,0.01) = (30/0) * (0.01^0) * ((1 - 0.01)^(30 - 0)) =

= (30! / (0!)*(30 - 0)!) * 1 * ( 0.99 ^ 30 ) =
= (30! / 1 * 30!) * 1 * (0.7397) =
= 1 * 1 * 0.7397 = 0.7397
Note the parts marked in red. Am I missing something, or does this not match?
Seems to me either the formula should be (d-0) or the example should be (30-1).

User avatar
streu
Posts: 232
Contact:

Re: Donovans mine formula

Post#2 » Sat Mar 31, 2012 6:32 am

FireAge wrote: But then in the example for 30 ly, they state:
Assume a 30 light year mine field, with normal configuration p=1% (which means 0.01). We want to know what the probability is of crossing it without minehits:

B(0,30,0.01) = (30/0) * (0.01^0) * ((1 - 0.01)^(30 - 0)) =

= (30! / (0!)*(30 - 0)!) * 1 * ( 0.99 ^ 30 ) =
= (30! / 1 * 30!) * 1 * (0.7397) =
= 1 * 1 * 0.7397 = 0.7397
Note the parts marked in red. Am I missing something, or does this not match?
Seems to me either the formula should be (d-0) or the example should be (30-1).
Forget binomial coefficients, it's much simpler if you want 0 hits.

The probability to move on ly without hitting a mine is 99% = 0.99. The probability to move another ly without hitting a mine is again 99% = 0.99. The probability to move two ly therefore is 0.99*0.99 = 0.99^2 = 0.9801. Thus: the probability to move N light-years without hitting a mine, with a mine hit probability of P%, is (1-P/100)^N, i.e. for your example, 0.99^30.

That is theory. Also see http://phost.de/~stefan/minehits.html for some pretty weird stuff about mine hits in practical Tim-Host.


--Stefan

User avatar
FireAge
Posts: 424

Re: Donovans mine formula

Post#3 » Sat Mar 31, 2012 6:42 am

But I'm not interested in just 0 hits, I want to know the chance to get multiple types of hits.
So I was working on an excel array for the computations and it did not match up.

I'll check out your formulas, though ytour calculations are for webmines.
Webmines stop the ship, normal mines slow it down by 10 ly if the techlevel is below spec.
So that kind of changes things a bit :)

User avatar
streu
Posts: 232
Contact:

Re: Donovans mine formula

Post#4 » Sat Mar 31, 2012 7:22 am

FireAge wrote:But I'm not interested in just 0 hits, I want to know the chance to get multiple types of hits.
So I was working on an excel array for the computations and it did not match up.
OK. Since I'm bad at memorizing formulas, I usually derive those on-the-fly.

You want to move D light-years, hit N mines, with mine hit probability P (e.g. 0.01).
[Edit: it said "e.g. 0.99" before, but should be 0.01 of course]

Split your distance into D steps of one light-year, tick N segments. Like this:

Code: Select all

    pass pass hit pass pass hit pass
   (1-P)*(1-P)*P*(1-P)*(1-P)*P*(1-P)
i.e. (1-P)^(D-N) * P^N. No matter how you tick D-out-of-N segments, the probability will be the same for each kind.

How many possibilities are there to tick D-out-of-N segments?
- for the first tick, you have D choices
- for the second tick, you have D-1 choices because one element is already ticked
Thus, there are N*(N-1)*(N-2)*...*(N-(D-1)) possibilities, that's N!/(N-D)!. Since this counts each selection in each possible order, we also have to divide by the number of possible orders, which is D!. Therefore, there are N!/((N-D)! * D!) possibilities.

Thus, the final result is

(1-P)^(D-N) * P^N * (N!/((N-D)! * D!))

To cut a long story short: the "-1" in the original formula is wrong.
I'll check out your formulas, though ytour calculations are for webmines.
Webmines stop the ship, normal mines slow it down by 10 ly if the techlevel is below spec.
So that kind of changes things a bit :)
Things are changed a little because HOST does not move ships in steps of 1 ly. If you're going 40 ly east, 30 ly north, 50 ly total, the ship will not be moved in 50 steps of 1 ly, it will be moved in 40 steps of 1.25 ly.

Fortunately, the accidental implicit "+1" which there is for web mines does not exist for regular mines.


--Stefan
Last edited by streu on Sat Mar 31, 2012 7:57 am, edited 1 time in total.

User avatar
FLETCH
Posts: 1440

Re: Donovans mine formula

Post#5 » Sat Mar 31, 2012 7:36 am

:shock: :suicide:
FLETCH


667 The NEIGHBOUR of the BEAST!

User avatar
Rimstalker
Posts: 955
Contact:

Re: Donovans mine formula

Post#6 » Sat Mar 31, 2012 8:30 am

@FireAge: Of course, you can also have multiple Webhits in one turn!
Wirklich reich ist, wer mehr | Truly rich is, who holds
Träume in seiner Seele hat, | more dreams in his soul
als die Realität zerstören kann.| than reality can destroy.

User avatar
FireAge
Posts: 424

Re: Donovans mine formula

Post#7 » Sat Mar 31, 2012 1:49 pm

Thanks stefan, it confirms my calcs and of course the value prediction of VPA.

How does the host deal with 40 steps of 1.25 ly.
It calculates the chance of hitting a mine for a single step (0.0125 in this case?)
and then does the normal math?

So your example would be:
(1-0.0125)^40 = 0,6045
instead of
(1-0.01)^50 = 0,6050

Because if so, my sheet needs to adapted a bit :)

User avatar
streu
Posts: 232
Contact:

Re: Donovans mine formula

Post#8 » Sun Apr 01, 2012 6:32 am

FireAge wrote:How does the host deal with 40 steps of 1.25 ly.
It calculates the chance of hitting a mine for a single step (0.0125 in this case?)
and then does the normal math?

So your example would be:
(1-0.0125)^40 = 0,6045
instead of
(1-0.01)^50 = 0,6050

Because if so, my sheet needs to adapted a bit :)
Yes, that's precisely how it works.

In particular, the per-step probability is indeed computed as Mine_hit_rate * Step_length_according_to_Pythagoras. This is mathematically wrong (correct would be 1-(1-Mine_hit_rate)^Step_length_according_to_Pythagoras), leading to the effect that there are slightly different probabilities depending on the angle you move. This problem affects web mines more than regular mines, see my article.

It might be noted that PHost works a little different here. It computes the distance to move, a probability distribution for the next way segment, and then rolls a die once to figure out whether a mine is hit or not, and if so, where. It does not move ships in steps of 1 ly. Therefore, it has no angle dependance.


--Stefan

User avatar
FireAge
Posts: 424

Re: Donovans mine formula

Post#9 » Sun Apr 01, 2012 7:36 am

And how is the amount of steps determined?
Amount_of_steps = Max(dx;dy)?

I have been flying the recommended angles of 33 and 44 whenever I really needed to fly out of a minefield.
But it's never actually saved a ship, I guess lady fortuna doesn't like people messing with her statistics ;)
Last edited by FireAge on Sun Apr 01, 2012 9:11 am, edited 1 time in total.

User avatar
streu
Posts: 232
Contact:

Re: Donovans mine formula

Post#10 » Sun Apr 01, 2012 8:00 am

FireAge wrote:And how is the amount of steps detemined?
Amount_of_steps = Max(dx;dy)?
Yes.


--Stefan

User avatar
Gilgamesh
Posts: 4940
Contact:

Re: Donovans mine formula

Post#11 » Sun Apr 01, 2012 4:26 pm

I think I'll just memorize the general principle that minefields are kinda dangerous....
QI'DaS tuQ SoSlI'

User avatar
streu
Posts: 232
Contact:

Re: Donovans mine formula

Post#12 » Sun Apr 01, 2012 4:39 pm

Gilgamesh wrote:I think I'll just memorize the general principle that minefields are kinda dangerous....
Good idea. It's also better to remember that minefields destroy each other. No need to remember that PHost solves quartic equations to do that.


--Stefan

User avatar
FireAge
Posts: 424

Re: Donovans mine formula

Post#13 » Mon Apr 02, 2012 2:12 pm

Now now, stop showing off your knowledge of Taylor serise :)

I think the biggest problem with PHost is that it's all correct.
That means I can account for everyt\hing, taking me more time :(

Return to “Intel”

Who is online

Users browsing this forum: No registered users and 3 guests

cron