A farmer bought a number of pigs for $145.He bought pigs.
Each cost him dollars
...8 of them died...So he only had n-8 live pigs to sell.
...sell the rest at a profit of $2 per pig.He sold the live pigs for dollars each.
So he sold all live pigs for dollars,
and so his total profit on all the pigs living or dead was
dollars
His total profit was $2.We set those equal:
Multiply through by n
Divide through by 2:
rearrange in descending powers:
He had 29 pigs to begin with.
Checking:
He bought 29 pigs for $145.
So he paid $5 per pig.
8 pigs died.
He had 21 pigs left.
He made a profit of $2 on each pig sold.
So he sold each pig for $7
He took in 21 times $7 or $147.
He paid $149 for all the pigs living or dead.
He made $149-$147=$2 profit total.
So 29 is correct. He bought 29 pigs.
Edwin