To determine the width of Nya's garden, we can use the formula for the perimeter of a rectangle:
\[ P = 2 \times (length + width) \]
Given that the perimeter \(P\) is 24 feet and the length is 3 feet, we can substitute these values into the formula:
\[ 24 = 2 \times (3 + width) \]
Now, simplify the equation:
\[ 24 = 6 + 2 \times width \]
Subtract 6 from both sides:
\[ 24 - 6 = 2 \times width \] \[ 18 = 2 \times width \]
Now, divide both sides by 2:
\[ width = \frac{18}{2} = 9 \]
Therefore, the width needs to be 9 feet. The correct answer is:
9