SOLUTION: A farmer bought a number of pigs for $145. However, 8 of them died before he could sell the rest at a profit of 2 per pig. His total profit was $2. How many pigs did he originally

Algebra.Com
Question 1038295: A farmer bought a number of pigs for $145. However, 8 of them died before he could sell the rest at a profit of 2 per pig. His total profit was $2. How many pigs did he originally buy?
Found 2 solutions by Theo, Edwin McCravy:
Answer by Theo(13342)   (Show Source): You can put this solution on YOUR website!
there's an easy way to solve this.
since the number of pigs has to be an integer, then look for all the factors of 145.
you get 1 * 147 or 5 * 29 and i think nothing else.
it can't be 1 and it can't be 5 so it has to be either 147 or 29.
i went for 29 and got good results.
with 29 pigs bought, the cost per pig is 5 dollars.
8 pigs died, so 21 pigs were sold at a profit of 2 dollars apiece.
this means they were sold for 7 dollar each.
total revenue was 21 * 7 = 147 dollars.
total profit was 2 dollars.
solution looks good.

i had a lot more trouble solving it algebraically.
i finally latched on to a method that provided the algebraic solution.

let x = the number of pigs.
let c - the cost per pig.

since the total cost is 145, you get x*c = 145.

8 pigs died, so there were 21 pigs left.
these were sold at a profit of 2 dollars apiece.
the total profit was 2 dollars.

you get (x-8) * (c+2) = 147

since the cost per pig was c, then the revenue per pig had to be c+2 in order to get a profit of 2 dollars per pig.

the number of pigs sold was x-8.

since the total profit was 2 dollars, then the total revenue had to be 147 dollars because the total cost was 145 dollars.

the two equations you have are:

x*c = 145
(x-8) * (c+2) = 147

in the first equation, solve for c to get c = 145/x.

in the second equation, replace c with 145/x to get:

(x-8) * (c+2) = 147 becomes (x-8) * (145/x + 2) = 147

simplify by performing the multiplication to get 145 + 2x - (8*145)/x - 16 = 147

subtract 145 and add 16 to both sides of the equation to get 2x - (8*145)/x = 18

multiply both sides of this equation by x to get 2x^2 - (8*145) = 18x

subtract 18x from both sides of this equation and simplify 8*145 to get 2x^2 - 18x - 1160 = 0

divide both sides of the equation by 2 to get x^2 - 9x - 580 = 0

factor this quadratic equation to get (x-29) * (x+20) = 0

solve for x to get x = 29 or x = -20.

since the number of pigs can't be negative, then x = -20 is no good and your only valid solution is x = 29.

when x = 29, the total cost per pig is 145/29 = 5 dollars.
a profit of 2 dollars per pig sold means each pig that was sold brought in 7 dollars.
21 * 7 = 147.
the total revenue was 147 and the total cost was 145 which made the total profit equal to 2 dollars.

the solution is confirmed to be good.



Answer by Edwin McCravy(20056)   (Show Source): You can put this solution on YOUR website!
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

RELATED QUESTIONS

A farmer bought a number of pigs for $150. However, 8 of them died before he could sell... (answered by ikleyn,Edwin McCravy)
A farmer bought a number of pigs for $210. However, 3 of them died before he could sell... (answered by Fombitz)
A farmer bought a number of pigs for $252. However, 7 of them died before he could sell... (answered by stanbon,JoelSchwartz)
A farmer bought a number of pigs for $290. However, 7 of them died before he could sell... (answered by josmiceli)
A farmer bought a number of pigs for $203. However, 6 of them died before he could sell... (answered by ikleyn)
A farmer bought a number of pigs for $100. However, 5 of them died before he could sell... (answered by ikleyn)
A farmer bought a number of pigs for $200. However, 4 of them died before he could sell... (answered by ikleyn,greenestamps)
A farmer bought a number of pigs for $234. However, 8 of them died before he could sell... (answered by ikleyn)
A farmer bought a number of pigs for $140. However, 5 of them died before he could sell... (answered by ankor@dixie-net.com,TeachMath)