A chef got 7 bags of onions. The red onions came in bags of 8 and the yellow onions came in bags of 3. If the chef got a total of 41 onions, how many bags of each type of onion did he get?

Respuesta :

Answer:

[tex]\#\text{ of 8-onion bags: }4,\\\#\text{ of 3-onion bags: }3[/tex]

Step-by-step explanation:

Let [tex]a[/tex] be the number of bags with 8 onions and let [tex]b[/tex] be the number of bags with 3 onions. We have the following system of equations:

[tex]\begin{cases}a+b=7,\\8a+3b=41\end{cases}[/tex]

Subtracting [tex]b[/tex] from both sides of the first equation, we get [tex]a=7-b[/tex]. Substitute this into the second equation:

[tex]8(7-b)+3b=41,\\56-8b+3b=41,\\56-5b=41,\\-5b=-15,\\b=\boxed{3}[/tex]

Therefore, the number of 8-onion bags is:

[tex]a=7-b,\\a=7-3,\\a=\boxed{4}[/tex]

Thus, the chef got 4 8-onion bags and 3 3-onion bags.