Sized Biased Picking Distribution I am having trouble understanding the following proof on sized biased picking. We have the following situation:
Let $ X_1, \cdots , X_n $ be i.i.d. and positive, and $S_i = X_1 + \cdots + X_i$ for $ 1 \leq i \leq n $. The values of $S_i/S_n$ are used to partition the interval $[0,1]$, each sub-interval has size $Y_i = X_i/S_n$. Suppose $U$ is an independent uniform r.v. on $(0,1)$, and let $\hat{Y}$ denote the length of the sub-interval containing $U$. We aim to calculate the distribution of $\hat{Y}$.
The claimed result is $ \mathbb{P}(\hat{Y} \in dy) = n y \, \mathbb{P}(Y \in dy) $, where the notation means $\mathbb{P}(\hat{Y} \in A) = \int_A n y \mu(y) \, dy$ with $\mu$ the law of $Y$ (I think perhaps they mean the density function $f_Y(y)$).
The proof given is 
\begin{align*}
\mathbb{P}(\hat{Y} \in dy) &  = \sum_{i=1}^n \mathbb{P}\left(\hat{Y} \in dy, \frac{S_{i-1}}{s_n} \leq U < \frac{S_i}{S_n}\right) \\
& = \sum_{i=1}^n \mathbb{P}\left(\frac{X_i}{S_n} \in dy, \frac{S_{i-1}}{S_n} \leq U < \frac{S_i}{S_n}\right) \\
&  =  \sum_{i=1}^n \mathbb{E}\left[\frac{X_i}{S_n} \, 1\left(\frac{X_i}{S_n} \in dy\right)\right] \tag{$\ast $} \\
& = \sum_{i=1}^n y \, \mathbb{P}\left(\frac{X_i}{X_n} \in dy \right) \tag{$\ast  \ast $} \\
& =ny \, \mathbb{P}(Y \in dy) \\
\end{align*}
I do not understand the equalities $(\ast)$ and $(\ast \ast)$, and do not fully understand the notation given in the proof.
 A: I'm not sure I understand the notation in the proof, but the result is quick with a continuous version of Bayes' rule. Let $A_i$ be the event that $U$ lands in the $i^{\text{th}}$ interval. By symmetry, the unconditional probabilities $\Pr[A_1], \dots, \Pr[A_n]$ are all $\frac1n$.
Then
$$
   f_{Y_i \mid A_i}(y) = \frac{\Pr[A_i \mid Y_i = y] f_{Y_i}(y)}{\Pr[A_i]} = \frac{y f_{Y_i}(y)}{1/n} = n y f_{Y_i}(y) = ny f_Y(y).
$$
The conditioned random variable $Y_i \mid A_i$ is not literally the same thing as $\hat Y$. However, by the law of total probability, we have $$f_{\hat Y}(y) = \sum_{i=1}^n f_{\hat Y \mid A_i} (y) \Pr[A_i] = \sum_{i=1}^n f_{Y_i \mid A_i}(y) \Pr[A_i].$$ This is just an average of $f_{Y_i \mid A_i}(y)$ over $i=1,\dots,n$, and since they're all $ny f_Y(y)$, we conclude that $f_{\hat Y}(y) = ny f_Y(y)$.
Moreover, the intuition for the result comes from Bayes' rule. We are saying that the distribution of the size of the picked interval is scaled up in proportion to the probability that an interval of that size would be picked (turning $f_Y(y)$ into $y f_Y(y)$). The constant factor of $n$ is just there to make the whole thing integrate to $1$ again.
A: Eh, that notation looks like quite a bit of a scam; I assume they wanted to write densities, since that probability is certainly $0$ for most continuous distributions. If you see a question like this, you should $100\%$ do it the way @Misha has done in their answer. If you want to manipulate densities properly, you will want to invoke Radon-Nikodym theorem at some point, but since all you want to know what those stars are, here is their semi-formal "justification":
For $(*)$, the informal justification is that the probability that $U$ is in the $i$th interval is $\frac{X_i}{S_n}$ so it comes out of that expectation because of independence of $U$. Semi-formally, we first rewrite:
\begin{align*}
&\mathbb{P}\left(\frac{X_i}{S_n} \in dy, \frac{S_{i-1}}{S_n} \leq U < \frac{S_i}{S_n}\right) \\
&\stackrel?= \lim_{\epsilon \rightarrow 0} \frac{1}{2\epsilon}\mathbb{P}\left(\frac{X_i}{S_n} \in [y-\epsilon, y + \epsilon], \frac{S_{i-1}}{S_n} \leq U < \frac{S_i}{S_n}\right) \\
&=\lim_{\epsilon \rightarrow 0} \frac{1}{2\epsilon}\mathbb{E}\left[1\left(\frac{X_i}{S_n} \in [y-\epsilon, y + \epsilon], \frac{S_{i-1}}{S_n} \leq U < \frac{S_i}{S_n}\right)\right] \\
&=\lim_{\epsilon \rightarrow 0} \frac{1}{2\epsilon}\mathbb{E}\left[1\left(\frac{X_i}{S_n} \in [y-\epsilon, y + \epsilon]\right) 1\left(\frac{S_{i-1}}{S_n} \leq U < \frac{S_i}{S_n}\right)\right]\\
&=\lim_{\epsilon \rightarrow 0} \frac{1}{2\epsilon}\mathbb{E}\left[\mathbb{E}\left[1\left(\frac{X_i}{S_n} \in [y-\epsilon, y + \epsilon]\right) 1\left(\frac{S_{i-1}}{S_n} \leq U < \frac{S_i}{S_n}\right)\bigg|X, S\right]\right]\\
&=\lim_{\epsilon \rightarrow 0} \frac{1}{2\epsilon}\mathbb{E}\left[1\left(\frac{X_i}{S_n} \in [y-\epsilon, y + \epsilon]\right) \mathbb{E}\left[ 1\left(\frac{S_{i-1}}{S_n} \leq U < \frac{S_i}{S_n}\right)\bigg|X, S\right]\right]\\
&=\lim_{\epsilon \rightarrow 0} \frac{1}{2\epsilon}\mathbb{E}\left[1\left(\frac{X_i}{S_n} \in [y-\epsilon, y + \epsilon]\right) \frac{X_i}{S_n}\right]\\
&=\mathbb{E}\left[\frac{X_i}{S_n} \, 1\left(\frac{X_i}{S_n} \in dy\right)\right]
\end{align*}
Now, for $(**)$, informally, that indicator is only $1$ if that ratio is exactly $y$, so that random variable is either $y$ with probability equal to that ratio being equal to $y$, or $0$ otherwise. Semi-formally, we can write:
\begin{align*}
\mathbb{E}\left[\frac{X_i}{S_n} \, 1\left(\frac{X_i}{S_n} \in dy\right)\right] &= \lim_{\epsilon \rightarrow 0} \frac{1}{2\epsilon}\mathbb{E}\left[1\left(\frac{X_i}{S_n} \in [y-\epsilon, y + \epsilon]\right) \frac{X_i}{S_n}\right]
\end{align*}
Note that
$$ 
\begin{align*}
&(y-\epsilon)\mathbb{E}\left[1\left(\frac{X_i}{S_n} \in [y-\epsilon, y + \epsilon]\right)\right] \\
&\leq \mathbb{E}\left[1\left(\frac{X_i}{S_n} \in [y-\epsilon, y + \epsilon]\right) \frac{X_i}{S_n}\right] \\
&\leq (y + \epsilon)\mathbb{E}\left[1\left(\frac{X_i}{S_n} \in [y-\epsilon, y + \epsilon]\right)\right]
\end{align*}$$
and by plugging it into above and taking the limit as $\epsilon \rightarrow 0$, you can show that that equality holds.
