What's the probability of selecting a bucket by increasing chances every time? 
*

*There are n buckets

*Each bucket i has an associated weight 0 <= Wi <= 1

*sum(W1,..,Wn) = 1
Starting from the first bucket, you do the following:


*

*Roll a number between 0 and 1

*If the number is less than the bucket's weight, you win that bucket and the game is over

*If not, you go to the next bucket and repeat step 1 but with a twist: the weight of that bucket is now the sum of its weight plus the sum of the weights in front of it. If W'n is the new weight then W'n=W1+W2+...+Wn
Example:


*

*W = [0.1, 0.4, 0.3, 0.2]

*Roll 1: 0.5 > 0.1 -> no win

*Roll 2: 0.6 > 0.1 + 0.4 -> no win

*Roll 3: 0.2 < 0.1 + 0.4 + 0.3 -> you win bucket 3


What is the probably of getting a bucket k given the strategy above? 
I believe it is: Pk=(1-sum(P1,..,Pk-1))*sum(W1,..,Wk) but I would like someone to confirm that for me.
Edit: what's the name of this strategy (if it has a name)?
Edit2: reasoning behind the formula:


*

*P1 = W1 (obvious because it's just one bucket)

*P2 = (1-P1) * (W1 + W2) (the chance of not getting the first bucket times the chance of getting the second one when rolling for it)

*P3 = (1-P1-P2) * (W1 + W2 + W3) (the chance of not getting the first two buckets times the chance of getting the third when rolling for it)


Thanks!
 A: Your reasoning is fine as far as $P_1$ and $P_2$ go, but for $P_3$, notice that one needs to not win the first bucket and then not win the second bucket (which at that point, you have probability $W_1 + W_2$ to win, not $P_2$), so
$$\begin{align*} P_3
&= (1 - P_1) (1 - (W_1 + W_2)) (W_1 + W_2 + W_3) \\
&= (1 - W_1) (1 - W_1 - W_2) (W_1 + W_2 + W_3).
\end{align*}$$
In general,
$$P_k = (1 - W_1) (1 - W_1 - W_2) \cdots (1 - W_1 - W_2 \cdots W_{k-1}) (W_1 + W_2 + \cdots + W_k) .$$
A: Given weights $w_k$ for $k=1,\ldots,n$, then we can define a variable
$$W_k=\Pr[\text{win bucket }k\mid \text{get to roll }k]$$
which, using Matlab style notation, is W = cumsum(w). (Note that if the weights were not normalized, then we would just divide by sum(w).)
If we define
$$p_{k|k-1}=\Pr[\text{get to roll }k\mid \text{get to roll }k-1]$$
then this is just $p_{k|k-1}=1-W_{k-1}$.
For independent rolls then, the probability of getting to roll $k$ is 
$$p_k=p_{k-1} \times p_{k|k-1}$$
so p = cumprod[1,1-W(2:n-1)].
We then have to win, so finally we have P = p.*W(k).
General Advice: As you used some code style descriptions in your problem statement, it is probably safe to assume you are familiar with one or more programming languages? In this case, something to always try for problems like this is to run simulations, calculate their statistics, and then compare to your proposed solution.
