Let's use variables:
* m = number of men
* h = number of horses
Set up the equations:
* Heads: m + h = 22
* Feet: 2m + 4h = 72 (Men have 2 feet, horses have 4)
Solve for the variables:
One way to solve is using substitution:
1. Solve the first equation for m: m = 22 - h
2. Substitute this value of m into the second equation: 2(22 - h) + 4h = 72
3. Simplify and solve for h: 44 - 2h + 4h = 72 --> 2h = 28 --> h = 14
4. Substitute the value of h back into either original equation to find m: m + 14 = 22 --> m = 8
Answer: There are 8 men and 14 horses in the stable.