a farmer has sheep and hens the sheep and hens together have 200 heads and 112 legs how many sheep and hen does the farmer have?

Let's assume that x represents the number of sheep and y represents the number of hens.

From the problem, we know that:

x + y = 200 (since the total number of sheep and hens is 200)
4x + 2y = 112 (since each sheep has 4 legs and each hen has 2 legs, and the total number of legs is 112)

We can use the first equation to solve for one of the variables in terms of the other. For example, we can solve for y:

y = 200 - x

Substituting this expression for y into the second equation, we get:

4x + 2(200 - x) = 112

Simplifying this equation, we get:

2x + 200 = 112

Subtracting 200 from both sides, we get:

2x = -88

Dividing by 2, we get:

x = -44

This is obviously not a valid solution, since we can't have a negative number of sheep.

What went wrong? Let's think about what the problem is telling us. We know that the total number of legs is 112. But we also know that each sheep has 4 legs and each hen has 2 legs. This means that the total number of legs should be a multiple of 2 (since all the hens have an even number of legs) and a multiple of 4 (since all the sheep have 4 legs). But 112 is not a multiple of 4, so there is no solution to the problem as stated.

We can verify this by checking the other equation. If we solve for y in terms of x, we get:

y = 200 - x

Substituting this expression for y into the equation 4x + 2y = 112, we get:

4x + 2(200 - x) = 112

Simplifying, we get:

2x + 400 = 112

Subtracting 400 from both sides, we get:

2x = -288

Dividing by 2, we get:

x = -144

This is clearly not a valid solution.

So the answer to the problem is that there is no solution, since the conditions given are contradictory. This tells us that there must be some mistake in the problem statement, since it's impossible for the number of heads and legs to be what they claim to be.