Understanding an expression of probability by the nth fixation There is a quality control inspector who searches for faults in newly produced items in a series  of independent "fixations". If p is the probability that a flaw is detected during any one fixation, apparently an expression can be formulated as follows for the probability that a flaw will be detected by the end of the nth fixation per the Solutions Manual of the 3rd ed of Modern Mathematical Statistics With Applications:

My issue is that I don't understand how the simplification takes place from the third last to the second last step. Why is the sum of (1-p)^i from i = 0 to n-1 equal to the ratio shown in the second last step? It looks like a complement of a probability, but I just can't figure out how this simplification is being done.

You have a geometric sum in $(1-p)$ and there is a well-known formula for this:
$$
\sum_{i=1}^m ar^k = a\frac{1-r^{m+1}}{1-r},
$$
and if you substitute $a=p$, $m = n-1$ and $r = 1-p$, you will arrive at your formula.
