Given data:
The total numbers of shelters are n=23.
The total nubers of legs are L=62.
Goat have 4 legs and duck have 2 legs.
Let x is the number of goats ten, numbers of the ducks are,
d=n-x
=23-x
The expression for the total numbers of legs are,
4x+2(23-x)=62
2x+46=62
2x=16
x=8
The numbers of ducks are
d=23-8
=15
Thus, total numbers of ducks are 15 and total numbers of goats are 8.