You are not logged in.
Pages: 1
Hi, I've came across these functions and they seam pretty self explanatory, so I feel a little stupid asking this question, but I want to make sure I understand them right.
Does:
and:
Is that all it is?
Offline
Yes, thats correct.
You might find these formulas interesting (possibly even useful):
Offline
Thanks, those formulas are indeed useful, since it's cleared the ambiguity I had with min{} and max{} in the text I'm reading. Cheers
Offline
Thanks, those formulas are indeed useful, since it's cleared the ambiguity I had with min{} and max{} in the text I'm reading. Cheers
That makes me worry a little because there shouldn't be any ambiguity, even if you don't see them defined by formulas. It is just a function that chooses the largest or smallest out of the set (in this case, set of two) of numbers. Where is the ambiguity?
"In the real world, this would be a problem. But in mathematics, we can just define a place where this problem doesn't exist. So we'll go ahead and do that now..."
Offline
Onyx wrote:Thanks, those formulas are indeed useful, since it's cleared the ambiguity I had with min{} and max{} in the text I'm reading. Cheers
That makes me worry a little because there shouldn't be any ambiguity, even if you don't see them defined by formulas. It is just a function that chooses the largest or smallest out of the set (in this case, set of two) of numbers. Where is the ambiguity?
The ambiguity was in the fact that although max{} and min{} are self explanatory, the text I was reading kept referencing them to to the formulas Jane provided without explicity stating the equalities, and after finding nothing online I wanted to make sure I wasn't missing something important. You know what they say about asumption being the mother of all **** ups
Offline
You didnt miss anything important. The formulas may not look intuitive, but they are equivalent to the intuitive definitions of max/min. They have their uses too. They would be useful in, for example, part of a computer program where you need to extract the max/min of two numbers. Instead of branching off into if-then-else subroutines, you can easily plug in those formulas directly into the equations you are using in your program.
Moreover, the formulas can be extended to more than two numbers.
which saves you even more trouble with if-then-else.
Offline
They would be useful in, for example, part of a computer program where you need to extract the max/min of two numbers. Instead of branching off into if-then-else subroutines, you can easily plug in those formulas directly into the equations you are using in your program.
which saves you even more trouble with if-then-else.
I would argue against that since in most languages you would be able to do something such as:
c = a<b ? a : b;
or
d = a<b&&a<c ? a : b<c ? b : c;
instead of if/else, if/elseif/else
of which both using the conditional operator, and normal branching will be alot faster in terms of execution than using the formula:
The only time that i can see these formula being of use in a programming application is in GPU programming on slightly older architectures where either branching is not supported, or branching is very slow and using the formula could execute faster.
The Beginning Of All Things To End.
The End Of All Things To Come.
Offline
Thanks, at least I'm aware of them now for the future.
btw theres an easy algorithm for finding the maximum or minimum of a set of numbers (array) e.g. the minimum:
Declare variable.
initialize variable as first element of array.
Loop through array element by element {
if (current array element is less than variable) {
set variable equal to current element.
}
}
return variable
Offline
Pages: 1