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 ->  Finance -> 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       Log On


   



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) About Me  (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) About Me  (Show Source):
You can put this solution on YOUR website!
A farmer bought a number of pigs for $145.
He bought n pigs.

Each cost him 145%2Fn 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 n-8 live pigs for 145%2Fn+%2B+2 dollars each.

So he sold all n-8 live pigs for %28n-8%29%28145%2Fn%2B2%29 dollars, 

and so his total profit on all the pigs living or dead was

%28n-8%29%28145%2Fn%2B2%29-145 dollars
His total profit was $2.
We set those equal:

%28n-8%29%28145%2Fn%2B2%29-145%22%22=%22%222

145%2B2n-1160%2Fn-16-145%22%22=%22%222

2n-1160%2Fn-16%22%22=%22%222

2n-1160%2Fn-18%22%22=%22%220

Multiply through by n

2n%5E2-1160-18n%22%22=%22%220

Divide through by 2:

n%5E2-580-9n%22%22=%22%220

rearrange in descending powers:

n%5E2-9n-580%22%22=%22%220

%28n-29%29%28n%2B20%29%22%22=%22%220

matrix%282%2C2%2C%0D%0A%0D%0A+++n-29=0%2Cn%2B20=0%2C%0D%0A++++n=29%2C+n=-20%29

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