![p(x)=20x-7000](https://img.qammunity.org/2023/formulas/mathematics/college/r7nwgdk7w5jljjr44poqkf4g5ngpd4nb1r.png)
where:
x = the number of hats
p(x) = profit
To solve how many hats must be produced and sold to have a profit of $7 000, let's replace p(x) with $7 000.
![7,000=20x-7000](https://img.qammunity.org/2023/formulas/mathematics/college/xlc6qfebr6sba49ty0pcoj0wvi01bfpx70.png)
The next step is to isolate the term with the variable "x" on one side. For this to happen, let's add 7,000 on both sides of the equation.
![\begin{gathered} 7,000+7,000=20x-7,000+7,000 \\ 14,000=20x \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/j1gr3d1wba47v1ykyntch1cv3trw6thcsf.png)
The last step is to divide both sides of the equation by 20 to solve x.
![\begin{gathered} (14,000)/(20)=(20x)/(20) \\ 700=x \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/nhuquuiy1cfeoj404zn67zz2abg28nh50z.png)
Therefore, 700 hats must be produced and sold to gain a profit of $7,000.
In order to avoid loss, the profit must be either zero or greater than that. To determine the least number of hats to be produced and sold to avoid loss, let's replace p(x) = 0.
![0=20x-7000](https://img.qammunity.org/2023/formulas/mathematics/college/1tosrhe8alcel79m2fcta1rson1ck15qbz.png)
Same process: Isolate the term with a variable "x" on one side. To do this, add 7000 on both sides of the equation.
![\begin{gathered} 0+7000=20x-7000+7000 \\ 7000=20x \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/odqs5wnnkohpviayo7dqk2q5uuq899sjq4.png)
Last step, divide both sides of the equation by 20.
![\begin{gathered} (7000)/(20)=(20x)/(20) \\ 350=x \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/5hi8mz30iapyeropuvkdghuy0zh6xqk8vu.png)
Therefore, to avoid loss, they must produce and sell at least 350 hats.