Jump to content
BrainDen.com - Brain Teasers
  • 0


Guest
 Share

Question

There are two functions f(x) and g(x,y), that work in the real domain.

f(x) returns the absolute value of its input. ( e.x. f(-1) = 1 ).

g(x,y) returns numerically bigger of the two input numbers ( e.x. g(1, −2) = 1 ).

1. f(x) in terms of g(x,y)

2. g(x,y) in terms of f(x)

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0
There are two functions f(x) and g(x,y), that work in the real domain.

f(x) returns the absolute value of its input. ( e.x. f(-1) = 1 ).

g(x,y) returns numerically bigger of the two input numbers ( e.x. g(1, −2) = 1 ).

1. f(x) in terms of g(x,y)

2. g(x,y) in terms of f(x)

f(x) = g(x, -x)

G(x, y) = y + f(x) + f(y)

Link to comment
Share on other sites

  • 0
Be sure it works when both x and y are negative.

g(x,y)=x*[f(x-y)+(x-y)]/[2*(x-y)]+y*[f(y-x)+(y-x)]/[2*(y-x)]

If you go through the math, you will find that your solution simlifies exactly to my solution above. :)

EDIT: Ah, you beat me to it! :)

Edited by mghoffman78
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...