pouët.net

Go to bottom

Math question

category: general [glöplog]
And this is how i tested that the numbers were right, for what it's worth. f(x)

BB Image
added on the 2008-12-07 16:04:30 by doomdoom doomdoom
texel: Damn you, I wanted to write such a program, too. Now the project is obsolete :)
added on the 2008-12-07 20:50:18 by Adok Adok
you're obsolete
OUT!
oh shit ! Command Cyborg, brilliant ! I didn't know you could do that for 5 numbers... It reminds me a bit of some spline code.
added on the 2008-12-07 21:47:30 by krabob krabob
BB Image
added on the 2008-12-07 22:05:23 by ATH500 ATH500
Quote:
It reminds me a bit of some spline code.
added on the 2008-12-07 23:55:28 by Hatikvah Hatikvah
and from interpolation, to approximation: fourier series and legendre polynomials, useful also for 3d camera keyframe interpolation (tadaaa)
added on the 2008-12-08 06:36:43 by iq iq
kraboob: It is spline code, basically. Most straightforward way I know to do cubic splines is to do the same for a cubic polynomial x(t)=at^3+bt^2+ct+d, differentiate to get the tangent expression x'(t)=3at^2+2bt+c, set up a system of equations for the two points x(0) and x(1) and their respective tangents x'(0) and x'(1), which gives you the equation:

Code:|x(0) | | 0 0 0 1 | |a| |x(1) | | 1 1 1 1 | |b| |x'(0)| = | 0 0 1 0 | * |c| |x'(1)| | 3 2 1 0 | |d|


Which you solve for a,b,c,d in the same way, and interpolate t=0..1 with the cubic function.
added on the 2008-12-08 11:01:47 by doomdoom doomdoom
lverona, if you're after a function for a specific sequence of numbers that your guts tell you make sense somehow, but you can't figure it out (which probably isn't the case, but it's interesting anyway), try the On-Line Encyclopedia of Integer Sequences. Fun fact: neoneye has an entry there.
added on the 2008-12-08 13:15:38 by skrebbel skrebbel
here, in fact.
added on the 2008-12-08 13:17:16 by skrebbel skrebbel
I heard somewhere it's always possible to add a number of sines together to come very close to any sequence of numbers. The more sines, the closer you can get. Kinda the way JPEG works or something. Don't know how to find the sine frequency etc. though.
added on the 2008-12-08 13:18:03 by cruzer cruzer
Yes, fourier transformation. It doesn't just bring you "very close", but arbitrarily close. JPEG uses DCT which is essentially the same thing (cosines rather than sines and cosines).
added on the 2008-12-08 13:31:31 by doomdoom doomdoom
How about Taylor series? But I have no idea how to calculate dy/dx for a function that is defined only as some x, f(x) pairs?
added on the 2008-12-08 16:20:38 by Adok Adok
Well, I've looked through formulas, wow! But again - the task is simple. There are a lot of math puzzles like that: 1,2,5,7 - what number should go next? And you have to understand what math operation or principle was used to receive that sequence.
So if I just randomly (not by a random number generator, but out of my head) write numbers, say 2,3,232,456,1007 - can there be a mathematical function or operation that satisfies it? So that one can tell the next number?
Louigi: There's an infinite number of mathematical functions and operations that satisfy any sequence of numbers. The problem is finding the TYPE of function that the author of the puzzle had in mind. If you just want to solve the puzzle in a douchey sort of way, use the polynomial approach, or anything you find that's simpler.

What you'll get, technically, is the next number in a sequence that contains the given five numbers. There's not a "the next number", because there's not a "the sequence". Any number is correct depending on which of the infinitely many possible functions you pick. If you want a PRETTY solution, you need some sort of AI that understands what a pretty solution is compared to an ugly one (see: science fiction).
added on the 2008-12-08 18:11:56 by doomdoom doomdoom
It's so fun to see the mensah people so completely lost when it comes to real problems
added on the 2008-12-08 18:26:47 by Hatikvah Hatikvah
Here is a Lagrange Polynomials Demo:
http://www.students.meduniwien.ac.at/~n0102122/miscellaneous/lagrange.zip

Input in points.txt (see example), no linebreak at the end of the file! It first displays only the points defined. To toggle interpolation, press SPACE.
added on the 2008-12-08 18:35:02 by Adok Adok
BUT ME WANTS TO PRESS ADOK ?!
added on the 2008-12-08 18:52:02 by v4nl4me v4nl4me
v4nl4me: Don't you have a girlfriend? :)
added on the 2008-12-08 19:06:30 by Adok Adok
YEAHR I HAVE MANY GIRLFRIENDS AND ALSO I HAVE ONE I LIKE MOST BUT THEY ALL CANT COMPARE WITH A GREAT MAN LIKE YOU ARE ADOKZ ! YOUR INTELLIGENZES ARE SUPER AMAZING !
added on the 2008-12-08 19:09:56 by v4nl4me v4nl4me
v4nl4me: What matters is that if you want to get intelligent children, your girlfriend must be intelligent as well. Women have two X chromosomes, men just one. The intelligence genes reside in the X chromosomes. That's why an intelligent woman passes her intelligence genes to her children.
added on the 2008-12-08 19:13:09 by Adok Adok
YEAH BUT DOES THAT MEAN THAT YOUR CHILDREN WILL BE DUMB?
added on the 2008-12-08 19:17:01 by v4nl4me v4nl4me
v4nl4me: It will depend on my wife. :)
added on the 2008-12-08 19:18:26 by Adok Adok
why do the functions need to be polynomal?

login

Go to top