4 apples were thrown out
Here, we want to find the number of apple pies that were thrown out
If 75% were sold, then, 25% were thrown out
Let the total number of apples available be x
So if 12 were sold, (x-12) which corresponds to 25% were thrown out
Mathematically;

The number thrown out is simply (x-12) which is 16-12 = 4