An algebra teacher drove past a farmyard that was full of chickens and pigs. The teacher happened to notice that there were a total of 70 heads and 200 legs. How many chickens and how many pigs were there?

30 pigs and 40 chickens

30 pigs 40 chickens

Let's solve this problem using a system of equations.

Let's assume that the number of chickens is 'c' and the number of pigs is 'p'.

According to the problem, the total number of heads is 70, which can be written as:
c + p = 70 (Equation 1)

Additionally, we know that the total number of legs is 200. Since each chicken has 2 legs and each pig has 4 legs, we can write the following equation:
2c + 4p = 200 (Equation 2)

Now we can solve this system of equations.

We can rewrite Equation 1 as:
2c + 2p = 140

By subtracting Equation 2 from this equation, we get:
2c + 2p - 2c - 4p = 140 - 200

By simplifying, we have:
-2p = -60

Dividing both sides by -2, we find:
p = 30

Substituting this value back into Equation 1, we have:
c + 30 = 70

Subtracting 30 from both sides, we find:
c = 40

Therefore, there are 40 chickens and 30 pigs in the farmyard.

To solve this problem, let's assign variables to represent the number of chickens and pigs.

Let's say:
c = number of chickens
p = number of pigs

Now, let's use the given information to form two equations:

1) The total number of heads: c + p = 70
2) The total number of legs: 2c + 4p = 200

We have a system of two equations with two variables. We can solve this system using substitution or elimination method.

Let me use the elimination method to solve it.

Multiplying the first equation by 2, we get: 2c + 2p = 140.

Now, subtract this equation from the second equation:
(2c + 4p) - (2c + 2p) = 200 - 140
2c - 2c + 4p - 2p = 60
2p = 60
p = 60/2
p = 30

Now that we have the value of p, we can substitute it back into the first equation to find the value of c:

c + 30 = 70
c = 70 - 30
c = 40

So, there are 40 chickens and 30 pigs in the farmyard.