## pr.probability – Convergence of the probabilities that drifted Brownian motion with jump never hits zero (continuation)

This question can be seen as a continuation of my question at Convergence of the probabilities that drifted Brownian motion with jump never hits zero

Let $$(W_t)_{tge 0}$$ be a standard Brownian motion and define processes

$$X^n_t:=2+t+W_t-ell^n(t) quad mbox{and} quad X_t:=2+t+W_t-ell(t),quad mbox{for all } tge 0,$$

where $$(ell^n)_{nge 1}$$ and $$ell$$ are right-continuous and non-decreasing functions s.t. $$ell^n(0)=ell(0)=0$$ and $$0le ell^n(t), ell(t)le 1$$ for all $$tge 0$$. If $$lim_{ntoinfty}ell^n(t)=ell^n(t)$$ holds for all the points of continuity of $$ell$$, can we prove

$$lim_{ntoinfty}mathbb P(tau^n=infty)=mathbb P(tau=infty)?$$

Here $$tau^n:=inf{tge 0:~ X^n_tle 0}$$ and $$tau:=inf{tge 0:~ X_tle 0}$$.

## pr.probability – Convergence of the probabilities that drifted Brownian motion with jump never hits zero

Let $$X_t=2+t+W_t$$ for $$tge 0$$, where $$(W_t)_{tge 0}$$ is a standard Brownian motion. For every $$nge 1$$, set $$X^n_t:=X_t-{bf 1}_{tge n}$$. Denote respectively

$$tau:=inf{tge 0:~ X_tle 0}quad mbox{and} quad tau^n:=inf{tge 0:~ X^n_tle 0}.$$

Could we prove or disprove $$lim_{ntoinfty}mathbb P(tau^n=infty)=mathbb P(tau=infty)$$?

Personal thoughts : We can show $$mathbb P(tau^n=infty), mathbb P(tau=infty)>0$$ and $$mathbb P(tau^n=infty)ge mathbb P(tau=infty)$$. Consider their difference

$$mathbb P(tau^n=infty)- mathbb P(tau=infty)=mathbb P(X(t)>0, forall tge 0 mbox{ and } exists sge n mbox{ s.t. } X(s)le 1).$$

My feeling is that $$lim_{ntoinfty}mathbb P(X(t)>0, forall tge 0 mbox{ and } exists sge n mbox{ s.t. } X(s)le 1)>0$$ but I do not know how to prove it rigorously.

## co.combinatorics – A ratio of two probabilities

Ley $$t:=eta$$. Then
$$f(t)=frac{P(Gge K)}{P(B ge K)},$$
where $$G$$ is a random variable with the binomial distribution with parameters $$N,q_Gt$$ and $$B$$ is a random variable with the binomial distribution with parameters $$N,q_Bt$$; here we must assume that $$q_B>0$$ and $$tin(0,1/g_G)$$, so that $$q_Gt$$ and $$q_Bt$$ are in the interval $$(0,1)$$.

The random variables $$G$$ and $$B$$ have a monotone likelihood ratio (MLR): for each $$xin{0,dots,N}$$,
$$frac{P(G=x)}{P(B=x)}=CBig(frac{1-q_Gt}{1-q_Bt}Big)^{N-x},$$
which is decreasing in $$tin(0,1/g_G)$$; here, $$C$$ is a positive real number which does not depend on $$t$$.

It is well known that the MLR implies the MTR, the monotone tail ratio. Thus, the desired result follows.

## dnd 5e – Experimenting with advantage die from D&D 5th Ed. Need help with probabilities with anydice

I’m making my own system where I would generalize the advantage / disadvantage rule where you would always roll advantage when having a higher modifier than opponent and vice versa. If you have lower modifier than opponent, you always roll with disadvantage.

How would you compute in Anydice:

• Roll Xd20 take highest. Add modifier.

• When scoring a critical sum up 1 extra d20.

• When scoring multiple criticals sum up as much extra d20s.

Examples :

1. You roll 3d20 and score no critials.
Keep highest die, add modifier.

2. You roll 3d20 and score 1 critical.
Keep one d20 and add another one more d20 from the same roll to the result.

3. You roll 3d20 and score 2 criticals.
Keep one d20 and add another two more d20 from the same roll to the result.

I want to calculate the distribution to see what would be the weight of such changes compared to a simple roll 2d20 keep highest.

That’s where I have gotten so far with the anydice program:

https://anydice.com/program/2122a

## world of darkness – Calculating Modified V5 Dice Probabilities with AnyDice

My game uses 5th edition rules with a house rule where 1s subtract successes and 10s count as two successes. 2s through 5s count as no successes and 6s through 9s count as single successes as normal.

I’d like to compare the specific probability ranges to V5’s normal rules. What function can I use to do so over AnyDice?

## The probabilities of components A, B, C, D and E working are 0.7, 0.7, 0.7, 0.8 and 0.8, respectively. What is the probability that:

An electrical circuit has 5 components labelled A, B, C, D and E. The probabilities of components A, B, C, D and E working are 0.7, 0.7, 0.7, 0.8 and 0.8, respectively. What is the probability that:

I solved but I’m not sure it is correct.

• (a)
W is event that the system will be working
begin{align} & P(W) \ ={}& P(A cap B) cup P(C cap D cap E)\ ={}& P(A cap B) + P(C cap D cap E) – P(A cap B cap C cap D cap E)\ ={}& 0.7^2 + 0.8^3 – 0.7^2 0.8^3\ ={}& 0.75112 end{align}

• (b)
begin{align} & P(overline{A}|W) \ ={}& frac{P(overline{A} cap W)}{P(W)}\ ={}& frac{P(overline{A}BCDE cap overline{AB}CDE)}{P(W)}\ ={}& frac{0.3times0.7times0.8^3 + 0.3times0.30.8^3}{0.75112}\ ={}& frac{1920}{9389} end{align}

Am I correct all?

## pr.probability – CDF’s of Two Binomial Distributions with the Same Mean and Different Probabilities

Suppose we have two binomial random variables $$X_i sim B(frac{a}{p_i},p_i)$$ and $$X_j sim B(frac{a}{p_j},p_j)$$, where $$a$$ is a positive integer, and both $$frac{a}{p_i}$$ and $$frac{a}{p_j}$$ are integers. Assume $$p_i > p_j$$. In particular, we have $$E(X_i) = E(X_j) = a$$.

Let $$F_{X_i} (x)$$ and $$F_{X_j} (x)$$ denote the CDF’s of $$X_i$$ and $$X_j$$, respectively. It seems true (with an example in the image below) that $$F_{X_i} (x) < F_{X_j} (x)$$ for $$x < a$$ and $$F_{X_i} (x) > F_{X_j} (x)$$ for $$x > a$$. Is there a simple way to prove it (or, is this result somewhat established in literature)?

## probability or statistics – How to find individual probabilities of all numbers from a list?

I have the following list of random numbers:

`````` lis1={0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4,
4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11,
12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13,
14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24,
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26,
26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27,
27, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 31, 31,
32, 33, 34, 35, 38, 50}
``````

What I’d like to do is figure out the probability of picking a number from the list without having to input each number separately. For example: If I wanted to find the probability of picking out a 0, I could perform:

``````0.+ Count[lis1,0] / 276
``````

I could use this method for each unique number that appears, but that seems rather inconvenient for larger lists. Is there a simpler way to just iterate through all the unique numbers which appear in the list and find their respective probabilities? I would like to ultimately put all these probabilities into a list:

``````{Probability of picking 0, probability of picking 1, probability of picking 2, etc.}
``````

## mathematics – Calculating probabilities for a custom drop table system

I have a “drop table” / “loot table” / “item table” / “whatever you want to call it” system and I need to solve two Problems. Apologies in advance for the text wall :/

The Problems:

1. Calculate the probability of pulling a specific item from a table
2. Calculate the probability of pulling ANY item from a table with a specific tag (such as “Epic”, “Rare”, “Weapon”, “Sword”, “Currency”, etc)

A few details about the system:

1. Tables are setup with a certain number of ‘Slots’ and ‘Rolls’
2. Slots determines the total number of unique items that can be dropped from the table
3. Rolls determines how many times we ‘pull’ an item out of the table
4. Each row within a table will drop one of a pre-calculated set of items
5. Each row can be marked as ‘Guaranteed’, ‘Random’ or both (more on that in a bit)
6. Rows have a ‘MaxRollsToConsume’ field (0 == infinite rolls), and a Weight field (used for weighted randomness, 0 Weight = never pulled)

And a bit of pseudo code for how we actually pull items out of the table

``````create a guaranteed set of rows
create a random pool of rows
create a result with a set number of slots available to fill

(note: adding an item to the result will only fill a slot if that item does not already exist in the result)

foreach row in table
if row is guaranteed, then add to guaranteed set
if row is random, then add to random pool

foreach row in guaranteed set
pull item out of row and add it to result
consume a roll

while there are rolls remaining and empty slots in the result
select a row from the random set using weighted randomness and respecting the MaxRollsToConsume field
pull item out of row and add it to result
consume a roll
if this row has reached its max rolls then remove it from the random pool

while there are rolls remaining
select an item from the current result using weighted randomness and respecting the MaxRollsToConsume field
add the item to the result
consume a roll

return the result
``````

I understand how to calculate the probabilities for the ‘Guaranteed’ rows because, well, they are events that are guaranteed to happen so it’s pretty easy to calculate.

Where I’m falling short is on how to calculate the ‘Random’ rows (especially with respect to the MaxRollsToConsume field) and only pulling a certain number of times. For example, I have 5 random rows, but only 2 Rolls to consume. How do I calculate the probability of an item being pulled from one of the those 2 Rolls while also taking into account how many Rolls are allowed per row?

I’m fairly confident that if I can solve Problem 1 with some help then I’ll be able to solve Problem 2 on my own. Any help is appreciated and thanks in advance! If anything is unclear or more info is needed please let me know! 🙂

## statistics – Is it possible to model these probabilities in AnyDice?

Here’s a fairly efficient solution:

``````TARGET_DIST: (highest of 1@3d6 and (highest of 1@2d8 and 1@1d12))
output TARGET_DIST named "highest of 3d6, 2d8 and 1d12"

function: roll versus TARGET:n {
P: d6 > TARGET
Q: d8 > TARGET
R: d12 > TARGET
result: 2dP + 1dQ + 1dR
}
output (roll versus TARGET_DIST) named "2d6, 1d8 and 1d12 vs. highest of 3d6, 2d8 and 1d12"
``````

First, we calculate the distribution of the target number and save it in a custom die named `TARGET_DIST`. We can do that efficiently by taking the highest roll of each type of dice rolled by the opponent (which we can get with either `(highest of XdY)` or simply with `1@XdY`) and then take the highest of those using the built-in `(highest of NUMBER and NUMBER)` function. (If we wanted, we could also define a custom function with more parameters to calculate the highest of multiple numbers.)

Once we have the target number as a custom die, we pass it into a function as a numeric parameter (i.e. with `:n` after the parameter name) to “freeze” it. The reason we need to freeze the target number is because we’ll be comparing multiple different sized dice against it, and the probabilities of those comparisons succeeding will not be independent.

Inside the function, where `TARGET` is now a fixed number instead of a custom die, we can then calculate the distribution of successes for the player’s roll against the target number. The most efficient way to do that is to first define, for each die size in the pool, a corresponding custom die with the successful sides (i.e. those above the target number) relabeled as 1 and the rest as 0. We can then just roll the desired number of each of those custom dice and sum the results.

(We could skip the custom die definitions and just write the body of the function more concisely as `result: 2d(d6 > TARGET) + 1d(d8 > TARGET) + 1d(d12 > TARGET)`, but that syntax looks kind of weird and ugly.)

It’s also possible to make the function take the dice counts and sizes as parameters, but the syntax gets a bit verbose:

``````function: roll X x D and Y x E and Z x F versus TARGET:n {
P: D > TARGET
Q: E > TARGET
R: F > TARGET
result: XdP + YdQ + ZdR
}

output (roll 2 x d6 and 1 x d8 and 1 x d12 versus TARGET_DIST)
named "2d6, 1d8 and 1d12 vs. highest of 3d6, 2d8 and 1d12"
``````

(The reason for including the `x`‘s in the function name is that without them, AnyDice with parse e.g. `2 d6` as a single parameter, ignoring the space. You could remove them and write the parameters e.g. as `2 1d6` or `2 (d6)` to resolve the ambiguity, but I don’t really think that looks any better.)

And yes, this method works fine e.g. for your 4d6 and 6d20 vs. 6d6 and 4d20 example, with no risk of timeouts.