Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » sci.math.* » sci.math

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
quasi

Posts: 10,398
Registered: 7/15/05
Re: Help with creating a function
Posted: Nov 19, 2013 3:48 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

quasi wrote:
>quasi wrote:
>>quasi wrote:
>>>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.

>>
>>Here's a simple one based on the floor function.
>>
>> f(x) = x + floor(1/(x+1))

>
>This one uses factorials.
>
> f(x) = x + (1/2)*(1 - (-1)^(x+1)!)


Here's a minor variation of the above factorial version using
only arithmetic operations (including exponentiation).

f(x) = x + (1/2)*(1 - (-1)^(2^x))

quasi



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.