Problem:
Say that I have a list of $n$ tasks to complete. Each of the tasks have independent probabilities $p_1, p_2, ..., p_n$ of completing that task. There is a particular task on the list that I want to get completed. However, the list will be generated in a random order and I have to complete each task in order. Once I complete the particular task that I have in mind, I have succeeded and the rest of the list does not matter. What is the probability that I will complete the task?
My attempt at solving it:
To make it easier, I assume that the task that I want to complete is task $n$ (the task with independent probability $p_n$). I hope I'm not messing anything up by making that assumption.
I read something that basically said that the total probability of completing task $n$ would be $$P(task_n) = \frac{1}{n}\sum_{i=1}^n \left(p_n*\left(\frac{\sum_{j=1}^{n-1} p_j}{n-1}\right)^{i-1}\right)$$ But although the equation seems to work for $i=1$ and $i=2$, it stops working after that point. I'm pretty sure that's because this equation is not taking into account that there is no repetition in the tasks.
Basically what that equation is trying to do is taking each possible location for $task_n$ to show up on the list, calculating the probability that you get to that task given that it is put in that position, and then averaging all of those together. That general approach made sense to me, because there is an equal probability of that task showing up in each position. So I tried figuring out equations given each position to see if I could find the pattern and extrapolate a general equation. I didn't get very far.
Case 1: $task_n$ shows up in position 1. $$P(task_n, pos_1)=p_n$$ This is the most straightforward case. If $task_n$ shows up first on the list, then the total probability of completing it is exactly the same as the independent probability of completing that task.
Case 2: $task_n$ shows up in position 2. $$P(task_n, pos_2)=p_n \left( \frac{\sum_{j=1}^{n-1}p_j}{n-1} \right)$$ Still pretty straightforward. If $task_n$ shows up second on the list, then the total probability of completing it is equal to its individual probability times the probability of whatever shows up in position 1. Since all other tasks on the list have an equal chance of showing up, average all those probabilities together.
Case 3: $task_n$ shows up in position 3. $$P(task_n, pos_3)=p_n \left( \frac{\sum_{j=1}^{n-1}p_j\left( \sum_{k=1}^{n-1}(p_k)-p_j \right)}{(n-1)(n-2)} \right)$$ So this is where it starts getting complicated, and I wasn't able to figure out any equation for position 4 or after. At this point, I can see that I'm just multiplying the probabilities of all previous tasks, but I'm basically subtracting out the instance that the task is repeated.
I know that another way to look at this is that we're finding the product of all possible ways to choose 1 out of $p_1, p_2, ..., p_{n-1}$, then choose 2, then choose 3, ... then choose $n-1$, and averaging that all out. I just don't know how to put that into a single formula.
I feel like I'm on the right track, but at the same time the equation gets so much more complicated after this that I feel like I'm not getting anywhere. I tried looking it up because this equation must exist out there somewhere, but I couldn't figure out how to search it because if I try looking for "permutations of probabilities" then I all I get is basic prealgebra homework problems. Please help, this has been killing my brain for days.
I see no elegant simplification to the mess; perhaps some other responder will. However, messy or not, a helper function can simplify the desired expression.
Without loss of generality, assume that you want to know the specific probability of completing task $(n)$.
For $k \in \{1,2,\cdots, (n-1)\}$, let $S_k$ denote the sum of the $~\displaystyle \binom{n-1}{k}~$ terms given by
$$S_k = \sum_{1 \leq i_1 < i_2 < \cdots < i_k \leq (n-1)} \left[\prod_{j=1}^k p_{i_j} \right].$$
Then, under the assumption that there are exactly $(k)$ tasks ahead of task $(n)$, the probability of completing task $(n)$ is
$$p_n \times \frac{S_k}{\binom{n-1}{k}}.$$
Let $S_0$ denote $(1).$
Then, the desired overall probability is
$$\sum_{k=0}^{n-1} \left[\frac{p_n}{n} \times \frac{S_k}{\binom{n-1}{k}}\right].$$