Solving a max() Function with Binary Operators

Click For Summary

Discussion Overview

The discussion revolves around expressing the max() function using standard binary operators in a mathematical function. Participants explore ways to eliminate the max() function from the expression f(x,y,z)=max(0, (x-y))/z, focusing on algebraic representations without conditional statements or absolute values.

Discussion Character

  • Exploratory
  • Mathematical reasoning

Main Points Raised

  • One participant suggests using a piecewise function to express f(x,y,z) without the max() function, noting that z cannot be zero.
  • Another participant clarifies that they seek an algebraic expression without using conditional statements like "if" or "else."
  • A different approach is proposed using the expression (|x-y| + (x-y)) / (2z) to avoid the max() function.
  • There is a suggestion to express the absolute value using the square root of the squared difference, although this is noted as potentially excessive.

Areas of Agreement / Disagreement

Participants do not reach a consensus on a single algebraic expression that meets all criteria, and multiple approaches are discussed without resolution.

Contextual Notes

Participants express limitations in their approaches, particularly regarding the use of conditional statements and absolute values, indicating a desire for a purely algebraic form.

Barking_Mad
Messages
11
Reaction score
0
Hey i was wondering if someone could help me express this using standard binary operators.

[tex]f(x,y,z)=\frac{max(0, (x-y) )}{z}[/tex]

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)

[tex] f: \mathbb{R} \times \mathbb{R} \times \mathbb{R} \backslash \{0\} \to \mathbb{R}[/tex]
[tex] <br /> f(x,y,z) = \left\{<br /> \begin{array} {l l}<br /> \displaystyle{\frac{x-y}{z}} & \text{if} \ x > y \\<br /> 0 & \text{else}<br /> \right.[/tex]
 
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

[tex]\frac{|x-y|+(x-y)}{2z}[/tex]
 
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 [tex]\sqrt {(x - y)^2}[/tex] (I smell a computer nearby), but it looks like on overshoot to me.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
21K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 4 ·
Replies
4
Views
3K