Author 
Message 
Scrat
Chief Warrant Officer
Joined: Sun Jan 20, 2008 5:15 am Posts: 142

Planet Collision Formula
Given the max # of planets per sector, the # of enemy planets in a sector, and the total number of planets in the sector, what would be the formula for calculating the chance of taking out an enemy planet by collision at extern?
I'm thinking that having 10 planets over the sector max always gives the best chance for taking an enemy planet out (at least when the sector max is 5).

Sun Mar 08, 2009 4:35 am 


LoneStar
Commander
Joined: Fri Jun 09, 2006 2:00 am Posts: 1392 Location: Canada

Re: Planet Collision Formula
Scrat wrote: Given the max # of planets per sector, the # of enemy planets in a sector, and the total number of planets in the sector, what would be the formula for calculating the chance of taking out an enemy planet by collision at extern?
I'm thinking that having 10 planets over the sector max always gives the best chance for taking an enemy planet out (at least when the sector max is 5). I remember reading a post from Space Ghost (iirc), about collisions. He said something to the effect that the likelyhood of a collision was related to how 'easy' you got mugged at dock. Putting 10 extra planets in the sector 'might' increase the odds of a collision however you have to consider that the more 'junk' planets in sector the more likely that the collision will occur between two junk planets. I have had alot of sucess overloading a sector with 2 extra planets.
_________________  = QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time. = There are 10 types of people in the world: Those that understand Binary and those who do not = If Oil is made from Dinosaurs, and Plastic is made from Oil... are plastic Dinosaurs made from real Dinosaurs? = I like to keep my friends and my enemies rich, and wait to see which is which  Tony Stark (R.I.P.)

Sun Mar 08, 2009 7:05 am 


Admin 1
Site Admin
Joined: Sun Dec 24, 2000 3:00 am Posts: 1432 Location: USA

Re: Planet Collision Formula
LoneStar wrote: Scrat wrote: Given the max # of planets per sector, the # of enemy planets in a sector, and the total number of planets in the sector, what would be the formula for calculating the chance of taking out an enemy planet by collision at extern?
I'm thinking that having 10 planets over the sector max always gives the best chance for taking an enemy planet out (at least when the sector max is 5). I remember reading a post from Space Ghost (iirc), about collisions. He said something to the effect that the likelyhood of a collision was related to how 'easy' you got mugged at dock. Ummm..well......sigh......Nevermind.

Sun Mar 08, 2009 12:29 pm 


Singularity
Veteran Op
Joined: Thu Jun 02, 2005 2:00 am Posts: 5558 Location: USA

Re: Planet Collision Formula
It's 10% for every planet over the sector limit, IIRC.
So consider a sector with a 5 limit. 10 planets extra would guarantee a collision, but only a 2 in 15 chance, or a 13% chance, of a collision with at least 1 enemy planet.
_________________ May the unholy fires of corbomite ignite deep within the depths of your soul...
1. TWGS server @ twgs.navhaz.com 2. The NavHaz Junction  Tradewars 2002 Scripts, Resources and Downloads 3. Open IRC chat @ irc.freenode.net:6667 #twchan 4. Parrothead wrote: Jesus wouldn't Subspace Crawl.
*** SG memorial donations via paypal to: dpocky68@booinc.com

Sun Mar 08, 2009 4:24 pm 


Scrat
Chief Warrant Officer
Joined: Sun Jan 20, 2008 5:15 am Posts: 142

Re: Planet Collision Formula
After doing some research I found the formula I was looking for. First the base chance of a collision occurring is 10% for every planet over the sector maximum up to 10 over and the formula for determining the number 2 planet combinations for a given number of planets is:
n*(n1)/2
So for 15 total planets there are :
15*(151)/2 = 105 different 2 planet combinations.
Using the same formula you can determine the number of combinations containing only junk planets:
10*(101)/2 = 45
and the number of combinations containing 2 enemy planets:
5*(51)/2 = 10
So since there are 10 planets over the sector max (assuming the default of 5 per sector) the base chance of a collision occurring is 100%. The odds of the collision containing at least 1 enemy planet is 1(45/105) = 57% and the odds of colliding 2 enemy planets is 10/105 = 9.5%
If there are a total of 7 planets in the sector the base chance for a collision occurring is 20% and there are 7*(71)/2 = 21 possible 2 planets combinations of which 1 contains no enemy planets and 5*(51)/2 = 10 contain 2 enemy planets. So the chance for a collision to occur and contain at least 1 enemy planet is 20/21 * 20% = 19% and the chance to take out 2 enemy planets is 10/21 * 20% = 9.5%
Perhaps someone with more of a math background can confirm this but it looks like putting 10 extra planets gives a way better chance of taking out at least 1 enemy planet however the odds for taking out 2 is about the same when overloading by 2 or 10 planets.

Mon Mar 09, 2009 12:40 pm 


Singularity
Veteran Op
Joined: Thu Jun 02, 2005 2:00 am Posts: 5558 Location: USA

Re: Planet Collision Formula
Quote: Perhaps someone with more of a math background can confirm this but it looks like putting 10 extra planets gives a way better chance of taking out at least 1 enemy planet however the odds for taking out 2 is about the same when overloading by 2 or 10 planets. The equation you've got looks similar to the basic summation equation. 1+2+...n = n(n+1)/2. So what is that, a subtraction series equation? Anyway. So let's just work thru this step by step. With 15 planets and a 100% chance of a collision, only 2 planets can collide. There is never more than 1 collision per sector per extern. So 1 planet out of 15, that's a 6.7% chance of any one planet being selected. There are 5 enemy planets, 15 total, that's 1/3rd or 33.3% chance of 1 enemy planet colliding. If the first planet selected is an enemy planet, that brings the odds to 4/14 or 28.6% of a 2nd enemy planet being selected. If the first is not an enemy planet, then that brings the odds to 5/14 or 35.7%. The odds then of both selections being enemy planets, ie: the P(U) is the P(1)*P(2). In otherwords the odds of 2 enemy planets colliding in the above situation is: .333 * .286 = .095. Or 9.5% Looks like my end number agrees with yours. The first one tho doesn't. I don't follow how you got that one.
_________________ May the unholy fires of corbomite ignite deep within the depths of your soul...
1. TWGS server @ twgs.navhaz.com 2. The NavHaz Junction  Tradewars 2002 Scripts, Resources and Downloads 3. Open IRC chat @ irc.freenode.net:6667 #twchan 4. Parrothead wrote: Jesus wouldn't Subspace Crawl.
*** SG memorial donations via paypal to: dpocky68@booinc.com

Mon Mar 09, 2009 3:57 pm 


the reverend
Gameop
Joined: Thu Mar 08, 2001 3:00 am Posts: 886 Location: USA

Re: Planet Collision Formula
Scrat wrote: Given the max # of planets per sector, the # of enemy planets in a sector, and the total number of planets in the sector, what would be the formula for calculating the chance of taking out an enemy planet by collision at extern?
I'm thinking that having 10 planets over the sector max always gives the best chance for taking an enemy planet out (at least when the sector max is 5). for every planet over the limit, you get 10% more chance of a collision, so if the limit is 5, 6 planets is 10% chance of collision, 10 planets is 50% chance, and 15 planets in sector means 100% chance that 2 planets collide. assuming that only one of the planets in the sector is your opponent's, the chance you collide it is 1/15 + 1/14  you have a 1 in 15 chance that the first planet in the collision is theirs and a 1/14 chance that the second planet in the collision is theirs  so about a 13.8% chance you will get one of their planets. that being said, the sweet spot is at exactly 10 planets overload, or 15 planets total. going to 14 planets gets you 90% chance of collision times 1/13 + 1/14 = 13.4%. going to 16 gives you 100% times 1/15 + 1/16 = 12.9% chance. its been 15 years since i took probability and statistics, so feel free to correct me. unfortunately, i fried to many brain cells just writing this, so i won't be doing the math for the cases where your opponent has more than 1 planet in the sector. however, i will say this  no matter how many planets he has in the sector, the sweet spot of highest damage probability will always be at 10 planets overload.
_________________ twgs : telnet://twgs.thereverend.org:5023 web : http://www.thereverend.org games : http://www.thestardock.com/twgssearch/i ... verend.org helper : http://svn.thereverend.org:8080/revhelper/

Mon Mar 09, 2009 6:01 pm 


the reverend
Gameop
Joined: Thu Mar 08, 2001 3:00 am Posts: 886 Location: USA

Re: Planet Collision Formula
there is one interesting corollary of this discussion... if you ever find yourself on the wrong end of this collision stick, a simple and often faster countermeasure is to put even MORE planets in the sector. if your opponent suddenly pops 10 planets in your base 30 seconds before extern, pop another 10 or 20 if you can. you can macro it faster than you can figure out which planets to detonate, and every planet you add to the sector reduces the odds that your crops will be destroyed.
_________________ twgs : telnet://twgs.thereverend.org:5023 web : http://www.thereverend.org games : http://www.thestardock.com/twgssearch/i ... verend.org helper : http://svn.thereverend.org:8080/revhelper/

Mon Mar 09, 2009 6:09 pm 


Singularity
Veteran Op
Joined: Thu Jun 02, 2005 2:00 am Posts: 5558 Location: USA

Re: Planet Collision Formula
Quote: assuming that only one of the planets in the sector is your opponent's, the chance you collide it is 1/15 + 1/14  you have a 1 in 15 chance that the first planet in the collision is theirs and a 1/14 chance that the second planet in the collision is theirs  so about a 13.8% chance you will get one of their planets. P(sum) = P(first) * P(second). Conditional probabilities don't add, they multiply. Since there are 5 planets that are theirs, you have a 5 in 15 chance of one (any one) of their planets being selected. But you only have a 1 in 15 chance of a specific planet being selected. The 2nd selection depends on which is selected first. If an enemy planet is selected, then that reduces the number of enemy planets left to 4. If yours is selected, then the enemy planets remains at 5. Either way, the total number is 14. So that's either 4/14 or 5/14, depending on which is selected first. Reducing the number of planets is a bit tricky. Lets say you only pop 5 over instead of 10 and go for a 50% possibility. We can treat it as a conditional probability. So 5 planets, you pop 5 more. That's 10 total. .50 * 5/10 = .5 * .5 = .25 or 25% chance of an enemy planet being selected as the first selection. In the 2nd case, if an enemy planet was selected, that's 4/9 or 44%. If yours was selected that's 5/9 or 55%. That means that the least case probability is 25%, which is certainly lower than the previous example. However... .5 * (.5 * .44) = .11 or 11% So while your least case probability goes down, your probability of having both selected planets actually goes up. That means your odds of having a double collision goes up a little. Odd, eh? The probability of none of your planets colliding, if you're on the other side... With 10 extra planets and 5. That's 10/15 for the first, and assuming yours wasn't selected, that's 9/14 for the 2nd. That's .6666 * .6428 = 42.85% of losing no planets. So there's a 57.15% chance of losing at least 1 planet. If you increase the number of planets, say you pop 10 more. That's 20/25 for a first miss, and assuming it missed the first planet, a 19/24 for the 2nd. That's .8 * .7916 = or a 63.3% chance of losing no planets (36.7% chance of losing a critical planet). Pop 10 more, that's 30/35 and 29/34. .8571 * .8529 = .731 or 73.1% (26.9 of losing a planet) of missing the collision. While the odds do get better, you'd have to pop a lot of planets very quickly to avoid it. If you pop 100 extra that's... 110/115 and 109/114. .9565 * .9561 = .9145 or 91.45% of missing the collision. So either pop a lot, or start removing planets and reducing the odds of a collision. Both work in their own way.
_________________ May the unholy fires of corbomite ignite deep within the depths of your soul...
1. TWGS server @ twgs.navhaz.com 2. The NavHaz Junction  Tradewars 2002 Scripts, Resources and Downloads 3. Open IRC chat @ irc.freenode.net:6667 #twchan 4. Parrothead wrote: Jesus wouldn't Subspace Crawl.
*** SG memorial donations via paypal to: dpocky68@booinc.com

Mon Mar 09, 2009 6:36 pm 


the reverend
Gameop
Joined: Thu Mar 08, 2001 3:00 am Posts: 886 Location: USA

Re: Planet Collision Formula
Singularity wrote: Quote: assuming that only one of the planets in the sector is your opponent's, the chance you collide it is 1/15 + 1/14  you have a 1 in 15 chance that the first planet in the collision is theirs and a 1/14 chance that the second planet in the collision is theirs  so about a 13.8% chance you will get one of their planets. P(sum) = P(first) * P(second). Conditional probabilities don't add, they multiply. this doesn't make sense to me. if you take 1/15 * 1/14 you get 1/(15*14) which is ~0.5%. clearly the probability of colliding a particular planet should be *at least* on the order of 1 in 15, or ~6.6% since you actually get two shots at a collision, you would be tempted to say its 2/15, but actually its 1/15 + 1/14. i think you are right about probabilities multiplying, but i don't see how it can be right in the context of the case i'm describing. perhaps i'm missing something  show me how your probability summation works for the case where you want to smash a single planet.
_________________ twgs : telnet://twgs.thereverend.org:5023 web : http://www.thereverend.org games : http://www.thestardock.com/twgssearch/i ... verend.org helper : http://svn.thereverend.org:8080/revhelper/

Mon Mar 09, 2009 8:39 pm 


Singularity
Veteran Op
Joined: Thu Jun 02, 2005 2:00 am Posts: 5558 Location: USA

Re: Planet Collision Formula
Quote: this doesn't make sense to me. if you take 1/15 * 1/14 you get 1/(15*14) which is ~0.5%. clearly the probability of colliding a particular planet should be *at least* on the order of 1 in 15, or ~6.6% since you actually get two shots at a collision, you would be tempted to say its 2/15, but actually its 1/15 + 1/14. It's a conditional probability problem. The probability of colliding any one given planet (chosen in advance) is 1/15 on the first selection, but on the 2nd selection it's not because there is a smaller number of planets. Assuming the planet you chose was not selected the first time around, the odds of having it selected the 2nd time (if that was even possible) is 1/14. Since the same planet cannot be chosen twice, you cannot do P(1)*P(2) here. Altho if somehow you could, then yes that would correct. What you're figuring up there isn't the odds of a particular planet being selected, but the odds of the same planet being selected twice. If a particular event has N possible outcomes, the total probability will be the sum of P1, P2... Pn. I think that's where scrat was going, summing the possible outcomes in both situations and dividing the 2. However: http://en.wikipedia.org/wiki/Conditional_probabilityWhen dealing with multiple events, the probability of 2 given outcomes, A and B, P(A+B) = P(A)*P(B). In otherwords with a single planet, you're not concerned with the conditional probability of the same planet getting smashed twice. You're only concerned with it getting hit once. In that case chose the best matching probability. In this case, the highest probability is 1/14, or 7.14%. If someone asked me "what are my odds of losing this one planet" that would be my answer, even tho it varies based on the trial. Now the odds of "atleast one planet" is trickier to figure up. Since either a planet (or 2) will get smashed or a planet won't get smashed, you have the same single event and 2 possible outcomes. Thus the probability of either, added together, is 1. At that point we can ask ourselves what the opposite case's probability is. What's the odds of none of our planets getting smashed? With 15 planets, 5 ours, 10 theirs, that's 10/15 on the first, 9/14 on the second. That's 42.85%, so the inverse, or 10042.85 = 57.15% That's a 57.15% chance of getting at least 1 enemy planet smashed, provided you don't care what planet it is. One of my favorite teaching games is similar to this. "9 or better" where you roll a die twice, and sum up the 2. If it's 9 or greater the player wins, if it's 8 or less, the house wins. Based on conditional probability you can work out the odds of the 2nd roll giving us a 9 or higher based on how the first roll turns out. It's a good thought experiment. Anyway, all of this is based on the "law of large numbers" which assumes that over the course of thousands of trials, these odds will play out. The truth is, it doesn't happen that often in a game. It might happen once, but for all intents, it might as well be 50/50, since you either lose a planet or you don't. Obviously if you're overloaded and can't blow the overload, your best bet is to reduce your risk in the sector. Move what planets you can out of there, remove what resources you can, reduce your overall risk. Because while the odds may be such and such, none of that will matter if you lose a critical planet.
_________________ May the unholy fires of corbomite ignite deep within the depths of your soul...
1. TWGS server @ twgs.navhaz.com 2. The NavHaz Junction  Tradewars 2002 Scripts, Resources and Downloads 3. Open IRC chat @ irc.freenode.net:6667 #twchan 4. Parrothead wrote: Jesus wouldn't Subspace Crawl.
*** SG memorial donations via paypal to: dpocky68@booinc.com

Mon Mar 09, 2009 9:08 pm 


Scrat
Chief Warrant Officer
Joined: Sun Jan 20, 2008 5:15 am Posts: 142

Re: Planet Collision Formula
Cool 57% is what I had for colliding at least 1 enemy planet when there are 5 enemy planets and 10 overload planets. To clarify how I got that I'll explain the process I used to get there.
First I needed to determine how many 2 planet combinations there were for a given number of planets. So...
for 2 planets there is 1 combination: AB for 3 planets 3 combinations: AB AC BC for 4 planets 6 combinations: AB AC AD BC BD CD for 5 planets 10 combinations: AB AC AD AE BC BD BE CD CE DE and so on giving the series: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105...
After doing some research I found that this series of "triangular numbers" was expressed by the equation n(n+1)/2. However since I wanted n to represent the total number of planets and not the position in the sequence I had to reduce n by 1 to get the desired results: (n1)(n+11)/2 = n(n1)/2
Now for 15 total planets 15(151)/2 = 105 total combinations and of those 10(101)/2 = 45 do not contain any enemy planets. Giving a 45/105 = 42.86% chance of not colliding an enemy planet or 1  45/105 = 57.14% to collide at least one.
After checking different combinations of the number of enemy planets and total planets, I can confirm that for a max planets per sector of 5 that 15 total planets is indeed the sweet spot and always gives the best chance for taking out at least one enemy planet. If I have some time later I'll try to create an Excel file that contains either a collision calculator or matrix or both...

Tue Mar 10, 2009 1:00 am 


Singularity
Veteran Op
Joined: Thu Jun 02, 2005 2:00 am Posts: 5558 Location: USA

Re: Planet Collision Formula
Ahh. Yea, when I hit 57.15% earlier I started thinking about the permutations of one set versus another and suspected that's what you were doing. Basically figuring up the number of 2 planet combinations for X total planets. We can apply factorial combinations and get the same results I suspect. Linky: http://en.wikipedia.org/wiki/Combinationn! / k!(nk)! Where n is the size of the set, and k is the size of the combinations. So for 10 elements and combinations of 2: 10! / 2!*8! = 3628800 / 80640 = 45 For 15 elements and combinations of 2: 15! / 2! * 13! = (15!/13!) / 2 = 105 So yea, 45 that contain no enemy planets (the 10). 105 total (the 15). 45/105 = .42857. A 42.857% chance of no collision. 1(45/105) = .57143 or 57.14%. That's within rounding error of my earlier 1(P(A)*P(B)) approach. It's interesting that your equation works for factorials in the case where k=2. Since 2! = 2... n! / 2 * (n2)! = n(n1)/2 Mult by 2... n! / (n2)! = n(n1) Which is kind of fascinating. 5! / 3! = 5(4) Which is true. 120/6 = 20. In other words your equation is the single step in the factorial recursion... you can see it here: http://en.wikipedia.org/wiki/FactorialSo any factorial where n!=n, you're good (ie: n<=2, n>0). Useful shorthand.
_________________ May the unholy fires of corbomite ignite deep within the depths of your soul...
1. TWGS server @ twgs.navhaz.com 2. The NavHaz Junction  Tradewars 2002 Scripts, Resources and Downloads 3. Open IRC chat @ irc.freenode.net:6667 #twchan 4. Parrothead wrote: Jesus wouldn't Subspace Crawl.
*** SG memorial donations via paypal to: dpocky68@booinc.com

Tue Mar 10, 2009 1:41 am 


the reverend
Gameop
Joined: Thu Mar 08, 2001 3:00 am Posts: 886 Location: USA

Re: Planet Collision Formula
Singularity wrote: It's a conditional probability problem. The probability of colliding any one given planet (chosen in advance) is 1/15 on the first selection, but on the 2nd selection it's not because there is a smaller number of planets. Assuming the planet you chose was not selected the first time around, the odds of having it selected the 2nd time (if that was even possible) is 1/14.
Since the same planet cannot be chosen twice, you cannot do P(1)*P(2) here. Altho if somehow you could, then yes that would correct. What you're figuring up there isn't the odds of a particular planet being selected, but the odds of the same planet being selected twice.
[...]
In otherwords with a single planet, you're not concerned with the conditional probability of the same planet getting smashed twice. You're only concerned with it getting hit once. In that case chose the best matching probability. In this case, the highest probability is 1/14, or 7.14%. If someone asked me "what are my odds of losing this one planet" that would be my answer, even tho it varies based on the trial. ok i can buy that the overall probability of smashing a particular planet is 1/14. that makes sense.
_________________ twgs : telnet://twgs.thereverend.org:5023 web : http://www.thereverend.org games : http://www.thestardock.com/twgssearch/i ... verend.org helper : http://svn.thereverend.org:8080/revhelper/

Tue Mar 10, 2009 8:52 am 


Traitor
Lieutenant Commander
Joined: Thu Mar 21, 2002 3:00 am Posts: 890 Location: USA

Re: Planet Collision Formula
small side note. It's not quite 10% per planet over, but that's close enough for practical purposes. (it only feels like having 1 planet over will force your 2 H's to collide, but having 9 over will result in no collision ) In the process of determining what the percetage actually was of a collision happening. I found a trend (just a slight uptick, really.) where lowered numbered planets collide less often than higher numbered planets. I only noticed it because the first planet I made in the sector took forever to collide. (i.e. not anywhere close to 1 in 14) So I started tracking planet numbers too. I scripted about 3500 externs and the lowest numberd planet in the sector (didn't seem to matter what the number was) collided less than expected. I'm reasonably sure that if I had done 50,000 externs, it would have normalized. However, TW always surprises me. It's sorta like knowing what days are good days to SST. You would think it does't matter, but....surprise.
_________________ http://twcabal.navhaz.com  THE TW info site
Man, I gotta quit showing up here...next thing you know i'll get dragged back in.

Tue Mar 10, 2009 12:26 pm 



Who is online 
Users browsing this forum: No registered users and 4 guests 

You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum

