Let \( x \) be the initial number of pencils in the box.
-
After half of the pencils disappeared, the number of pencils remaining is: \[ \text{Remaining} = x - \frac{1}{2}x = \frac{1}{2}x \]
-
Then, one third of the remaining pencils disappeared. One third of \(\frac{1}{2}x\) is: \[ \frac{1}{3} \left(\frac{1}{2}x\right) = \frac{1}{6}x \] Therefore, the number of pencils left after this is: \[ \text{Remaining} = \frac{1}{2}x - \frac{1}{6}x \] To combine these, we need a common denominator (which is 6): \[ \frac{1}{2}x = \frac{3}{6}x \quad \Rightarrow \quad \frac{3}{6}x - \frac{1}{6}x = \frac{2}{6}x = \frac{1}{3}x \]
-
Next, one fourth of the remaining \(\frac{1}{3}x\) disappeared. One fourth of \(\frac{1}{3}x\) is: \[ \frac{1}{4} \left(\frac{1}{3}x\right) = \frac{1}{12}x \] Therefore, the number of pencils left after this is: \[ \text{Remaining} = \frac{1}{3}x - \frac{1}{12}x \] To combine these, we again need a common denominator (which is 12): \[ \frac{1}{3}x = \frac{4}{12}x \quad \Rightarrow \quad \frac{4}{12}x - \frac{1}{12}x = \frac{3}{12}x = \frac{1}{4}x \]
-
Finally, we know that after all these reductions, there are 12 pencils left: \[ \frac{1}{4}x = 12 \]
-
To solve for \( x \), multiply both sides by 4: \[ x = 12 \times 4 = 48 \]
Thus, the initial number of pencils in the box was \(\boxed{48}\).