0
$\begingroup$

If I have two polynomials of the same degree how can I say one is larger than the other based on its values of coefficients

I were to have a list of multiple polynomials and I need to sort the list in ascending order (not just the degree of the polynomial but relatively all the terms of the polynomial)

How can I achieve it
say I have
$$3x^2+x+4$$ $$3x^2+2x+4$$ $$1x^2+x+4$$ $$2x^2+2x+4$$

Now I want the final list to be
$$1x^2+x+4$$ $$2x^2+2x+4$$ $$3x^2+x+4$$ $$3x^2+2x+4$$
The question that arises here is how can we effectively say a polynomial is larger or smaller than the other polynomial based on all its coefficients or terms

$\endgroup$
  • $\begingroup$ Your question isn't super clear but I think you're looking for dictionary order or lexicographic order $\endgroup$ – dbx Dec 31 '17 at 17:25
  • $\begingroup$ You are asking how to do it, but your example implies that you already know how to do it. What am I missing? $\endgroup$ – user491874 Dec 31 '17 at 17:28
0
$\begingroup$

You can certainly construct a partial order among the polynomials by saying one is greater than another if all its coefficients are greater. This will leave you with many cases where two polynomials are incomparable. In your example, you would not have $3x^2+x+4 \gt 2x^2+2x+4$ in this order. You can also use the lexicographic order, which is total, sorting by the highest coefficient first, then by the next if the first two coefficients are equal, and so on. That would give the order you cite. It does not guarantee that the order on the polynomials matches the order of their values at any given $x$. You would have $3x^2+x+4 \gt 2x^2+1000x + 4$, but if you evaluate those for $x \in (0,999)$ the second will be greater. The lexicographic order corresponds to the order of the values as $x$ gets very large.

| cite | improve this answer | |
$\endgroup$
0
$\begingroup$

For sorting polynomials, I guess you want the one that has a bigger degree to be bigger, and if two polynomials are of the same degree, but otherwise different, pick the highest degree where the coefficients differ and declare the polynomial with the bigger coefficient to be bigger. So, for example, $0\lt x^2-1\lt x^2+1\lt -x^3\lt x^3$.

This is not the only way, though. You can, for example, just take a difference of the polynomials, and then look at the highest coefficient: if it is $\gt 0$, the first polynomial is bigger; if it is $\lt 0$ - the second. This second way of comparing the polynomials means that, for example, $-x^3\lt 0\lt x^2-1\lt x^2+1\lt x^3$. Not sure if that is good for your purposes.

If your goal is only to establish a total order on the set of all polynomials (for the sorting purposes), then there are many other relations that we can define. The real question here is - how do you decide? Have you got any additional preferences (not stated in the question) for what this comparison should look like? I mean, for example, if you want $p\gt q$ whenever $p(2018)\gt q(2018)$, that can be sorted out - if you really want it.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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