Answer:
The amount X she can retire out of every payment is $31,155.52.
Explanation:
We start calculating the amount needed to provide an perpetuity of X after the 20th deposit. The formula for the the present value of a perpetuity is

This is the amount of capital she has to have in her account to provide X yearly forever.
We have 20 payments, which are compunded at an effective rate of 5%. The amount deposit out every payment is (50,000-X).
We can write a timeline to see all the deposits
- Year 0: First deposit (50,000-X)
- Year 1: Second deposit (50,000-X)
- ...
- Year 19: Last deposit (50,000-X). By this time, the capital in the account should be 20X.
We can express then the capitalization of the deposit (C) as

This capital C has to be equal to 20X:

Then, the amount X she can retire out of every payment is $31,155.52.