Friday quiz maths question 26 Aug 2022

Today's question is 

I’ve thought of five numbers.  If I three of them together in each possible combination, the totals I get are 10, 14, 15, 16, 17, 17, 18, 21, 22 and 24.  What are the five numbers?

I'd love to see an answer involving algebra. I started with the assumption (correct, I believe) that the lowest three of the five numbers will add to 10, and the highest three will make the 24. 

So we've got A+B+C = 10 and C+D+E = 24 (if A-E go lowest to highest). We can get something from this (D+E)-(A+B)=14 and 2C+A+B+D+E = 34

It's interesting that two combinations make 17 but that's all I've got in that direction.

[Future me: I did a bit more work on the algebra and thought I was getting somewhere when I boiled those things down to 2C+2A+2B=20, then realised that's the A+B+C=10 that we started with! D'oh!]

So I did my usual thing and wrote a program to "try all of the numbers".

As I worked I realised that we don't know whether all of the numbers are different, whether they're integers, whether they're positive, whether zero might be one or more of the numbers (I would argue that zero isn't a number).

So as a starting point I made those assumptions - positive integers, all different. And I got an answer that seems to fit.

Here's my program, I happened to have my sixtyclone out and hooked up. It's pretty longwinded but hopefully reads OK because of that. The first few lines set up the loops, and they assume that each number is at least one more than the last. 


It tests for exactly two combinations that make 17, and  the lowest three making 10 and the highest three making 24.

In a matter of seconds it gives three possible answers. It was quick work to find which one of those can give 14, 15, 16 etc  with a combination of three. (It's the last one:  2,3,5,9,10)

The official answer comes in later but those seem to fit. 

Do you have a neater way to do this? Yes I could make my basic program more elegant, but is there a quicker way to find the answer, particularly in algebra?



Comments

Popular posts from this blog

e-ther 2 - Announcement and full rundown of features

Enclosures for MIDISID

MIDISID - second batch and giveaway