Medium number

Ryan$

Full Member
Joined
Jan 25, 2019
Messages
353
Hi guys!
I have three variables X Y Z and I HAVE MIN(two argument) and MAX(two argument) how can I find the medium number of those three variables? the medium number is smaller than max of X Y Z , and bigger than min of X Y Z ..
for finding it I've read on internet and they said we can find it by doing this math equation .. but I didn't get the concept behind it .. any help? really it complex for me to understand it and would be much appreciated to give me analogy that this math equation stand behind ..
equation for finding the medium : Max( min(Z,max(X,Y)), min(Y, max(Z,X)))

thanks alot
 
Hi guys!
I have three variables X Y Z and I HAVE MIN(two argument) and MAX(two argument) how can I find the medium number of those three variables? the medium number is smaller than max of X Y Z , and bigger than min of X Y Z ..
for finding it I've read on internet and they said we can find it by doing this math equation .. but I didn't get the concept behind it .. any help? really it complex for me to understand it and would be much appreciated to give me analogy that this math equation stand behind ..
equation for finding the medium : Max( min(Z,max(X,Y)), min(Y, max(Z,X)))

thanks alot
Just play with several sets of numbers. For example:

Max( min(Z,max(X,Y)), min(Y, max(Z,X)))

choose X = 1, Y = 2 & Z = 3

Max( min(Z,max(X,Y)), min(Y, max(3,1)))

Max( min(Z,max(X,Y)), min(Y, 3))

Max( min(Z,max(X,Y)), min(2, 3))

Max( min(Z,max(X,Y)), 2)

Max( min(Z,max(1,2)), 2)

Max( min(Z,2), 2)

Max( min(3,2), 2)

Max( 2, 2)

2 .................................Got it???
 
why it works? not getting it yet .. and there's no play in order to figure out how equation works .. there's logic ..
 
What Subhotosh means is to try various sets of numbers so that you can get an intuition of why it works. And the analogies that you requested are not logic. Of course in this case, you have not even given the rule correctly, which is:

the median of a set of three distinct numbers is less than the maximum of the maxima and more than the minimum of the minima.

[MATH]x < y < z \implies[/MATH]
[MATH]\text {max}(x,\ y) = y, \text { max}(x,\ z) = z, \text { and max}(y,\ z) = z.[/MATH]
[MATH]\therefore \text {max}(y,\ z) = z \implies \text {the median } < z \implies \text {the median is not } z.[/MATH]
[MATH]\text {Also, } x < y < z \implies[/MATH]
[MATH]\text {min}(x,\ y) = x, \text { min}(x,\ z) = x, \text { and min}(y,\ z) = y.[/MATH]
[MATH]\therefore \text {min}(x,\ y) = x \implies \text {the median } > x \implies \text {the median is not } x.[/MATH]
[MATH]\text {By definition, the median is } x,\ y, \text { or } z.[/MATH]
[MATH]\therefore \text {the median is } y.[/MATH]
The rule is considerably more complex if the three numbers are not necessarily distinct.
 
So you mean this rule that I gave is wrong ? that rule : Max( min(Z,max(X,Y)), min(Y, max(Z,X)))
 
it's not exactly straight forward from internet .. I concluded it by just using min and max functions
 
So you mean this rule that I gave is wrong ? that rule : Max( min(Z,max(X,Y)), min(Y, max(Z,X)))
Ryan

Sorry I was looking at the rule in your first paragraph. With numbers that are not necessarily distinct, the rule above does work, but that is far more complex to prove than the one you gave in the first paragraph.

[MATH]\text {max} ( \ \ \text {min} \{ z, \text { max} (y,\ z) \},\ \ \text {min} \{ y, \text { max} (x,\ z) \} ) = \text {median}(x,\ y, z).[/MATH]
[MATH]\text {CASE I: } x = y = z.[/MATH]
[MATH]\text {max} ( \ \ \text {min} \{ z, \text { max} (y,\ z) \},\ \ \text {min} \{ y, \text { max} (x,\ z) \} ) =[/MATH]
[MATH]\text {max} ( \ \ \text {min} \{z,\ y \},\ \ \text {min} \{ y,\ x,\}\ \ ) = \text {max}(z,\ x) = x = y = z.[/MATH]
I shall let you do the other cases.
 
I took three examples and it works, for example 1 2 3 , 8 9 10
why it works? …
Hello Ryan$. You won't find deeper meaning after working only three examples. Also, your examples show only the case x<y<z. If you're actually serious, then you ought to be playing around with many examples from each of the possible cases.

\(\;\)
 
Top