Solving a max() Function with Binary Operators

AI Thread Summary
The discussion focuses on expressing the function f(x,y,z) = max(0, (x-y))/z using standard binary operators without relying on the max() function. Participants clarify that max(a,b) selects the larger of two values and suggest an initial valid expression. The user seeks an algebraic representation without conditional statements or absolute values, leading to a proposed expression involving absolute values. Further suggestions include using square roots to eliminate the absolute function, but concerns about complexity arise. The conversation highlights the challenge of reformulating the function while adhering to the specified constraints.
Barking_Mad
Messages
11
Reaction score
0
Hey i was wondering if someone could help me express this using standard binary operators.

f(x,y,z)=\frac{max(0, (x-y) )}{z}

i.e. Eliminate the max() function and write it using proper math.

EDIT: max(a,b) simply chooses the largest value of the two variables.
 
Mathematics news on Phys.org
What you have there already is valid, but you can use this one if you like it better

Also, note that z cannot be 0 (the first line is just declaring the domain and codomain of f)

<br /> f: \mathbb{R} \times \mathbb{R} \times \mathbb{R} \backslash \{0\} \to \mathbb{R}
<br /> <br /> f(x,y,z) = \left\{<br /> \begin{array} {l l}<br /> \displaystyle{\frac{x-y}{z}} &amp; \text{if} \ x &gt; y \\<br /> 0 &amp; \text{else}<br /> \right.<br />
 
hmm yeah, that's not exactly what i was looking for, apologies for lack of clarity.

Im looking for an algebraic expresion of that function, as a fraction or something similar, without the need to use if or else. If that is possible, maybe it isnt.
 
How about

\frac{|x-y|+(x-y)}{2z}
 
ok, now i need to express that without the absolute function, or using polar or complex numbers. Could take me all week...
 
For the absolute value you could use \sqrt {(x - y)^2} (I smell a computer nearby), but it looks like on overshoot to me.
 
Seemingly by some mathematical coincidence, a hexagon of sides 2,2,7,7, 11, and 11 can be inscribed in a circle of radius 7. The other day I saw a math problem on line, which they said came from a Polish Olympiad, where you compute the length x of the 3rd side which is the same as the radius, so that the sides of length 2,x, and 11 are inscribed on the arc of a semi-circle. The law of cosines applied twice gives the answer for x of exactly 7, but the arithmetic is so complex that the...
Back
Top