0

I have a sequence of sets $D_i$, and currently the sum is $$\sum_{i=1}^n \sum_{d\in D_i} 1 $$

How would I exchange the sum so that we run through $i$ first?

  • What is concretely $D_i$? Trivially the sum is $|D_1| + \cdots + |D_n|$. – Martín-Blas Pérez Pinilla May 28 '18 at 10:03
  • They're just sets. I originally went from $$\sum_{i=1}^n |D_i| $$ and wanted to use the OP summation to see the sum in a different expression.
    Does the exchange depend on what $D_i$ specifically is?
    – ColosseumsGra May 28 '18 at 10:04
  • Assuming $D_i \subseteq D$ for all $i \in {1, ..., n}$, where $D$ is some finite or countably infinite set, you could write:$$\sum_{i=1}^n \sum_{d \in D_i}1 = \sum_{i=1}^n \sum_{d \in D} 1_{{d \in D_i}}=\sum_{d\in D} \sum_{i=1}^n 1_{{d \in D_i}}$$ where $1_{{d \in D_i}}$ is an indicator function that is 1 if $d \in D_i$ and 0 else. – Michael May 28 '18 at 11:40
  • @Michael: a better notation will be $$\sum_{d\in D}\ \sum_{i=1}^n 1_{\scriptscriptstyle D_{\ i}}(d)$$. – Martín-Blas Pérez Pinilla May 30 '18 at 06:37
  • @Martín-BlasPérezPinilla : Thanks. I've always written such things like $1_{{d \in D_i}}$, or $1_A$ in general for a particular "event" $A$ of interest. It seems like that way places less burden on the reader to remember notation: If we see ${d \in D_i}$ we know that $D_i$ is some set and $d$ is an element of it. Perhaps I will try your notation sometime, one advantage of $1_{D_i}(d)$ is that it emphasizes the functional dependence on the $d$ parameter. – Michael May 30 '18 at 15:29

0 Answers0