Answer:
Hi, let's turn the word problem into a set of equations:
Let's say that x = # of chickens, and y = # of pigs
If there are 13 animals altogether, that means that
x + y = 13
If there are 40 legs together, we know that chickens have 2 legs, while pigs have 4, so the total number of legs would be:
2x + 4y = 40
We now have two different equations, with the same two variables, so we can rearrange and substitute one equation into the other to solve. We can rearrange the first equation as:
x + y = 13
x = 13 - y
Let's plug this expression for "x" into the second equation:
2(13-y) + 4y = 40
Now we have an equation with only one variable, so we can use algebra to solve for y:
26 - 2y + 4y = 40
2y = 14
y = 7, there must be 7 pigs.
From the first equation that we rearranged,
x = 13 - y
Now that we know the numerical value of "y", we can plug that in:
x = 13 - 7
x = 6, there must be 6 chickens