To add comments or start new threads please go to the full version of: Inverse Question
PhysOrgForum Science, Physics and Technology Discussion Forums > General Sci-Tech Discussions > Homework Help

IntoTheVoid
Does anyone know how to find the inverse of f(x) = (1+((-1)^x)(2x-1))/4?
Thanks
PJParent001
Yes.
IntoTheVoid
Well would you mind sharing your knowledge?
mr_homm
This function does not have an inverse, because it is not single-valued. For instance, plugging in x=0 and x-1 both give the value zero.

In general, for x not an integer, the function is complex, but at the integers it is real. In the complex plane, the function can be written as z = (1+exp(pi*i*x)(2x-1))/4, since exp(pi*i)=-1. Changing variables to u = (2x-1)/4 gives z - 1/4 = exp(pi*i*(4u-1)/2) *u= exp(pi*i/2)*exp(4*pi*i*u)*u= u*i*exp(4*pi*i*u). This is a spiral of Archimedes, since the factor exp(r*pi*i*u) rotates around the unit circle as u grows (it makes one complete rotation when u increases by 1), and the u factor shows that the path grows outward from the center as it turns, so it is a spiral, not a circle. The factor i shows that it starts on the imaginary axis. The center of the spiral is at 1/4 on the real axis. As the spiral wraps around and around, it cuts the real axis at many points, which have an interesting pattern:

CODE

x:
... -6   -5   -4   -3   -2   -1    0    1    2    3    4    5    6    7 ...

f(x):
... -3    3   -2    2   -1    1    0    0    1   -1    2   -1    3   -3 ...


But that doesn't help you invert the function, only to visualize it.

Hope that helps!

--Stuart Anderson
PJParent001
QUOTE (IntoTheVoid+Nov 28 2007, 02:30 PM)
Does anyone know how to find the inverse of f(x) = (1+((-1)^x)(2x-1))/4?
Thanks


Um... 1 divided by f(x)? Is that right? biggrin.gif

Oh wait a minute! laugh.gif

Do you seriously need a function that returns x given f(x)? blink.gif

At first glance, it looks a bit one-way'ish... Have you tried using interpolation?
PJParent001
f(x) = (1+ ((-1)^x)(2x-1)) / 4

A quick look at the output of f(x) shows we have somewhat of a mirror image occuring around 0.5 on the x axis, say for integers -10 < x < 10.

Positive and negative zero? Apparently we can quikly see that working something like this backwards is problematic, ugly and inelegant, and too much work if you ask me.

To start, consider postive integers: x >= 1

y = f(x)

since the absolute value of (4y - 1) = 2x - 1

we get: x = (abs(4y - 1) + 1) / 2)

When considering all integers for x, since f(x) produces an identical value for plus x and minus x, we need to accept the fact that working it backwards will provide 2 solutions. So to figure out the 'other' possible value, we calculate the complement of x.

mr_homm
This follows on from what PJParent001 said in the previous post:

For the positive integers only, there's a nice inverse:

It is clear from the list I gave in an earlier post that if y = f(x), then for EVEN y, x =2y, and for odd y, x=2|y|+1. You can put these together into a single formula: x = 1/2 + 2|y - 1/4|. This gives the positive integer x corresponding to any y. There is also a negative integer which is 1-x.

Therefore the two solutions are 1/2 + 2|y - 1/4| and 1 - (1/2 + 2|y - 1/4|) = 1/2 - 2|y - 1/4|. Putting these together gives

x = 1/2 + 2|y-1/4|

which works for all integer values of y and gives both the positive and negative x values.
PJParent001
QUOTE (mr_homm+Nov 29 2007, 08:01 AM)
This follows on from what PJParent001 said in the previous post:

For the positive integers only, there's a nice inverse:

It is clear from the list I gave in an earlier post that if y = f(x), then for EVEN y, x =2y, and for odd y, x=2|y|+1.  You can put these together into a single formula:  x = 1/2 + 2|y - 1/4|.  This gives the positive integer x corresponding to any y.  There is also a negative integer which is 1-x. 

Therefore the two solutions are 1/2 + 2|y - 1/4| and 1 - (1/2 + 2|y - 1/4|) = 1/2 - 2|y - 1/4|.  Putting these together gives

x = 1/2 + 2|y-1/4|

which works for all integer values of y and gives both the positive and negative x values.


Wow thanks, I''ll take a closer look at that.
PJParent001
Hello mr homm,

I found your approaches to solving the 'very weird function' presented by IntoTheVoid, quite interesting since I always try to avoid using complex numbers simply because I hate them very much. I took another look at my own approach of reversing the function which did lead to a surprising conclusion which I will now post.

PJ Parent

PJParent001
QUOTE (IntoTheVoid+Nov 28 2007, 02:30 PM)
Does anyone know how to find the inverse of f(x) = (1+((-1)^x)(2x-1))/4?
Thanks

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

y = f(x)

given y, there are two solutions for x

solution 1:
z = (abs(4y - 1) + 1) / 2

solution 2:
w = f(-z+1)

Which surprisingly works. blink.gif

PJ Parent

PhysOrg scientific forums are totally dedicated to science, physics, and technology. Besides topical forums such as nanotechnology, quantum physics, silicon and III-V technology, applied physics, materials, space and others, you can also join our news and publications discussions. We also provide an off-topic forum category. If you need specific help on a scientific problem or have a question related to physics or technology, visit the PhysOrg Forums. Here you’ll find experts from various fields online every day.
To quit out of "lo-fi" mode and return to the regular forums, please click here.