14
$\begingroup$

I gone through many pages using Google, but not understand exact meaning of Strict-weak Ordering term.

I have this requirement while sorting strings.

$\endgroup$

closed as off-topic by Namaste, Jack, Daniel W. Farlow, JMP, José Carlos Santos Jul 26 '17 at 6:26

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Namaste, Jack, Daniel W. Farlow, JMP, José Carlos Santos
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ Your question was put on hold, the message above (and possibly comments) should give an explanation why. (In particular, this link might be useful.) You might try to edit your question to address these issues. Note that the next edit puts your post in the review queue, where users can vote whether to reopen it or leave it closed. (Therefore it would be good to avoid minor edits and improve your question as much as possible with the next edit.) $\endgroup$ – Martin Sleziak Jul 26 '17 at 9:18
  • $\begingroup$ This should help : stackoverflow.com/questions/979759/… $\endgroup$ – DollarAkshay Jul 13 at 21:56
14
$\begingroup$

This notion, which sounds somewhat like an oxymoron, is not very commonly used in mathematics, but it is in programming. The "strict" just means it is the irreflexive form "$<$" of the comparison rather than the reflexive "$\leq$". The "weak" means that the absence of both $a<b$ and $b<a$ do not imply that $a=b$. However as explained here, the relation that neither $a<b$ nor $b<a$ holds is required to be an equivalence relation. The strict weak ordering then induces a (strict) total ordering on the equivalence classes for this equivalence relation.

This notion is typically used for relations that are in basically total orderings, but defined using only partial information about the identity of items. For instance if $a<b$ between persons means that $a$ has a name that (strictly) precedes the name of $b$ alphabetically, then this defines a strict weak order, since different persons may have identical names; the relation of having identical names is an equivalence relation.

One can easily show that for a strict weak ordering "$<$", the relation $a\not<b$ is (reflexive and) transitive, so it is a pre-order, and the associated equivalence relation is the same as the one associated above to the strict weak ordering. In fact "$a\not<b$" is a total pre-order which induces the same total ordering (or maybe it is better to say the opposite ordering, in view of the negation) on its equivalence classes as the strict weak ordering does. I think I just explained that the notions of strict weak ordering and total pre-order are equivalent. The WP article also does a reasonable job explaining this.

$\endgroup$
  • $\begingroup$ So in simple words can I say, if I want to compare two strings, then strings can be either a<b or b<a but cannot be a=b. $\endgroup$ – Pranit Kothari Nov 29 '13 at 9:42
  • 1
    $\begingroup$ If you are comparing strings, then you would often just define a total ordering (which is a special case of a strict weak ordering) like lexicographic ordering. However, it could be that you want to ignore upper case/lower case distinctions, which would make it into a true weak ordering (strings differing only by case distinctions would then form an equivalence class). $\endgroup$ – Marc van Leeuwen Nov 29 '13 at 10:11
  • 1
    $\begingroup$ @pranitkothari: As for your comment, I don't quite understand it. The ordering as asked whether $a<b$, and it may answer "yes" or "no". The ordering relation never says "$a=b$", all that it can express is that neither $a<b$ nor $b<a$ hold. $\endgroup$ – Marc van Leeuwen Nov 29 '13 at 10:14
  • $\begingroup$ @MarcvanLeeuwen Thank you, particularly for the comment. It made me understand what an equivalence class and better understand about strict weak ordering. $\endgroup$ – legends2k Feb 1 '16 at 9:29
  • $\begingroup$ Definitely not layman's terms $\endgroup$ – DollarAkshay Jul 13 at 21:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.