Let 'p' and 'c' denote the number of pigs and the number of chickens, respectively.
Given that there are 30 heads, and we know that each animal has a single head,
Knowing that a pig has 4 legs, and a chicken has 2 legs. It is given that the total number of legs is 82,
Substitute the value of 'q' from first equation into the second equation,
Substitute the value in the first equation,
Thus, there are 11 pigs and 19 chickens.