MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Corresponding function to given values...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg35989] Re: [mg35966] Corresponding function to given values...
  • From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
  • Date: Sun, 11 Aug 2002 05:13:49 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On Saturday, August 10, 2002, at 05:05  AM, Sven Richter wrote:

> Is there a possibility that Mathematica gives me a function to given
> pairs of values?
> In other words: I have several pairs like {1, 2}, {2, 4}, {3, 9}. And I
> what like to know the corresponding function (what is in this example
> obviously f[x]=x^2).
>
> TIA
> Sven
>
>
>
>
>
>
Is that really obvious? How about:

In[7]:=
Rationalize[Fit[{{1, 2}, {2, 4}, {3, 9}}, {x, x^2, x^3},
    {x}]]

Out[7]=
3*x - (3*x^2)/2 + x^3/2

In[8]:=
% /. {{x -> 1}, {x -> 2}, {x -> 3}}

Out[8]=
{2, 4, 9}



Andrzej Kozlowski
Toyama International University
JAPAN
http://platon.c.u-tokyo.ac.jp/andrzej/



  • Prev by Date: Re: Corresponding function to given values...
  • Next by Date: Re: Question on Mod[]
  • Previous by thread: Re: Corresponding function to given values...
  • Next by thread: Re: Corresponding function to given values...