Tuesday, January 31, 2012

Random Math Question

Sometimes, when there's no workload, you try to find something to do. Someone at the office forwarded an email asking to solve a word problem, so it got me going. The problem goes like:

'A man wanted to get into his work building, but he had forgotten his pin-code. However, he did remember five clues.
These are what those clues were:

The fifth number plus the third number equals 14.

The fourth number is one more than the second number.
The first number is one less than twice the second number.
The second number plus the third number equals 10.

The sum of all five numbers is 30.

What were the five numbers and in what order?'


Wow. Equations. So I opened my trusty notepad, and start translating the word problem to equations.

e + c = 14 (1)
d = b + 1  (2)
a = 2b - 1 (3)
b + c = 10 (4)
a + b + c + d + e = 30 (5)

Looking at the equations above, the most common variable is b. So we try to express all of the equations in terms of b.

Using (1) and (4), we get (6)
b + c = 10 (4)
c = 10 - b (6)

e + c = 14 (1)
c = 14 - e

Since both are equal to c, we solve to get (7).
14 - e = 10 - b
14 - 10 = e - b
4 = e - b
e = b + 4 (7)

We now have all equations with a common variable, b. Let's solve for b.
Plug (2), (3), (6) and (7) into (5)
(2b - 1) + b + (10 - b) + (b + 1) + (b + 4) = 30
4b + 14 = 30
4b = 30 - 14
4b = 16
b = 4

Substituting b,
(3) a = 2(4) - 1 = 7
     b = 4
(6) c = 10 - 4 = 6
(2) d = 4 + 1 = 5
(7) e = 14 - 6 = 8

Check:
7 + 4 + 6 + 5 + 8 = 30


No comments: