To find out how many miles Mary walked in total, we need to add the distances she walked in the morning and in the afternoon.
- In the morning, Mary walked \( 2 \frac{1}{4} \) miles.
- In the afternoon, she walked \( 5 \frac{7}{8} \) miles.
First, we convert the mixed numbers to improper fractions.
For \( 2 \frac{1}{4} \): \[ 2 \frac{1}{4} = 2 \times 4 + 1 = 8 + 1 = 9 \quad \text{so,} \quad 2 \frac{1}{4} = \frac{9}{4} \]
For \( 5 \frac{7}{8} \): \[ 5 \frac{7}{8} = 5 \times 8 + 7 = 40 + 7 = 47 \quad \text{so,} \quad 5 \frac{7}{8} = \frac{47}{8} \]
Now, we will add the two improper fractions: \[ \frac{9}{4} + \frac{47}{8} \]
To add these fractions, we need a common denominator. The least common multiple of 4 and 8 is 8. We convert \( \frac{9}{4} \) to have a denominator of 8: \[ \frac{9}{4} = \frac{9 \times 2}{4 \times 2} = \frac{18}{8} \]
Now we can add the fractions: \[ \frac{18}{8} + \frac{47}{8} = \frac{18 + 47}{8} = \frac{65}{8} \]
Next, we convert \( \frac{65}{8} \) back to a mixed number. We divide 65 by 8: \[ 65 \div 8 = 8 \quad \text{remainder } 1 \] This means: \[ \frac{65}{8} = 8 \frac{1}{8} \]
Thus, the total distance Mary walked is: \[ \boxed{8 \frac{1}{8}} \text{ miles.} \]