ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 09 Aug 2014 14:21:38 +0200How to count degree of a monomial in boolean polynomialhttps://ask.sagemath.org/question/23729/how-to-count-degree-of-a-monomial-in-boolean-polynomial/As stated in the title, my question is:
> Is there any way to count the degree of a monomial of a boolean polynomial in Sage?
Say, for example,
degree(xy) = 2
degree(xyz) = 3
Sat, 09 Aug 2014 08:32:20 +0200https://ask.sagemath.org/question/23729/how-to-count-degree-of-a-monomial-in-boolean-polynomial/Answer by FrédéricC for <p>As stated in the title, my question is:</p>
<blockquote>
<p>Is there any way to count the degree of a monomial of a boolean polynomial in Sage?</p>
</blockquote>
<p>Say, for example, </p>
<pre><code>degree(xy) = 2
degree(xyz) = 3
</code></pre>
https://ask.sagemath.org/question/23729/how-to-count-degree-of-a-monomial-in-boolean-polynomial/?answer=23730#post-id-23730 Like that ?
sage: R = BooleanPolynomialRing(3, 'x')
sage: x, y, z = R.gens()
sage: (x * y).degree()
2
sage: (x * y * z).degree()
3
Sat, 09 Aug 2014 14:21:38 +0200https://ask.sagemath.org/question/23729/how-to-count-degree-of-a-monomial-in-boolean-polynomial/?answer=23730#post-id-23730