Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

abs() function without roots?

Name: Anonymous 2006-11-11 17:33

Can you define an absolute value abs(x) function as an algebraic expresion without the use of roots (or fractional exponents)?  For instance, can you come up with another function other than abs(x)=(sqrt(x))^2?

Name: Anonymous 2006-11-11 18:18

oops fuck I mean other than abs(x)=sqrt(x^2) (accepts negative x, only want real numbers)

Name: Anonymous 2006-11-11 18:30

If x<0 then -1*x else x.

Name: Anonymous 2006-11-11 18:40

>>1
If by "algebraic expression without the use of roots (or fractional exponents)" you mean "polynomial," the answer is no, since |x| isn't differentiable at 0 and polynomials are necessarily differentiable everywhere.

Name: Anonymous 2006-11-11 22:08

OK, thanks.

Name: Anonymous 2006-11-12 0:17

>>3
is correct.

Name: Anonymous 2006-11-12 7:52 (sage)

>>6
algebriac expression

Name: Anonymous 2006-11-13 0:08

>>7

Piecewise functions are algebraic, dumbass. or did you miss that part of Algebra II? Or how about Algebraic Structures? Did you miss it there, too?

Name: Anonymous 2006-11-13 0:15

Name: Anonymous 2006-11-13 19:52

>>9
Dumbass, your link proves that piecewise functions can be algebraic if their pieces are algebraic and continuous over their domain, and the pieces are in said piecewise function.

Name: Anonymous 2006-11-13 21:22

"An algebraic expression in variables {x_1,...,x_n} is an expression constructed with the variables and algebraic numbers using addition, multiplication, and rational powers."

Really? Show how f(x) = {0 if x>0, 1 if x <=0) meets that definition.

Name: Anonymous 2006-11-14 12:54

sqrt(x^2)
force it to be one valued or something

Name: Anonymous 2006-11-14 14:27

pseudocode:
$number
$numberstring = string($number)
if first character $numberstring = "-"
  $numberstring = $numberstring from 2nd character on
end


no square roots lolz

Name: Anonymous 2006-11-16 3:00

abs = (lambda x: max(x, 0-x))

int abs(int x) { return ((x < 0) ? (0 - x) : x); }

Don't change these.
Name: Email:
Entire Thread Thread List