How to determine expected uptime of an event with a probability of 10%

24 Views Asked by At

So I'm trying to figure out how to model an event in a game with the following "parameters":

  • Event lasts 10 seconds
  • Probability it will happen is 10%
  • the chance to make it happen is rolled every 2 seconds and it can overlap (resulting in "wasted" time)

What I'm trying to determine without using a random number generator is how often it will take 1 roll, or 2 rolls, or 3 rolls, etc. to make it trigger, weighted together to give an average # of hits required while taking into consideration the duration loss from overlapping events.

I've looked into using 1 - (1 - 1/10) ^ n where n = number of hits but that just gives me the chance it will happen based on the number of hits. If it only takes 4 or less hits, there will be overlap.

I'm assuming 10 hits on average would be expected if I don't care about overlap, but that doesn't account for lost time because of overlapping events. So I'm expecting something closer to 14-15 but not sure how to approach that value.

Any suggestions?