Jump to content

Recommended Posts

Posted (edited)

A collegue arrived at the office this morning puzzling over his sons maths homework, the son is 10.

The question

Chocolate bars cost 26p

Fruit bars cost 18p

How many of each can I buy for EXACTLY 5 pounds (500p)? [whole bars only obviously]

It's easy enough to brute-force an answer, particularly if you use Excel to do the sums but is there an elegant bit of algebra that will yield the same results? It's been WAY too long since either of us did maths homework :o

EDIT I know the answer(s) by brute force, it's a more elegant method I'm looking for 'please show all working' :D

Edited by Crossy
Posted (edited)

I think there will always be a certain amount of brute force in this one.

One thing you can do is simplify the problem a bit:

26X + 18Y = 500 has the same solutions as

13X + 9 Y = 250 (by dividing both sides by 2).

Starting with the biggest possible value of x:

13*19 + 3 = 250

work your way down to

13*13 + 81 = 250, which is the first solution as we have

13*13 + 9*9 = 250. From here, every ninth one will be a solution, so

13*4 + 198 = 250 or

13*4 + 9*22 = 250 is a solution.

Therefore, the two possible solutions are:

1) 13 of the 26 pence bars and 9 of the 18 pence bars

2) 4 of the 26 pence bars and 22 of the 18 pence bars

There may be a more elegant way to solve the problem using number theory, but it would be, I suspect and as the professors often say, "beyond the scope" of your kid's class.

Edited by Jimmyd
Posted

Another way to do it came to mind--this one is even a bit easier.

After reducing the problem to 13X + 9Y = 250, all you need to do is to subtract 13 from 250 until you get a multiple of 9. This is easy to spot, because if all the digits of a number sum to a multiple of 9, then the number itself is a multiple of 9 and if they do not, the number is not a multiple of 9. Hence 111,333,222 is a multiple of 9 since 1+1+1+3+3+3+2+2+2 = 18 which is 2 times 9.

So:

250 (2+5+0=7)

237 (2+3+7=12)

224 (2+2+4=8)

211 (2+1+1=4)

198 (1+9+8=18=2*9 Bingo!)

And in this case, the thirteenth one below it will also work.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.



×
×
  • Create New...