Looking for something else?

Not the answer you are looking for? Search for more explanations.

## More answers

Looking for something else?

Not the answer you are looking for? Search for more explanations.

- anonymous

Define a function f(x) such that f(f(x)) = -x

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your **free** account and access **expert** answers to this

and **thousands** of other questions.

Get your **free** account and access **expert** answers to this and **thousands** of other questions

- anonymous

Define a function f(x) such that f(f(x)) = -x

- schrodinger

See more answers at brainly.com

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your **free** account and access **expert** answers to this

and **thousands** of other questions

- anonymous

\[f(x)=-|x|\]

- anonymous

\[f(f(x)) = -|-|x||\]\[f(f(-1)) \neq 1 \]

- anonymous

@Anwar
f(f(x)) = -(-x) = x :-P

Looking for something else?

Not the answer you are looking for? Search for more explanations.

- anonymous

:/

- anonymous

This can be done in a few lines in Python.
Python 1, Math 0 :-D

- anonymous

why not C?

- anonymous

It might be possible in C..... let me think

- anonymous

maybe easier in C++

- anonymous

because Python (at least the default one) is C's baby, and if Python can do it, then C can :-D

- anonymous

in python you can't even i++ :D

- JamesJ

What's the definition of the function? Don't give us Python code; the code is just the encapsulation of that definition. What is the definition itself in ordinary mathematical notation?

- anonymous

I was hoping someone could figure it out for me :( I think it has to do with complex numbers.
f(x) = x*i

- JamesJ

oh, so it's not a real valued function? Then it's trivial.

- anonymous

right

- anonymous

but the question said we can't use complex numbers :(

- JamesJ

In which case, it's not trivial. Do you know the answer? I don't. I'd like you to tell me.

- anonymous

I don't know either, but it's one line in Python

- anonymous

f = lambda x: (lambda: -x) if (not hasattr(x, '__call__')) else x()

- JamesJ

decode the line for us and tell us then. You're the Python expert.

- JamesJ

I can't read that.

- anonymous

it just says f is a function that returns a function that returns the additive inverse of a number if the argument is not a function and calls its input otherwise.

- JamesJ

Oh, so it's not a regular mathematical function at all.

- anonymous

is it possible to make it a regular math function?

- JamesJ

i don't think so, but i'll think about it a little.

Looking for something else?

Not the answer you are looking for? Search for more explanations.