Re: Planet Collision Formula
Quote:
ok, so i did this brute force. given 15 planets, there are 105 possible unique pairings of planets that can collide. out of those 105 pairs, 14 of the pairs contain one particular planet. so the probability of colliding that planet is 14/105, which happens to equal 1/14 + 1/15 - 1/(14*15), or 13.33%. so my original equation was close to right.
If you treat it as a conditional, yes.
Let's work thru with a smaller number of planets, say 5.
1-2, 1-3, 1-4, 1-5
2-1, 2-3, 2-4, 2-5
3-1, 3-2, 3-4, 3-5
4-1, 4-2, 4-3, 4-5
5-1, 5-2, 5-3, 5-4
Or 20 pairings w/ duplicates. W/o duplicates:
1-2, 1-3, 1-4, 1-5
2-3, 2-4, 2-5
3-4, 3-5
4-5
10 pairs. There's an equation for this to make it easy:
n! / k!(n-k)!
Where n is the number of elements and k is the size of each set. So...
5! / 2!*3! = 120 / 2*6 = 120/12 = 10
If you had planet #1, there would be 4 sets. Planet #2, same, 3, same, etc.
In otherwords for a set of N elements, there exist N-1 sets that contain it.
In otherwords for a set of N elements with K sized pairs, you have...
probability = (n-1) / [n! / k!(n-k)!]
So if k=2 (looking for pairs) we have:
(n-1) / [n! / 2(n-2)!]
Invert and multiply...
probability = 2*(n-1)*[(n-2)!] / n!
So for 15 planets...
2*14*13! / 15!
Since 15! = 15 * 14 * 13! We have...
2*14 / 15*14
14 cancels and gives us 2/15 or 13.3%.
Which if you look back to my first post in the thread is exactly what I said.
But if all you want to know is what the odds of your planet colliding are on each selection, it's 1/15, then 1/14. Ie: If you don't want the conditional.