Let m represent the number of apple pies Sam is making and
Let n represent the number of pumpkin pies Sam is making
If Sam sells a total of 80 pies, this can be represented by
m + n = 80 ------------------------------equation (1)
If she makes a total of $512 on the same day, this cost can be represented by
6m + 7n = 512 ----------------------------equation (2)
Solving both equations simultaneously
m + n = 80
6m + 7n = 512
from m + n = 80,
m = 80 - n
substitute m = 80 - n into equation (2)
we have
6(80 -n) + 7n = 512
480 - 6n + 7n = 512
480 + n = 512
n = 512 - 480
n = 32
Put n = 32 into m = 80 - n
we have
m = 80 - 32
m = 48
The number of apple pies Sam sell is 48