To determine the width of Nya's garden, we can use the formula for the perimeter of a rectangle, which is given by:
\[ P = 2 \times (length + width) \]
Nya has 24 feet of fencing for the perimeter, and she wants the length to be 3 feet. We can substitute the values into the perimeter formula:
\[ 24 = 2 \times (3 + width) \]
Now, we can 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 to find the width:
\[ width = \frac{18}{2} = 9 \]
So, the width needs to be 9 feet.