9,73,241,561,1081,1849,_?_
algebra.com
algebra.com
Does anyone know if the natural language parsing is showing improvement, or does it still choke on most inputs?
9 | | 73 | | 241 | | 561 | | 1081 | | 1849
| 64 | | 168 | | 320 | | 520 | | 768 |
| | 104 | | 152 | | 200 | | 248 | |
| | | 48 | | 48 | | 48 | | |This answer is correct in that it is the next item in the lowest-order polynomial that generates the first five terms. This reveals both the strength and weakness of difference tables (and the flavor of Mathematics Made Difficult).
http://threesixty360.wordpress.com/2008/04/30/1-2-4-8-what-c...
1 2 4 8 16 31
1 2 4 8 15
1 2 4 7
1 2 3
1 1
0(before clicking the link, I was expecting "find the remaining digits to make this number a prime" or something)
Nice link though!
48 -> 48x -> 24x^2 -> 8x^3
Subtract 8x^3 from the series 9 - 8•1^3, 73 - 8•2^3, 241 - 8•3^3
and repeat the whole process on this series for the coefficient of x^2, etc...Approximately, what the difference table is doing is differentiating until the leading term is constant. If we end up with a constant k levels down, we must have had a.x^k in the polynomial, as the derivative of a.x^k = ak.x^(k-1). Repeating this k times gives constant = a.k!
So the leading coefficient of the polynomial, a = constant/k!
I guess the next step is to subtract the values generated by this term from the sequence, then repeat to find the next term in the polynomial...
Give your DT "coefficients" work your way back to the solution.
I.e. in this case: you start with
48
48
48
From which you can get
104 <-- Note: this needs to be given!
152
200
248
And work your way back to
9
73
241
561
1081
1849
So you know you want a polynomial P(x)such that P(1) = 9
p(2) = 73
...
p(3) = 1849
So now you know you need at most a 5th degree polynomial.
So, you have y = a_0 + a_1 * x + a_2 * x^2 + ... + a_5 * x^5
Plug in each value of x and you get 6 equations with 6 unknowns. Solve for a_0, ..., a_5.
Bunch of the a's might well be 0, but thats ok.
Edit: This only works if your difference table eventually reduces to a set of differences which are all the same (e.g here 48, 48, 48). Otherwise, the answer is not a polynomial.
Doing it that way will prepare you to teach yourself the material, giving you the confidence you claim you don't yet have.
To elaborate: You can define "simplest program", for instance, as "shortest string consisting of [0-9], plus, minus, times, parentheses, and the symbol 'n' that when evaluated as a mathematical expression yields the given sequence for n=1, 2, 3...". You can then find a suitable string, like "((8 * n + 4) * n - 4) * n + 1", and do an exhaustive search of shorter strings to show that no better string exists. That would be 16^16, or less than a year on a computer that can knock off a trillion strings per second -- less if you use logic to constrain the search space.
However, realistically, a person asking such a question is merely looking for a "good" solution, not necessarily a proven-optimal one, as there may be multiple reasonable explanations for a given sequence. Rather, the value of the "simplest program" criteria is that it allows you to compare proposed solutions. So, yes, for any given number, there is a formula to make it next in the sequence. But by applying the "simplest program" criteria, we see that some formulas -- and hence some values -- are better than others.
E.g. see http://en.wikipedia.org/wiki/Primitive_recursive_function
python -c 'print 9,73,241,561,1081,1849
# or better yet
echo 9,73,241,561,1081,1849So 0 is the answer. Actually, any digit, so I don't waste one extra character in my program.
Did I win?
+/1 ¯4 4 8×[2](⍳9)∘.*¯1+⍳4
And outputs: 9 73 241 561 1081 1849 2913 4321 6121It's defined just well enough to identify you as someone who'd rather debate the problem than attack it. In other words, it has done its job.
What if that question was meant to find people who think about what is the real goal and asking "are we thinking about the same thing, or should we agree on more details" instead of attacking the problem at hand. Otherwise "0" is a perfectly good answer (for any reason).
This discussion has as much sense as a typical IQ test... (~nil)
But even then you would be faced with the difficult task of proving that your answer is correct.
This kind of ill-defined question might be a fun diversion but it should never be used for any serious purpose (e.g. in any test/assighnment that matters)
Note, that I said "reasonable people." Reasonable people know what is being asked. If, for example, I asked someone how much they weigh, they are not going to respond "I don't know. I weighed myself five minutes ago, but I must have a different weight right now."
Do you allow Turing-completeness? If not, why not?
What exactly is the measure used to determine the size of a solution?
Again, reasonable people. If we had to precisely define every question and interaction, we would never get anything done. Instead we rely on shared assumptions and clarify only when actual confusion occurs. (Yours is not an actual confusion.)
Moreover, even if we agree to use a certain form of closed expression, you will still need to define how we measure the size of such an expression and you will need to find a way to prove that an answer has the smallest possible expression size.
I also said nothing about "smallest possible expression size."
I've been using "difference tables" (without calling it that) since I was 10 years old. I don't mean this to be bragging at all, because I didn't think (and still don't think) it was at all remarkable. It's just a basic method of analysis.
This is a great resource for finding information on integer sequences significant in combinatorics and other formal math topics. It didn't have the solution to this particular sequence, because, afaik there is nothing particularly interesting about it.
http://www.wolframalpha.com/input/?i=0%2C1%2C2%2C4%2C8%2C16%...
1,2,4,8 works fine. http://www.wolframalpha.com/input/?i=1%2C2%2C4%2C8%2C16%2C32...
...1081,1849,[1890.067],[2248.467].... Now I just wonder how excel got these answers :/
Wikipedia article on the difference engine: http://en.wikipedia.org/wiki/Difference_engine
Just for fun, a difference engine built with Legos: http://acarol.woz.org/
2^3+1^2; 4^3+3^2; 6^3+5^2; 8^3+7^2; 10^3+9^2; 12^3+11^2; ?
Soln: 14^3+13^2 = 2913
Basically you can't just integrate each DE and solve for a constant C by finding the value of the lower order DE where x=1 and finding the difference. Why not?
I'm in Calc BC in high school so this could be a stupid question.
I was using differential equations to find the equation that describes the sequence and I was wondering why the constant that you get when you integrate a function isn't actually a constant after the second integration.