To find the fraction of trick-or-treaters who were dressed as either ghosts or witches, we need to add the fractions of those dressed as ghosts and those dressed as witches.
The fractions given are:
- Ghosts: \( \frac{1}{8} \)
- Witches: \( \frac{5}{12} \)
To add these fractions, we need a common denominator. The denominators are 8 and 12. The least common multiple (LCM) of 8 and 12 is 24.
Next, we convert each fraction to have the denominator of 24.
-
Convert \( \frac{1}{8} \): \[ \frac{1}{8} = \frac{1 \times 3}{8 \times 3} = \frac{3}{24} \]
-
Convert \( \frac{5}{12} \): \[ \frac{5}{12} = \frac{5 \times 2}{12 \times 2} = \frac{10}{24} \]
Now we can add the two fractions: \[ \frac{3}{24} + \frac{10}{24} = \frac{3 + 10}{24} = \frac{13}{24} \]
Therefore, the fraction of the trick-or-treaters who were dressed as either ghosts or witches is: \[ \boxed{\frac{13}{24}} \]