Jump to content
BrainDen.com - Brain Teasers
  • 0


unreality
 Share

Question

We all know the absolute value function of x: abs(x) or more commonly |x|

|25| = 25

|-25| = 25

It takes the positive part of the number, or more formally, the distance from zero (thus right-trangle trig is used to find the absolute value of complex numbers).

But how can you do it, using only the basic functions? Addition, subtraction, multiplication, division, exponentation/rooting, logarithms and the two extraction functions:

real(a + bi) = a

imag(a + bi) = b [not bi, just b]

Note that the plus/minus value of an even square root is unknowable! (ie, √25 could be 5 or -5) We'll say that in the beginning, a random decision is made of whether all square roots are going to be positive or negative, and they all will hold to this rule, but you have NO way of knowing which it is

So, can it be done?

If so, how?

If not, PROVE that it is impossible!

Good luck :D

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

If the basic functions include exponents and roots, then we can get part of the way there fairly easily - just follow the general rule for calculating the absolute value of a complex number. So, |a+bi|=√(a2 + b2), which holds for real numbers because b=0. The real question you're asking is how to force √n to be |n| and not -|n|. If we can figure that out, the rest is easy.

The best way I can figure to do that is to take the cube root and then square it, so |a+bi|=[3√(a2 + b2)]2, which is always a positive number.

Is that what you were going for?

Edited by HoustonHokie
Link to comment
Share on other sites

  • 0

well here you've hit a roadblock

the 2/3 power of 'x' will be even (as 2/3 is cube root [same sign] squared [even]). However to turn that into x, you'd need to raise it to the 3/2 power, which requires an even root to work

disclaimer: your input can be assumed to be a real number

There is a solution :D My solution only works when real numbers (positive & negative, no 'i' part) are inputted, but that's what I was assuming in the beginning, so it fits :P I'm pretty sure that a solution for imaginary numbers too is impossible, not sure though

Edited by unreality
Link to comment
Share on other sites

  • 0

abs(x) = (abs(√x))2 = (real(√x))2 + (imag(√x))2

This involves square root operations but since you've stated that these would involve a random decision positive or negative, that works for our purposes, since the squaring operations that follow would give the same positive answer regardless. That would also work regardless of whether x was real or complex.

Link to comment
Share on other sites

  • 0

Nice! I'm pretty sure that works. Good job :D

This is my solution:

|x| = (real(√x) + imag(√x)*i) * (real(√x) - imag(√x)*i)

Which is like multiplying the square root against its conjugate

|25| = (±5 + 0i)*(±5 - 0i) = 25

|-25| = (0 ± 5i)*(0 -+ 5i) = -25*i2 = 25

The first term of the |-25| solution is plus-minus while the second is minus-plus, as it will be the opposite sign of the other one (because the square roots are unknown but constant), and you add the imag(√x)*i in the first term but subtract it in the second. Thus this works for all real numbers :D

edit: it might actually work with imaginary numbers too, one sec

edit2: yep, I just checked, it works with 25i :D

Edited by unreality
Link to comment
Share on other sites

  • 0
Nice! I'm pretty sure that works. Good job :D

This is my solution:

|x| = (real(√x) + imag(√x)*i) * (real(√x) - imag(√x)*i)

Which is like multiplying the square root against its conjugate

|25| = (±5 + 0i)*(±5 - 0i) = 25

|-25| = (0 ± 5i)*(0 -+ 5i) = -25*i2 = 25

The first term of the |-25| solution is plus-minus while the second is minus-plus, as it will be the opposite sign of the other one (because the square roots are unknown but constant), and you add the imag(√x)*i in the first term but subtract it in the second. Thus this works for all real numbers :D

edit: it might actually work with imaginary numbers too, one sec

edit2: yep, I just checked, it works with 25i :D

...that was the same answer?

(real(√x) + imag(√x)*i) * (real(√x) - imag(√x)*i) =

(real(√x))2 - (imag(√x))2*i2 =

(real(√x))2 + (imag(√x))2

ta-da! :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...