To calculate the average speed of the swimmer, you can use the formula for average speed:
\[ \text{Average Speed} = \frac{\text{Total Distance}}{\text{Total Time}} \]
In this case, the total distance the swimmer swims is 20 meters, and the total time taken is 40 seconds.
Substituting the values into the formula:
\[ \text{Average Speed} = \frac{20 \text{ m}}{40 \text{ s}} = 0.5 \text{ m/s} \]
So, the swimmer's average speed is 0.5 m/s.