Find $\lim_{n\to \infty} \frac{{\sum}X(n)}{{\sum}Y(n)}?$ Let $p_n$ be the $n$-th prime.
Let $\{X(n)\}$ be a sequence where each element is a random number between $p_n$ and $p_{n+1}$.
Let $\{Y(n)\}$ be the sequence where each element represents random number between $1$ and $p_n$.
Then what is
$$ \lim_{n\to \infty} \frac{{\sum_{k=0}^n}X(k)}{{\sum_{k=0}^n}Y(k)}?$$
I used software to check the value $\frac{{\sum_{k=0}^n}\ \ X(k)}{{\sum_{k=0}^n}\ \ Y(k)}$ for large $n$ and they indicate that the limit is $2$. Here is an illustration for $n=9999$.
I would like to see if anyone can prove analytically that the limit is $2$.
 A: It is not enough to say that the $X(n)$ and $Y(n)$ are random numbers, otherwise the limit could be anything. For example, if you consider that $Y(n)=1$ with probability $1$ then it's not complicated to show that the limit is infinite.
I'm thus going to assume, based on the simulations you have given in the comments, that $X(n)$ follows a uniform distribution on $\{p_n,\cdots,p_{n+1}\}$, $Y(n)$ follows a uniform distribution on $\{1,\cdots,p_n\}$ and all random variables are independant from each other. Now, we have
$$\mathbb{E}[X(n)]=\frac{p_{n+1}+p_n}{2}~~\mbox{and}~~\mathbb{V}(X(n))=\frac{(p_{n+1}-p_n+1)^2-1}{12}$$
as well as
$$\mathbb{E}[Y(n)]=\frac{p_n+1}{2}~~\mbox{and}~~\mathbb{V}(Y(n))=\frac{p_n^2-1}{12}.$$
As a consequence, we can write
$$\mathbb{E}\left[\sum_{k=0}^nX(k)\right]=\frac{1}{2}\left(\sum_{k=0}^{n} p_{k+1}+\sum_{k=0}^n p_k\right)=p_{n+1} - p_0 + \sum_{k=0}^n p_k\substack{\sim \\ n\rightarrow\infty}\sum_{k=0}^n p_k$$
and
$$\mathbb{E}\left[\sum_{k=0}^nY(k)\right]=\frac{1}{2}\left(n+1+\sum_{k=0}^n p_k\right)\substack{\sim \\ n\rightarrow\infty}\frac{1}{2}\sum_{k=0}^n p_k.$$
As we can see, asymptotically, $\sum_{k=0}^nX(k)$ takes on average twice the value of $\sum_{k=0}^nY(k)$ which explains the result of your simulations but it still remains to prove it. In order to do that, we can write
$$\mathbb{V}\left(\frac{\sum_{k=0}^nY(k)}{\sum_{k=0}^n p_k}\right)=\frac{\sum_{k=0}^n (p_k^2-1)}{12\left(\sum_{k=0}^n p_k\right)^2}\leq \frac{p_n\sum_{k=0}^n p_k}{12\left(\sum_{k=0}^n p_k\right)^2}=\frac{p_n}{12\sum_{k=0}^n p_k}\substack{\longrightarrow \\ n\rightarrow\infty} 0$$
hence the random variables $\sum_{k=0}^nY(k)/\sum_{k=0}^n p_k$ converge in $\mathbb{L}^2$ norm, and thus in probability, towards
$$\lim_{n\rightarrow\infty}\mathbb{E}\left[\frac{\sum_{k=0}^nY(k)}{\sum_{k=0}^n p_k}\right]=\frac{1}{2}.$$
Because $X(n)$ has a smaller variance than $Y(n)$ for all $n\in\mathbb{N}$ then we can apply the same reasoning to the random variables $\{X(n)\}_{n\in\mathbb{N}}$ and get that $\sum_{k=0}^nX(k)/\sum_{k=0}^n p_k$ converges in $\mathbb{L}^2$ norm and thus in probability towards
$$\lim_{n\rightarrow\infty}\mathbb{E}\left[\frac{\sum_{k=0}^nX(k)}{\sum_{k=0}^n p_k}\right]=1.$$
We can finally conclude with
$$\frac{\sum_{k=0}^nX(k)}{\sum_{k=0}^nY(k)}=\frac{\sum_{k=0}^nX(k)/\sum_{k=0}^n p_k}{\sum_{k=0}^nY(k)/\sum_{k=0}^n p_k}\substack{\longrightarrow \\ n\rightarrow\infty} 2,$$
where the convergence is in probability.
