Farmer John looks out onto his farm and counts 16 heads. The only animals are cows and chicken. He then counts 42 legs in all. How many of each animal does farmer John have?

number of cows --- x

number of chickesn ---- 16-x

4x + 2(16-x) = 42

solve for x

x = 5

I don't know could you please help me

To solve this problem, we will use a system of equations to represent the given information.

Let's assume the number of cows is 'c' and the number of chickens is 'h'.

From the given information, we have two equations:

Equation 1: c + h = 16 (The total number of animals is 16)
Equation 2: 4c + 2h = 42 (The total number of legs is 42)

We can solve this system of equations to find the values of 'c' and 'h' that satisfy both equations.

To solve this system of equations, we can use either the substitution method or the elimination method. Let's solve it using the elimination method:

Multiply Equation 1 by 2:

2c + 2h = 32

Now subtract the modified Equation 1 from Equation 2:

4c + 2h - (2c + 2h) = 42 - 32
2c = 10

Divide both sides of the equation by 2:

c = 5

Substitute the value of c back into Equation 1:

5 + h = 16

Subtract 5 from both sides of the equation:

h = 16 - 5
h = 11

So, the number of cows (c) is 5 and the number of chickens (h) is 11. Farmer John has 5 cows and 11 chickens.