Let
![x](https://tex.z-dn.net/?f=x)
be the chocolate chip cookies, so the peanut butter treats will be
![144-x](https://tex.z-dn.net/?f=144-x)
.
We know that the cookies and the treats are in a ratio of 5:3, so:
![\frac{cookies}{treats} = \frac{5}{3} = \frac{x}{144-x}](https://tex.z-dn.net/?f=%20%5Cfrac%7Bcookies%7D%7Btreats%7D%20%3D%20%5Cfrac%7B5%7D%7B3%7D%20%3D%20%5Cfrac%7Bx%7D%7B144-x%7D%20)
Now we can solve for
![x](https://tex.z-dn.net/?f=x)
:
![\frac{5}{3} = \frac{x}{144-x}](https://tex.z-dn.net/?f=%20%5Cfrac%7B5%7D%7B3%7D%20%3D%20%5Cfrac%7Bx%7D%7B144-x%7D%20)
![5(144-x)=3x](https://tex.z-dn.net/?f=5%28144-x%29%3D3x)
![720-5x=3x](https://tex.z-dn.net/?f=720-5x%3D3x)
![8x=720](https://tex.z-dn.net/?f=8x%3D720)
![x= \frac{720}{8}](https://tex.z-dn.net/?f=x%3D%20%5Cfrac%7B720%7D%7B8%7D%20)
![x=90](https://tex.z-dn.net/?f=x%3D90)
We now know Lydia has 90 chocolate chip cookies, and
![144-x=144-90=54](https://tex.z-dn.net/?f=144-x%3D144-90%3D54)
peanut butter treats.
Then, Lydia's friend ate
![\frac{3}{5}](https://tex.z-dn.net/?f=%20%5Cfrac%7B3%7D%7B5%7D%20)
of her cookies, so her friend ate
![\frac{2}{5} (90)=36](https://tex.z-dn.net/?f=%20%5Cfrac%7B2%7D%7B5%7D%20%2890%29%3D36)
cookies. Therefore, Lydia has
![90-36=54](https://tex.z-dn.net/?f=90-36%3D54)
cookies left.
Now we can calculate the total amount of baked goods after her friend ate the cookies:
![144-54=90](https://tex.z-dn.net/?f=144-54%3D90)
Therefore, our remainder treats will be:
![90-x](https://tex.z-dn.net/?f=90-x)
We also now that after her friend ate 54 cookies and some treats, the new ratio is 6:1, and that's all we need to set up our new equation and solve it to find how many treats she ate:
![\frac{cookies}{treats} = \frac{6}{1} = \frac{54}{90-x}](https://tex.z-dn.net/?f=%20%5Cfrac%7Bcookies%7D%7Btreats%7D%20%3D%20%5Cfrac%7B6%7D%7B1%7D%20%3D%20%5Cfrac%7B54%7D%7B90-x%7D%20)
![6(90-x)=54](https://tex.z-dn.net/?f=6%2890-x%29%3D54)
![540-6x=54](https://tex.z-dn.net/?f=540-6x%3D54)
![6x=486](https://tex.z-dn.net/?f=6x%3D486)
![x= \frac{486}{6}](https://tex.z-dn.net/?f=x%3D%20%5Cfrac%7B486%7D%7B6%7D%20)
![x=81](https://tex.z-dn.net/?f=x%3D81)
Finally, if she ate 81 out 90 treats, we can conclude the Lydia has left with 9 peanut butter treats.