Probability Assignment to Intervals in $\mathbb{R}^{n}$. Given a random variable $\bf{X}$ distributed on $\mathbb{R}^{n}$, let $F_{X}(t)$ be its distribution function. Suppose we want to find $P\left(\textbf{X} \in (\textbf{a}, \textbf{b}]\right)$. I was taught that 
$$P_{X}(\textbf{a}, \textbf{b}] = \sum_{s \in S} (-1)^{N_{a}(\textbf{s})} F_{X}(\textbf{s})$$
provided $\textbf{a} \leq \textbf{b}$. Here, $S = \{\textbf{x} \in \mathbb{R}^{n} : x_{i} = a_{i} \text{ or } x_{i} = b_{i} \text{ for all } i\}$ and $N_{a}(\textbf{s})$ counts the number of times that $s_{i} = a_{i}$ for $i = 1, \dots, n$.
In view of the alternating sum of the corners of a box (which is what $S$ is), is there anything like Stoke's Theorem at work here? It seems that all you really need to compute the probability is knowledge of $2^{n}$ points; this isn't quite the boundary of the box, so I'm not sure that this is the case.
What motivates this approach of summing the corners of the box determined by $(\textbf{a}, \textbf{b}]$? How is it justified? Are there any textbooks where I may find this sort of definition and a corresponding discussion/construction?
 A: Stokes is off-topic here but elementary set theory and algebra are very much on-topic. To see why, consider, for every $i$ in $\{1,2,\ldots,n\}$, the events $A_i=[X_i\leqslant a_i]$ and $B_i=[X_i\leqslant b_i]$, then $$[X\in(a,b]]=C,\qquad C=\bigcap_{i=1}^n(B_i\setminus A_i).$$ In terms of indicator functions, this reads
$$\mathbf 1_C=\prod_{i=1}^n\mathbf 1_{B_i\setminus A_i}=\prod_{i=1}^n(\mathbf 1_{B_i}-\mathbf 1_{A_i})=\sum_t(-1)^{|t|}\mathbf 1_{C(t)},$$ where, for every $t\subseteq\{1,2,\ldots,n\}$, $$C(t)=\bigcap_{i\in t}A_i\cap\bigcap_{i\notin t}B_i=[X\leqslant x(t)],$$ where each $x(t)=(x_i(t))_{1\leqslant i\leqslant n}$ in $\mathbb R^n$ is defined by $$\forall i\in t,\ x_i(t)=a_i,\qquad\forall i\notin t,\ x_i(t)=b_i.$$ Thus, $$P(X\in(a,b])=E(\mathbf 1_C)=\sum_t(-1)^{|t|}E(\mathbf 1_{C(t)})=\sum_t(-1)^{|t|}P(C(t))=\sum_t(-1)^{|t|}F_X(x(t)).$$ In the end, the formula reflects simply the canonical decomposition into a sum of monomials of the polynomial $Q_n$ in $2n$ unknowns $$Q_n(x_1,\ldots,x_n,y_1,\ldots,y_n)=\prod_{i=1}^n(y_i-x_i).$$
A: Hint: 
For $n=1$:
$$P_X(a,b] = P(\{X\leq b\}\setminus \{X\leq a\}) $$
$$= P(\{X\leq b\}) - P(\{X\leq a\}) = F_X(b)-F_X(a).$$
For $n=2$:
$$P_X(a,b] = P(\{X\leq (b_1,b_2)\}\setminus $$ $$\left( \left(\{X\leq (b_1,a_2)\} \setminus  \{X\leq (a_1,a_2)\}\right) \cup\left(\{X\leq (a_1,b_2)\} \setminus  \{X\leq (a_1,a_2)\}\right) \cup  \{X\leq (a_1,a_2)\} \right))$$
$$ = P(\{X\leq (b_1,b_2)\}) - P(\{X\leq (a_1,b_2)\}) -P(\{X\leq (b_1,a_2)\})+ P(\{X\leq (a_1,a_2)\})$$
$$ = F_X((b_1,b_2)) - F_X((a_1,b_2))-  F_X((b_1,a_2))+  F_X((a_1,a_2)). $$
Similar for $n\geq 3$. 
