[algogeeks] Re: Identify The f(x) :you are given a series of numbers(asked by MICROSOFT )?

2009-11-05 Thread Pawandeep
thanks to all of u ... i think curve fitting fits here ... thanks.. On Oct 31, 10:39 am, nikhil garg wrote: > This is a very common problem actually. And is most often solved using curve > fitting only. We choose the curve to be polynomial of minimum degree and > then use some interpolation me

Re: [algogeeks] Re: Identify The f(x) :you are given a series of numbers(asked by MICROSOFT )?

2009-10-31 Thread nikhil garg
This is a very common problem actually. And is most often solved using curve fitting only. We choose the curve to be polynomial of minimum degree and then use some interpolation method to get the exact polynomial. You may like to see the same problem at spoj: https://www.spoj.pl/problems/CMPLS/

[algogeeks] Re: Identify The f(x) :you are given a series of numbers(asked by MICROSOFT )?

2009-10-30 Thread Dave
Kamal, wouldn't Microsoft want you to exhibit thinking outside the box on an interview question like this? If so, suggesting something like polynomial regression would be ho-hum. Furthermore, considering Occam's Razor, it would totally miss geometric sequences, the Fibonacci sequence, prime number

[algogeeks] Re: Identify The f(x) :you are given a series of numbers(asked by MICROSOFT )?

2009-10-30 Thread Kamal
In simple terms, if you are going to use only polynomial functions as f (x), this a polynomial curve fitting problem. Here, the input points are (1,2) (2,4) (3,6) and so on... There are many approaches to solve this. You can even consider other functions to model the series according to the need.

[algogeeks] Re: Identify The f(x) :you are given a series of numbers(asked by MICROSOFT )?

2009-10-30 Thread Dave
I would use a language, such as Perl, with which I could easily link to the web page for the Online Encyclopedia of Integer Sequences, using the URL http://www.research.att.com/~njas/sequences/index.html?q=2,4,6,8,10,12&language=english&go=Search (note that the sequence is imbeded in the URL) and

[algogeeks] Re: Identify The f(x) :you are given a series of numbers(asked by MICROSOFT )?

2009-10-30 Thread daizi sheng
first n number can not define the full function and so you need to guess. I think you just need a simple enough f(x) to represent the full list, e.g. a closed formula, but you have to define *simple* firstly. I guess Knuth's Concrete Mathematics should help you for more insight. On Thu, Oct 29,

[algogeeks] Re: Identify The f(x) :you are given a series of numbers(asked by MICROSOFT )?

2009-10-30 Thread umesh kewat
Identify the F(n) required some AI for 1st identify type of sequence whether it is GP, AP, HP or some other special sequence then right the function according the series. On Fri, Oct 30, 2009 at 10:02 AM, Shiqing Shen wrote: > > match the sequence exactly? > how to get that polynomial func

[algogeeks] Re: Identify The f(x) :you are given a series of numbers(asked by MICROSOFT )?

2009-10-30 Thread nikhil garg
Check google for Newton's interpolation method. That should help. cheers - nikhil On Fri, Oct 30, 2009 at 10:02 AM, Shiqing Shen wrote: > > match the sequence exactly? > how to get that polynomial function, i am curious > > 2009/10/29, Vladimir Reshetnikov : > > Any finite sequence of numbers

[algogeeks] Re: Identify The f(x) :you are given a series of numbers(asked by MICROSOFT )?

2009-10-30 Thread Vladimir Reshetnikov
http://en.wikipedia.org/wiki/Lagrange_polynomial On Fri, Oct 30, 2009 at 7:32 AM, Shiqing Shen wrote: > > match the sequence exactly? > how to get that polynomial function, i am curious > > 2009/10/29, Vladimir Reshetnikov : > > Any finite sequence of numbers can be matched by polynomial functio

[algogeeks] Re: Identify The f(x) :you are given a series of numbers(asked by MICROSOFT )?

2009-10-30 Thread Shiqing Shen
match the sequence exactly? how to get that polynomial function, i am curious 2009/10/29, Vladimir Reshetnikov : > Any finite sequence of numbers can be matched by polynomial function. > > > On Thu, Oct 29, 2009 at 3:19 PM, Pawandeep > wrote: > > > > hello everyone , > > you are given a series o

[algogeeks] Re: Identify The f(x) :you are given a series of numbers(asked by MICROSOFT )?

2009-10-29 Thread Vladimir Reshetnikov
Any finite sequence of numbers can be matched by polynomial function. On Thu, Oct 29, 2009 at 3:19 PM, Pawandeep wrote: > > hello everyone , > you are given a series of numbers like > > 2,4,6,8,10,12this is simple though > > nd u hve to identify that f(x) = x+ 2 for this series .. >