Sampling two elements without replacement; unequal probabilities; ugly formula

125 Views Asked by At

My problem: In a draw of size two out of sample of some size $n>2$ with unequal probabilities and no replacement, what are the chances of drawing element $x_i$ out of $x^T$ = $[x_1, x_2, \dots, x_n]$ where the probabilities are not simply $\frac{1}{n}$ but can differ for each element, i.e. $p^T = [p_1, p_2, \dots, p_n]$ and are equal to the relative size of the element to the total of the remaining sample?

If I think of this sequentially I can either draw it first, or in the second round, and at that point the probabilities turn conditional (also I could not draw it at all)

$$ P(x_i) + \sum_j P(x_j)P(x_i|x_j)$$

(where $j$ are the other elements $j \neq i$.)

Which seems to simplify to (seems correct since it consistent my with simulation)

$$P(x_i)\left(1 + \sum_j \frac{P(x_j)}{1-P(x_j)}\right)$$

My question: Can I simpilify this further?


Simulation (in R):

x = 1:4
p = c(1,2,3,2)/8

# My current expression
foo <- function(p, i) {
  p[i] * (1 + sum(p[-i] / (1 - p[-i]) ))
}
foo(p, 1)
# [1] 0.2833333

# simulation
set.seed(12)
ourf <- function() any(sample(x, size = 2, prob = p) == 1L)
mean(replicate(1e6, ourf()))
# [1] 0.28263
```
1

There are 1 best solutions below

3
On

You can compute the probability of the complement event, which is not to picking up the sample $i$. This is equal to $\sum \limits_{j \neq i} p_j \frac{1-p_i-p_j}{1-p_j}$. Hence your answer is $1-\sum \limits_{j \neq i} p_j \frac{1-p_i-p_j}{1-p_j}$.