# Apple puzzle math

For convenience, he put some apples in 3 types of boxes, boxes of 1kg, 3kg and 5kg. He has a total of 10 cases of various kinds.

Can he put 25kg apple to fit into 10 boxes?

I'm thinking about creating $x,y,z \in \mathbb{N}$ and makes 3 equations to solve $x,y,z$ But I'm lack 1 equation to solve :(

• Since you only need to know if there is a solution, you don't need three equations to solve this problem. The trick is that you are looking for whether there are natural number solutions. Commented Sep 5, 2012 at 15:39
• Do you have to end up with (i) ten full boxes/cases; or (ii) some full boxes and some empty boxes; or (iii) can some boxes end up part full? Commented Sep 5, 2012 at 15:42

You can set up equations. If we use $x$, $y$, $z$ boxes of size $1$, $3$, $5$ respectively, then $x+3y+5z=25$ and $x+y+z=10$. Subtract. You get $2y+4z=15$. This is impossible in integers, since $2y+4z$ is always even, and $15$ is odd.

So we cannot solve the problem using exactly $10$ boxes.

Remark: If we use an even number of boxes, the number of apples will always be even. For if we use an even number of boxes, then either (i) we use an even number of each kind or (ii) we use odd numbers of two kinds, and an even number of another. In case (i) it is clear that the number of apples will be even. The same is true in case (ii).

If $x$ is the number of 1kg boxes, $y$ the number of 3kg boxes and $z$ the number of 5kg boxes, you want to solve

$x+y+z = 10$ so that 10 boxes are used

$x+3y+5z = 25$ so that 25kg of apples are used.

Additionally, you have the constraints that $x,y,z$ are non-negative integers. There is no third equation involved, there may be several solutions - or already none because of the integer constraints.

In fact, subtracting the first from the second equation produces $2y+4z = 15$. The left hand side is even, the right hand side is odd. This can't be, hence there is no solution. The answer to the question is "no".

If $x,y,z$ are integers such that $x+y+z=10$, then there are two possibilities:

$\hskip1cm$ (i) All of $x,y,z$ are even numbers.

$\hskip1cm$ (ii) One of $x,y,z$ is even and the two other numbers are odd.

In both cases, $x+3y+5z$ will be an even number, so it cannot be equal to $25$.

You correctly identified that your equations are

\begin{align*} x+3y+5z &= 25 \\ x+y+z &= 10 \end{align*}

And indeed, you only have two equations. However, you have the following constraints: $x,y,z$ are integers.

Subtract the second from the first and you can eliminate $x$ -- can integers $y$ and $z$ solve the resulting equation?

so there are 3 types of boxes, 1kg, 3kg and 5kg. two conditions are there: 1) not all types boxes are used 2) atleast one of each type box is used.

considering condition 1

observation: salesman cant use six boxes of 5kg (total exceeds 25kg). so total no of 5kg box is less than or equal to five.

case 1: five boxes of 5kg total sums upto 25kg, so only possibility is zero 3kg box and zero 1 kg box (solution 1)

case 2: four boxes of 5kg total sums upto 20kg, so maximum number of 3kg boxes cant be more than one (20+(2)*3>25). possibilities are, one 3kg boxes and two 1kg boxes (solution 2) zero 3kg boxes and five 1kg boxes (solution 3)

case 3: three boxes of 5kg total sums upto 15kg, so maximum number of 3kg boxes cant be more than three (15+(4)*3>25). possibilities are, three 3kg boxes and one 1kg boxes (solution 4) two 3kg boxes and four 1kg boxes (solution 5) note: if number of 3kg box is less than two, then we need more than or equal to seven 1kg boxes, that exceeds total no of boxes above 10.

case 4: two boxes of 5kg total sums upto 10kg, so maximum number of 3kg boxes cant be more than five (10+(6)*3>25). possibilities are, five 3kg boxes and zero 1kg boxes (solution 6) four 3kg boxes and three 1kg boxes (solution 7) note: if number of 3kg box is less than four, then we need more than or equal to six 1kg boxes, that exceeds total no of boxes above 10.

case 5: one box of 5kg total sums upto 5kg, so maximum number of 3kg boxes cant be more than six (5+(7)*3>25). possibilities are, six 3kg boxes and two 1kg boxes (solution 8)
note: if number of 3kg box is less than six, then we need more than or equal to five 1kg boxes, that exceeds total no of boxes above 10.

case 6: zero box of 5kg total sums upto 0kg, so maximum number of 3kg boxes cant be more than eight (0+(9)*3>25). possibilities are, eight 3kg boxes and one 1kg boxes (solution 9)
note: if number of 3kg box is less than eight, then we need more than or equal to four 1kg boxes, that exceeds total no of boxes above 10.

solutions are:

1. five 5kg boxes, zero 3kg boxes and zero 1kg boxes
2. four 5kg boxes, zero 3kg boxes and five 1kg boxes
3. four 5kg boxes, one 3kg boxes and two 1kg boxes
4. three 5kg boxes, three 3kg boxes and one 1kg boxes
5. three 5kg boxes, two 3kg boxes and four 1kg boxes
6. two 5kg boxes, five 3kg boxes and zero 1kg boxes

7. two 5kg boxes, four 3kg boxes and three 1kg boxes

8. one 5kg boxes, six 3kg boxes and two 1kg boxes
9. zero 5kg boxes, eight 3kg boxes and one 1kg boxes

if the scenario of at least one of each type box being used is considered then solutions 3,4,5,7 and 8 is taken.