Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Help with creating a function
Replies: 12   Last Post: Nov 19, 2013 3:48 AM

 Messages: [ Previous | Next ]
 Roland Franzius Posts: 586 Registered: 12/7/04
Re: Help with creating a function
Posted: Nov 18, 2013 6:54 AM

Am 18.11.2013 10:50, schrieb quasi:
> Robert Crandal wrote:
>>
>> Suppose I have the following X-Y data set:
>>
>> X Y
>> -- --
>> 0 1
>> 1 1
>> 2 2
>> 3 3
>> . .
>> . .
>> N N
>>
>> Can this be represented with a math function?
>>
>> (Only consider positive integers >= 0)

>
> It's already a function since for each x in the domain, there
> is a unique y.
>
> Presumably you want a "formula".
>
> The function f defined on the set of nonnegative integers
> by the formula
>
> f(x) = ((x-1)*(((2*x-1)/abs(2*x-1))+1)/2)+1
>
> is not pretty but it works.

Instead of making complicated gymn with abs(x) function by expressing
the sign(x) function via x/abs(x), x!=0, in most cases it easier to take
the most elementary continuous piecewise linear function with a kink,
the min/max functions

In the present case a very simple function is

y = max(1,x)

But of course, pointwise fit an analytic function will be possible too
where sinx(x/pi)/x can be used to fit values 0 at the integers !=0 and
an exceptional value of 1 at x = 0.

y = sinc(x/pi) + x

will probably do the job.

--

Roland Franzius

Date Subject Author
11/18/13 Robert Crandal
11/18/13 quasi
11/18/13 Robert Crandal
11/18/13 quasi
11/18/13 David Hartley
11/18/13 quasi
11/18/13 Roland Franzius
11/18/13 quasi
11/18/13 quasi
11/19/13 quasi
11/18/13 Richard Tobin
11/18/13 Stuart M Newberger
11/18/13 Peter Percival