To find the width of Nya's rectangular garden, we can use the formula for the perimeter of a rectangle, which is given by:
\[ P = 2 \times (length + width) \]
In this case, the perimeter \( P \) is 24 feet, and the length is 3 feet. We can plug in the values:
\[ 24 = 2 \times (3 + width) \]
Now, divide both sides by 2:
\[ 12 = 3 + width \]
Next, subtract 3 from both sides to solve for the width:
\[ width = 12 - 3 = 9 \]
Thus, the width needs to be 9 feet for the garden to work with 24 feet of fencing.
The correct response is 9.