Advertisement

How many shots?

Started by November 18, 2001 09:26 AM
9 comments, last by balloon 23 years, 2 months ago
Imagine a space shooter game. Computer opponents shoot my ship and they hit me at probalitity 0.02 (2 shots out of 100 hits my ship). How many shots does an opponent average need to hit my ship? Is the answer as simple as 1 / 0.02 = 50 or do this need a moe complex formula? Thanks!
quote:
Original post by balloon
Imagine a space shooter game.
Computer opponents shoot my ship and they hit me at probalitity 0.02 (2 shots out of 100 hits my ship).
How many shots does an opponent average need to hit my ship?

In english, 2:100 OR one out of fifty shots hit. Yep, looks right.
-Tok
--------------------------~The Feature Creep of the Family~
Advertisement
It''s as simple as that.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
quote:
Original post by Tok
In english, 2:100 OR one out of fifty shots hit. Yep, looks right.

Just to be anal:
2:100 is not the same as 2/100 .

2:100 = 2/102.
Nope, well, that''s a methematical "nope"

In normal paper-mathematics, "/" = ":"

Ie: 4/2 = 2 = 4:2
The Anonymous Poster is correct. A ratio is different from a probability fraction. A ratio is opportunities for event one:opportunities for event two. A probability is opportunities for event x/total possible outcomes.

[Resist Windows XP''s Invasive Production Activation Technology!]
Advertisement
quote:
Original post by Null and Void
The Anonymous Poster is correct. A ratio is different from a probability fraction. A ratio is opportunities for event one:opportunities for event two . A probability is opportunities for event x/total possible outcomes .


Damn straight!
Well, I don''t know about english math symbols but I know an international one to desribe probabilities:
P(Condition)= Actions applying to condition / all possible actions

i.e:
Roling a normal dice and get 3:
P(3)=1/6

Just to confuse
Yeah, 2:3 = 2/5
> How many shots does an opponent average need to hit my ship?

That''s not a very clear question. If you mean "what is the average number of shots before the ship is hit ?" the answer is 50.

If you mean "how many shots until there''s a better than 50% chance the ship is hit ?" the answer is 35. The following table gives the chance of it being hit after a certain number of shots. Even after 100 shots there''s still about a 1 in 8 chance it''s not been hit.

1 0.02
2 0.0396
3 0.058808
4 0.07763184
5 0.096079203
6 0.114157619
7 0.131874467
8 0.149236977
9 0.166252238
10 0.182927193
15 0.261430897
20 0.332392028
25 0.39653527
30 0.454515681
34 0.496862632
35 0.506925379
40 0.554299596
45 0.597122136
50 0.63583032
60 0.702446857
70 0.756877419
80 0.80135115
90 0.837689426
100 0.867380444
John BlackburneProgrammer, The Pitbull Syndicate

This topic is closed to new replies.

Advertisement