Indistinguishability of exponentially close distributions
Here is the key. Let $A \otimes B$ be the distribution corresponding to a sample from $A$ and an independent sample from $B$, and denote total variation distance by $d_{TV}$. Then
$$d_{TV}(A_1 \otimes A_2, B_1 \otimes B_2) \leq d_{TV}(A_1,B_1) + d_{TV}(A_2,B_2)$$
We can see this using the $L_1$ formula for $d_{TV}$:
\begin{align}
d_{TV}(A_1\otimes A_2,B_1\otimes B_2) &amp;=
\frac{1}{2} \sum_{x_1,x_2} |\Pr[A_1=x_1]\Pr[A_2=x_2] - \Pr[B_1=x_1]\Pr[B_2=x_2]| \\ &amp;\leq
\frac{1}{2} \sum_{x_1,x_2} |\Pr[A_1=x_1]\Pr[A_2=x_2] - \Pr[B_1=x_1]\Pr[A_2=x_2]| \\ &amp;+
\frac{1}{2} \sum_{x_1,x_2} |\Pr[B_1=x_1]\Pr[A_2=x_2] - \Pr[B_1=x_1]\Pr[B_2=x_2]| \\ &amp;=
\frac{1}{2} \sum_{x_2} \Pr[A_2=x_2] \sum_{x_1} |\Pr[A_1=x_1] - \Pr[B_1=x_1]| \\ &amp;+
\frac{1}{2} \sum_{x_1} \Pr[B_1=x_1] \sum_{x_2} |\Pr[A_2=x_2] - \Pr[B_2=x_2]| \\ &amp;=
\sum_{x_2} \Pr[A_2=x_2] d_{TV}(A_1,B_1) + \sum_{x_1} \Pr[B_1=x_1] d_{TV}(A_2,B_2) \\ &amp;=
d_{TV}(A_1,B_1) + d_{TV}(A_2,B_2).
\end{align}
Now let $D^{\otimes n}$ denote $n$ independent samples from $D$. The above inequality shows that
$$
d_{TV}(D_1^{\otimes m}, D_2^{\otimes m}) \leq m d_{TV}(D_1,D_2).
$$
Let $E$ be the event that your algorithm outputs &quot;$D_1$&quot;. The definition of $d_{TV}$ guarantees that
$$
|\Pr_{D_1^{\otimes m}}[E] - \Pr_{D_2^{\otimes m}}[E]| \leq d_{TV}(D_1^{\otimes m}, D_2^{\otimes m}) \leq m d_{TV}(D_1,D_2).
$$
Here $\Pr_D$ denotes that the samples in the algorithm are generated from the distribution $D$.
We deduce that an algorithm with advantage $\delta$ must use at least $\delta/d_{TV}(D_1,D_2)$ samples.