Consider a sequence of random observations $(O(t))\_{t\geq 1}$, with $O(t)=(D(t),J(t),Y(t))$. Denote $\mathcal{F}(t) := \sigma(O(1),\ldots,O(t))$, the filtration induced by the first $t$ observations.


$J(t)$ takes values in $\{1,\ldots,J\}$, for some integer $J \geq 2$, and should be understood as the index of a bucket to which we add the observation $Y(t)$. Denote $\widetilde{Y}(j,n)$ the value of the $n$-th observation $Y(t)$ added to the bucket $j$. More formally, letting $n(j,t) := \sum\_{\tau=1}^t I(J(\tau)=j)$, the number of observations added to bucket $j$ up till time $t$, and letting $t(j,n) := \min\{t \geq 1: n(j,t) =n \}$, the time $t$ at which we added its $n$-th observation to bucket $j$, we have $\widetilde{Y}(j,n):=Y(t(j,n))$. Let $\widetilde{\mathcal{F}}(j,n):=\sigma(\widetilde{Y}(j,1),\ldots,\widetilde{Y}(j,n))$, the filtration induced by the first $n$ observations in bucket $j$.


We have the following information on the dependence structure of $(O(t))\_{t\geq 1}$.


* $(D(t))\_{t\geq 1}$ is a sequence of independent Bernoulli random variables taking value 1 with probability $\delta \in (0,1)$.
* We know that $J(t)|\mathcal{F}(t-1),D(t)=1 \sim \text{Uniform}(\{1,\ldots,J\})$, however, we don't know anything on the conditional distribution $J(t)|\mathcal{F}(t-1), D(t)=0$.
* For any $t \geq 1$, $Y(t)|\mathcal{F}(t-1),D(t),J(t)=j \sim Y(t)|\widetilde{\mathcal{F}}(j,n(j,t-1)), J(t)=j$. That is, $Y(t)$ depends on its past only through $J(t)$ and the observations added before it to its bucket. Another way of writing it is $Y(t)|\mathcal{F}(t-1),D(t),J(t)=j \sim \widetilde{Y}(j,n(j,t)) | \widetilde{Y}(j,1),\ldots,\widetilde{Y}(j,n(j,t)-1)$.


Are $\widetilde{Y}(j,n)$ and $D(t)$ independent for any $j$, $n$ and $t$? How would you prove it?



Independence in a sequential problem with observations getting added to buckets
Let for all $t\geq 1$,$\mathcal{F}^-(t):=\sigma(\mathcal{F}(t-1), D(t), J(t)).$
The hypothesis in the third bullet point can be rephrased as $Y(t)|\mathcal{F}^-(t) \stackrel{d}{=} \widetilde{Y}(j,n(j,t)) | \widetilde{\mathcal{F}}(j,n(j,t)-1)$.


I prove the claim by induction. Fix $j$ and $t$. I show by induction that for all $n \geq 1$, $D(t) {\perp\!\!\!\perp} \widetilde{\mathcal{F}}(j,n)$. I treat the base case at the end of the proof. Suppose that for some $n\geq1$, $D(t) {\perp\!\!\!\perp} \widetilde{\mathcal{F}}(j,n)$. Let us show that $D(t) {\perp\!\!\!\perp} \widetilde{\mathcal{F}}(j,n+1)$. It suffices to show that $D(t) {\perp\!\!\!\perp} \widetilde{Y}(j,n+1) | \widetilde{\mathcal{F}}(j,n)$. Observe that
\begin{align}
&P\left[\widetilde{Y}(j,n+1)=y,D(t)=d \middle| \widetilde{\mathcal{F}}(j,n)\right] \\
=& P\left[\widetilde{Y}(j,n+1)=y,D(t)=d, t(j,n+1)<t \middle| \widetilde{\mathcal{F}}(j,n)\right] \\
&+ P\left[\widetilde{Y}(j,n+1)=y, D(t)=d, t(j,n+1) \geq t \middle| \mathcal{F}(j,n)\right].
\end{align}
I start with the first term. I have that 
\begin{align}
&P\left[\widetilde{Y}(j,n+1)=y,D(t)=d, t(j,n+1)<t \middle| \widetilde{\mathcal{F}}(j,n)\right] \\
=& P \left[D(t)=d\middle| \widetilde{Y}(j,n+1)=y,t(j,n+1)<t \middle| \widetilde{\mathcal{F}}(j,n)\right] P \left[ \widetilde{Y}(j,n+1)=y,t(j,n+1)<t , \widetilde{\mathcal{F}}(j,n)\right] \\
=& P \left[D(t)=d\right] P \left[ \widetilde{Y}(j,n+1)=y,t(j,n+1)<t \middle| \widetilde{\mathcal{F}}(j,n)\right]
\end{align}
since $\{\widetilde{Y}(j,n)=y, t(j,n+1) < t \} \cap \widetilde{\mathcal{F}}(j,n)$ is $\mathcal{F}(t-1)$ measurable and $D(t) {\perp\!\!\!\perp} \mathcal{F}(t-1)$. Moreover, observe that $\{t(j,n+1) < t\} \cap \widetilde{\mathcal{F}}(j,n)$ is $\mathcal{F}^-(t(j,n+1))$-measurable, and therefore,
\begin{align}
&P \left[ \widetilde{Y}(j,n+1)=y \middle| t(j,n+1)<t, \widetilde{\mathcal{F}}(j,n)\right] \\
=& E \left[ P \left[ Y(t(j,n+1))=y \middle| \mathcal{F}^-(t(j,n+1))\right] \middle| t(j,n+1)<t, \widetilde{\mathcal{F}}(j,n)\right] \\
=& E \left[ P \left[\widetilde{Y}(j,n+1) \middle| \widetilde{\mathcal{F}}(j,n) \right] \middle| t(j,n+1) < t, \widetilde{\mathcal{F}}(j,n) \right] \\
=& P \left[\widetilde{Y}(j,n+1) \middle| \widetilde{\mathcal{F}}(j,n)\right].
\end{align}
Therefore,
\begin{align}
&P\left[\widetilde{Y}(j,n+1)=y,D(t)=d, t(j,n+1)<t \middle| \widetilde{\mathcal{F}}(j,n)\right] \\
=& P\left[\widetilde{Y}(j,n+1) \middle| \widetilde{\mathcal{F}}(j,n) \right] P \left[D(t)=d\right] P \left[ t(j,n+1) < t \middle| \widetilde{\mathcal{F}}(j,n) \right]\\
=& P\left[\widetilde{Y}(j,n+1) \middle| \widetilde{\mathcal{F}}(j,n) \right] P \left[D(t)=d, t(j,n+1) < t \middle| \widetilde{\mathcal{F}}(j,n) \right],
\end{align}
since $D(t) {\perp\!\!\!\perp} \{ t(j,n+1) < t\}$, as $\{ t(j,n+1) < t\}$ is $\mathcal{F}(t-1)$-measurable, and $D(t) {\perp\!\!\!\perp} \widetilde{\mathcal{F}}(j,n)$ by induction hypothesis, which imply that $D(t) {\perp\!\!\!\perp} \{ t(j,n+1)<t\} | \widetilde{\mathcal{F}}(j,n)$.


I now turn to the second term. Observe that $\{D(t)=d, t(j,n+1) \geq t \} \cap \mathcal{F}(j,n)$ is $\mathcal{F}^-(t(j,n+1))$-measurable. Therefore,
\begin{align}
&P \left[ \widetilde{Y}(j,n+1)=y \middle| D(t)=d, t(j,n+1) \geq t, \widetilde{\mathcal{F}}(j,n) \right] \\
=& E \left[ P \left[ Y(t(j,n+1))=y \middle| \mathcal{F}^-(t(j,n+1)) \right] \middle| D(t)=d, t(j,n+1) \geq t, \widetilde{\mathcal{F}}(j,n) \right] \\
=& E \left[ P \left[ \widetilde{Y}(j,n+1)=y \middle| \widetilde{\mathcal{F}}(j,n) \right] \middle| D(t)=d, t(j,n+1) \geq t, \widetilde{\mathcal{F}}(j,n+1) \right] \\
=& P \left[ \widetilde{Y}(j,n+1)=y \middle| \widetilde{\mathcal{F}}(j,n) \right].
\end{align}
Therefore, 
\begin{align}
&P\left[\widetilde{Y}(j,n+1)=y, D(t)=d, t(j,n+1) \geq t \middle| \widetilde{\mathcal{F}}(j,n)\right] \\
=& P \left[\widetilde{Y}(j,n+1)=y \middle| \widetilde{\mathcal{F}}(j,n) \right] P\left[D(t)=d, t(j,n+1) \geq t \middle| \widetilde{\mathcal{F}}(j,n) \right].
\end{align}
Therefore, adding up the identities for the two terms, I get 
\begin{align}
P\left[\widetilde{Y}(j,n+1)=y, D(t)=d \middle| \widetilde{\mathcal{F}}(j,n)\right] = P \left[\widetilde{Y}(j,n+1)=y \middle| \widetilde{\mathcal{F}}(j,n) \right] P\left[D(t)=d \middle| \widetilde{\mathcal{F}}(j,n) \right].
\end{align}
I have thus shown that $\widetilde{Y}(j,n+1) {\perp\!\!\!\perp} D(t) | \widetilde{\mathcal{F}}(j,n)$, which implies that $D(t) {\perp\!\!\!\perp} \widetilde{\mathcal{F}}(j,n+1)$.


The base case can be treated with the same arguments.


