# Waiting for Rescue

### From Braindead's Mordor Site

(put formulas in code boxes) |
|||

Line 2: | Line 2: | ||

''For Dungeon Level 1, formula is simple: 16/100 chance per day to get rescued. Now for the really messy problem. Chance for being rescued on Dungeon Levels below 1: You have (17-DunLvl) / 10000 chance of being rescued per day for the first Int(100 * LN(DunLvl)^2 + 22) days. After that, you have (17-DunLvl) / 1000 chance of being rescued per day.'' | ''For Dungeon Level 1, formula is simple: 16/100 chance per day to get rescued. Now for the really messy problem. Chance for being rescued on Dungeon Levels below 1: You have (17-DunLvl) / 10000 chance of being rescued per day for the first Int(100 * LN(DunLvl)^2 + 22) days. After that, you have (17-DunLvl) / 1000 chance of being rescued per day.'' | ||

- | If x = Int(100*ln(Dunlvl)^2+22), p=(17-DunLvl)^2/10000, and P=10*p, | + | If x = Int(100*ln(Dunlvl)^2+22), p=(17-DunLvl)^2/10000, and P=10*p, |

your cumulative chance of being rescued any day up to day n is: | your cumulative chance of being rescued any day up to day n is: | ||

<br> | <br> | ||

- | 1-(1-p)^n, if n < x | + | 1-(1-p)^n, if n < x |

<br> | <br> | ||

- | 1-(1-p)^x*(1-P)^(n-x), if n > x | + | 1-(1-p)^x*(1-P)^(n-x), if n > x |

Those formulae can be inverted to get the number of days to wait to have a particular decile or any other percentage chance of rescue: | Those formulae can be inverted to get the number of days to wait to have a particular decile or any other percentage chance of rescue: |

## Revision as of 11:57, 13 April 2006

In GaiaCat's own words:
*For Dungeon Level 1, formula is simple: 16/100 chance per day to get rescued. Now for the really messy problem. Chance for being rescued on Dungeon Levels below 1: You have (17-DunLvl) / 10000 chance of being rescued per day for the first Int(100 * LN(DunLvl)^2 + 22) days. After that, you have (17-DunLvl) / 1000 chance of being rescued per day.*

If x = Int(100*ln(Dunlvl)^2+22), p=(17-DunLvl)^2/10000, and P=10*p,

your cumulative chance of being rescued any day up to day n is:

1-(1-p)^n, if n < x

1-(1-p)^x*(1-P)^(n-x), if n > x

Those formulae can be inverted to get the number of days to wait to have a particular decile or any other percentage chance of rescue:

n=x+(ln(1-decile)-x*ln(1-p))/ln(1-P), if n > x, the other formula is easy enough to invert.

For convenience I have done the calculations for three quartiles, 90% and 99%:

Level | 25% | 50% | 75% | 90% | 99% |
---|---|---|---|---|---|

2 | 82,1 | 108,9 | 154,8 | 215,4 | 367,8 |

3 | 148,3 | 177,1 | 226,2 | 291,2 | 454,5 |

4 | 214,7 | 245,7 | 298,7 | 368,7 | 544,7 |

5 | 276,9 | 310,5 | 367,9 | 443,8 | 634,5 |

6 | 334,9 | 371,5 | 434,2 | 517,0 | 725,2 |

7 | 388,8 | 429,1 | 498,1 | 589,3 | 818,4 |

8 | 440,6 | 485,5 | 562,1 | 663,5 | 918,2 |

9 | 489,6 | 540,1 | 626,4 | 740,5 | 1027,1 |

10 | 537,9 | 595,6 | 694,3 | 824,8 | 1152,6 |

11 | 584,4 | 651,7 | 766,9 | 919,2 | 1301,8 |

12 | 632,6 | 713,5 | 851,8 | 1034,6 | 1494,0 |

13 | 683,0 | 784,2 | 957,1 | 1185,7 | 1760,2 |

14 | 742,0 | 877,0 | 1107,7 | 1412,7 | 2179,0 |

15 | 823,3 | 1025,8 | 1372,0 | 1829,7 | 2979,8 |

So if you die on level 15, you have a 99% chance of being rescued before the 3000-th day. Better not to think of the remaining 1%.