ThatDonGuy
Joined: Jun 22, 2011
• Posts: 4194
January 24th, 2014 at 6:45:03 PM permalink
Quote: AxiomOfChoice

Aren't there infinitely many solutions to that?

Yes - in fact, I'm pretty sure that there is a solution P(x) = ax3 + bx2 + cx + d for every integer a.

I used a differences method on P(29) - P(28) and P(28) - P(27) to get:

216 x2 - 12013 x + 167020
kubikulann
Joined: Jun 28, 2011
• Posts: 905
January 25th, 2014 at 6:42:00 AM permalink

Quote: ThatDonGuy

Yes - in fact, I'm pretty sure that there is a solution P(x) = ax3 + bx2 + cx + d for every integer a.

I used a differences method on P(29) - P(28) and P(28) - P(27) to get:

216 x2 - 12013 x + 167020

Indeed, one of many possibilities. Anyway, each P(x) is valid up to a multiplicative constant.

The beauty of the problem, I think, is in the answer NOT requiring to know the P(x).

Bravo, Don!
Reperiet qui quaesiverit
kubikulann
Joined: Jun 28, 2011
• Posts: 905
January 25th, 2014 at 7:02:57 AM permalink
A general solution
For every polynomial P(x) with integer coefficients, it is true that

P(a) - P(b) = (a-b) Q(a,b) where Q(x,y) is a polynomial with integer coefficients.

Knowing the value of P(a) - P(b), you can infer that (a-b) is a factor of it.

Using Don's notation (X=her age, M=Magician's guess, Y=Your guess)

P(M) - P(X) = 299 = 13 x 23 of which (M-X) is a factor (1, 13, 23, or 299)
P(X)- P(27) = 133 = 7 x 19 of which (X - 27) is a factor (1, 7, 19, or 133)
P(M) - P(27) = 166 = 2 * 83 of which (27 - M) is a factor (1, 2, 83, or 166)

This all put together has only two solutions, of which one respects the information that M was greater than X.

Reperiet qui quaesiverit
ThatDonGuy
Joined: Jun 22, 2011
• Posts: 4194
January 25th, 2014 at 12:07:24 PM permalink
And here's a generic solution for P(x) as a cubic:

Let P(x) = ax3 + bx2 + cx + d

P(29) = 24389a + 841b + 29c + d = 299
P(28) = 21952a + 784b + 28c + d = 0
P(27) = 19683a + 729b + 27c + d = 133

P(29) - P(28) = 2437a + 57b + c = 299
P(28) - P(27) = 2269a + 55b + c = -133
(P(29) - P(28)) - (P(28) - P(27)) = 168a + 2b = 432

For any value a:
b = 216 - 84a
c = 299 - 2437a - 57 * (216 - 84a)
= 299 - 2437a - 12312 + 4788a
= 2351a - 12013
d = -21952a - 784b - 28c
= -21952a - 784 * (216 - 84a) - 28 * (2351a - 12013)
= a * (-21952 + 784 * 84 - 28 * 2351) + (-784 * 216 + 28 * 12013)
= -21924 a + 167020

P(x) = ax3 + (216 - 84a) x2 + (2351a - 12013) x + (167020 - 21924a)
If a is an integer, then so are the other three coefficients

paisiello
Joined: Oct 30, 2011
• Posts: 546
January 25th, 2014 at 12:27:35 PM permalink
Did we ever find out old she was?
beachbumbabs
Joined: May 21, 2013