I'm reading the Judea Pearl Causality textbook and on page 4 he has the following illustration.
If we wish to calculate the probability that the outcome $X$ of the first die will be greater than the outcome $Y$ of the second, we can condition the event $A: X > Y$ on all possible values of $X$ and obtain
$$P(A) = \sum_{i=1}^6 P(Y < X | X = i) P(X = i)$$ $$ = \sum_{i=1}^6 P(Y < i)\frac{1}{6} $$ $$ = \sum_{i=1}^6 \sum_{j=1}^{i-1} P(Y = j)\frac{1}{6}$$ $$ = \frac{1}{6} \sum_{i=2}^6 \frac{i - 1}{6} = \frac{5}{12}$$
My question regards the fact that I'm just learning how to operate with summation rules. I understand this problem intuitively by imagining the dice, and I can easily verify the $\frac{5}{12}$ result by counting, but what I'm not sure about is if each formulation above is just a restatement using intuition, or if the equations are actually being transformed stepwise using rules, like in algebra.
Going from step 1 to step 2 seems pretty clear. $P(Y<i)$ is just a restatement of $P(Y<X|X=i)$ (using common sense if not some axiom...?), and then plugging in the "known" fact that rolling a particular number on one die is $\frac{1}{6}$.
Beyond that I'm kind of lost - I'm not sure why or how we went from step 2 to step 3. I understand that it's summing the odds of every occasion where the 2nd die is equal to a value less than the first die $(i-1)$ but I'm not sure why it was necessary to restate it this way. Isn't step 4 just as derivable from step 2 as from step 3?
I recognize pulling the constant out in front of the summation in step 4, but I'm not sure I understand the thought process behind the rest. It should apparently start with index 2 since index 1 would yield 0? Is that common practice? As for what led to the $\frac{i-1}{6}$ - is that just intuition (I understand it intuitively; it is the sum of probabilities the 2nd die is less than the first, for each possibility of the first die), or is it also some transformation rule written down somewhere?
Then, using the usual trick, I can sort of imagine i={2,6} + i={3,5} + i={4,4} + i={5,3} + i={6,2}, all divided by 2... using the arithmetic series, that would be:
$$\sum_{i=m}^n i = \frac{(n + 1 - m)(n + m)}{2}$$
$$\sum_{i=2}^6 \frac{i - 1}{6} = \frac{5\left((\frac{n - 1}{6}) + (\frac{m - 1}{6})\right)}{2} = \frac{5}{2}$$
Is that a proper thought process, to recognize it as a series and then just figure out how to apply it to a term? I don't know if it's always proper to sub in $n$ and $m$ like that - it seems to fit awkwardly with the arithmetic series formula I found on wikipedia.
Update:
After stumbling onto "index shifting", it seems like this is an easier way to reduce $\sum_{i=2}^6 \frac{i-1}{6}$ :
$$ = \frac{1}{6} \sum_{i=2}^6 i - 1 $$ $$ = \frac{1}{6} \sum_{i=1}^5 i $$ $$ = \frac{1}{6} \left( \frac{5(5+1)}{2} \right) $$ $$ = \frac{15}{6} = \frac{5}{2} $$
So I'm mostly still stuck on how to get in and out of Step 3.