How can we randomly select $k$ people out of $n$ such that for person $i$, the probability they get selected is $0<p_i<1$, and $\sum p_i=k$?
I'm struggling quite a bit on this; you could go about this by creating every combination, assigning a weight for each combination, then randomly selecting a combination, but I feel like this isn't very clean at all.
My idea is to randomly select a person for the first slot with probability $\frac{p_i}k$ for the $i$th person, then for the second slot we remove the person we added to our combination and normalize our probabilities so then we now have a $\frac{p_i}{k-p_1}$ chance of selecting the $i$th person for the second slot if we originally selected the 1st person for the first slot. The idea is essentially like putting all of these people as paper slips in a hat, where each slip has a weight, then randomly select slips without replacement.
However, I'm not sure if this actually works; I believe since these probabilities are conditional probabilities, each probability isn't independent, so this fails. Does there exist some kind of algorithm for this that does work and isn't so brute force?