In a geometric progression (GP), the nth term is given by the formula:
\[
T_n = a r^{n-1}
\]
where:
- \( T_n \) is the nth term,
- \( a \) is the first term,
- \( r \) is the common ratio, and
- \( n \) is the term number.
We are given:
- The 1st term \( T_1 = 512 \),
- The 20th term \( T_{20} = \frac{1}{1024} \).
Step 1: Use the formula for the nth term for the 1st term and 20th term.
For the 1st term, we have:
\[
T_1 = a r^{0} = a = 512
\]
So, \( a = 512 \).
For the 20th term, we have:
\[
T_{20} = a r^{19} = \frac{1}{1024}
\]
Substitute \( a = 512 \) into this equation:
\[
512 r^{19} = \frac{1}{1024}
\]
Step 2: Solve for \( r \).
Now, solve for \( r \):
\[
r^{19} = \frac{1}{1024} \times \frac{1}{512} = \frac{1}{1024 \times 512} = \frac{1}{2^{10} \times 2^9} = \frac{1}{2^{19}}
\]
Thus, we get:
\[
r^{19} = \frac{1}{2^{19}}
\]
Taking the 19th root of both sides:
\[
r = \frac{1}{2}
\]
Thus, the common ratio is:
\[
\boxed{r = \frac{1}{2}}
\]