Okay so I wanted to know exactly how the marines work, and figure out how valuable they are.
So I decided to look at the code, and from what I can determine, it works like this:
For each iteration, a random value from 0 - 255 is generated. If this number is less than 16, the marine dies. If it is between 16 and 143 inclusive, the ship loses one crew.
This would mean that each marine deals an average of 8 damage.
It is also absolutely false. The way the "marine code" works is (basically) that at various points in the game, it picks a random number between 0 and 4294967295, inclusive. If that number happens to be of a value below 144, the marine kills one member of the crew, and if it is below 16, the marine dies.
Not quite. The random value is cast to a BYTE, thereby only taking the lowest 8 bits, giving a value between 0 and 255 (inclusive). So each time the chance is 1/2 for an intruder to kill an enemy, 1/16 to die, and 7/16 to do nothing.
So 8 times out of 9 the marine kills a crew member, and 1 time out of 9 it is killed. So a marine, on average, kills 8 crewmen before dying. Just as you said.
I can substantiate this with real math (ignore if you are allergic )
Code:
A(n) = chance of a marine being alive at turn n = ((15/16) ^ n) K = chance of a marine killing a marine killing a enemy = (1/2) Enemies killed = SUM as n goes 1 -> infinity of (1/2) * (15/16) ^ n = (1/2) * (SUM as n goes 1 -> infinity of (15/16) ^ n) = (1/2) * (1 / (1 - (15/16) ) ) = (1/2) * (16) = 8
For once, the guestimate got it right! Usualy, the estimate people make about this sort of thing is way off.