To work out David's average speed, we use the formula for average speed, which is the total distance traveled divided by the total time taken.
David walked a distance of 18 miles in 8 hours. Using the formula for average speed:
\[ \text{Average Speed} = \frac{\text{Distance Walked}}{\text{Time Taken}} \]
Substitute the given values into the formula:
\[ \text{Average Speed} = \frac{18 \text{ miles}}{8 \text{ hours}} \]
Now, divide 18 miles by 8 hours to find the average speed:
\[ \text{Average Speed} = 2.25 \text{ miles per hour} \]
So, David's average speed is 2.25 miles per hour.