Solving Telephone Numbers


Being the sort of person who has trouble remembering people's names, never mind their phone numbers, I thought it would be a good idea if there was a function which generated the digits of anybody's number.

So for example to remember the college phone number all you need to know is the formula:

f(X) = -7/120X5 + 1 1/16 X4 - 9 5/24 X3 + 34 5/6 X2 - 59 11/15 X + 38

Which of course produces the table:

x123456
f(x)514663

Magic! Now to try it youself click on the blue bit just now and select 'Open this file from Current Location' and then it should open up in front of you.

Now there is a problem, phone numbers only have 6 digits (integers) and the equations generated by this method have 6 coefficients (real numbers) so it is in fact easier to remember the phone number than the equation. It was a good idea at the time!!

The spreadsheet always generates a polynomial with X5 as the greatest power, this function can therefore have a maximum of 4 turning points. This should be enough to fit to any 6 numbers, since the greatest number of turns achievable with 6 numbers is 4. (see picture)








Having decided that the functions should be a polynomial, we can generalise the formula as:

a X5 + b X4 + c X3 + d X2 + e X + f = g
So with the X values substituted in (X = 1,2,3,4,5,6) for the six digits:
1 a + 1 b + 1 c + 1 d + 1 e + f = DIGIT(1)
32 a + 16 b + 8 c + 4 d + 2 e + f = DIGIT(2)
243 a + 81 b + 27 c + 9 d + 3 e + f = DIGIT(3)
1024 a + 256 b + 64 c + 16 d + 4 e + f = DIGIT(4)

And so on. The result is to have 6 simultaneous equations with 6 unknowns(a,b,c,d,e,f), to solve, but how do you solve 6×6 simultaneous equations?

Gaussian Elimination

How this works is:

You have n simultaneous equations, with n unknowns, for example: Three equations(which we'll call A, B & C) with three knowns (P Q & R)

        
A2P+Q+R=22
BP+2Q+R=20
CP+Q+2R=18

To solve these, you must eliminate the terms one by one until you have a linear equation with one unknown. So to eliminate the Ps we would subtract 2 times equation C from equation A to form equation D, and 1 times equation C from equation B to form equation E:

A - 2C = D2P - 2P+Q - 2Q+R - 4R=22 - 18
B - C = EP - P+2Q - Q+R - 2R=20 - 18
D-Q+-3R=-14
EQ+-R=2

Now we add 1 times equation E to equation D (subtracting -1 times equation E) to eliminate the Qs

D + E = F-Q + Q+-3R - R=-14 + 2
F-4R=-12

Equation F is easy to solve so that R = 3. This value is now substituted back into equation D, so solve Q=5. And those two values are substituted into equation A to solve P = 7.



Previous     Return to MathSoc Index     Next


Credits: written by Luke Wakeling idea by Vickie Hinchcliffe