Let p be the number of pigs and e be the number of peacocks.
According to the information given:
- Total number of eyes = 30
- Total number of feet = 44
Each pig has 2 eyes and 4 feet, while each peacock has 2 eyes and 2 feet. This gives the system of equations:
2p + 2e = 30 (total eyes)
4p + 2e = 44 (total feet)
Solving the system:
Subtracting the first equation from the second gives 2p = 14, so p = 7. Wait, let's recalculate carefully.
From 2p + 2e = 30, divide by 2: p + e = 15.
From 4p + 2e = 44, divide by 2: 2p + e = 22.
Subtracting p + e = 15 from 2p + e = 22 gives p = 7.
Then e = 15 - 7 = 8.
Let's verify: 7 pigs have 14 eyes and 28 feet. 8 peacocks have 16 eyes and 16 feet. Total eyes = 30. Total feet = 44. Correct.
Therefore, there are 7 pigs and 8 peacocks in the cage.