177 reputation
7
bio website
location
age 46
visits member for 1 year, 5 months
seen Apr 19 '13 at 0:15

Jul
9
awarded  Curious
Jun
26
awarded  Teacher
Mar
9
comment Convert logical relational expression to / from disjunctive and conjunctive forms?
That works for my current test cases, but BooleanConvert seems to ignore the form specification for "DNF" and "CNF": BooleanConvert[!Reduce[!result]] produces the same result as BooleanConvert[!Reduce[!result], "DNF"] and BooleanConvert[!Reduce[!result], "CNF"]. Specifying "NAND" and "NOR" does produce the expected results. I'd like to try to understand why this produces the CNF form and add a few more test cases.
Mar
9
asked Convert logical relational expression to / from disjunctive and conjunctive forms?
Mar
6
comment How do I get a two-term polynomial with a leading negative sign to display in the correct (i.e. textbook) order?
Is it the case that Plus@@MonomialList[expr] == expr for any expression? If so, then I can define a format: Format[xPlus[x___]] := Row[Riffle[{expr}, "+"]] and then xPlus := Plus and then use HoldForm[xPlus@@MonomialList[expr]] to the display ordering that I want while still having a valid expression when the hold is released (because the xPlus will be changed to Plus).
Mar
5
revised How do I get a two-term polynomial with a leading negative sign to display in the correct (i.e. textbook) order?
Added the results for using `PolynomialForm`
Mar
5
comment How do I get a two-term polynomial with a leading negative sign to display in the correct (i.e. textbook) order?
@Mr.Wizard: Yes, I already tried PolynomialForm and that produces the same results. I will add that information to the question because that will probably be a common thought pattern.
Mar
5
asked How do I get a two-term polynomial with a leading negative sign to display in the correct (i.e. textbook) order?
Mar
5
comment How does MakeBoxes handle an n-ary operator?
This is working great. I have a similar function to replace power: xPower /: MakeBoxes[xPower[x_, y_ /; y < 0], form_] := SuperscriptBox[MakeBoxes[x, form], MakeBoxes[y, form]];. This keeps Mathematica from inverting negative integer exponents. Do I need to do anything to protect x and y in this case? And would it be something like this: HoldComplete[x] /. HoldComplete[elem_] :> MakeBoxes[elem, form]?
Mar
5
comment How does MakeBoxes handle an n-ary operator?
I understand the use of SetAttributes[xO, HoldAllComplete], but I am having trouble understanding the details of the rule inside of Replace. It looks like the gist of it is that you are safely evaluating MakeBox for each argument of xO.
Mar
5
accepted How does MakeBoxes handle an n-ary operator?
Mar
5
comment How does MakeBoxes handle an n-ary operator?
Works perfectly, but it would have taken me an long and indeterminate amount of time to come to that solution. Thank you @Leonid.
Mar
5
revised How does MakeBoxes handle an n-ary operator?
Minor formatting fix
Mar
4
asked How does MakeBoxes handle an n-ary operator?
Mar
4
comment How do I display an expression with negative powers?
Applying this to my enhanced test case of 4^-3 1/2^-4 yields $4^{-3-2 (-1)}$. I am not sure how that result is produced, but it is not what I expected. The default result from Mathematica for HoldForm[4^-3 1/2^-4] is $\frac{1}{\frac{4^3}{2^4}}$. The desired result is $4^{-3} \cdot \frac{1}{2^{-4}}$.
Mar
4
accepted How do I display an expression with negative powers?
Mar
4
revised How do I display an expression with negative powers?
added 1373 characters in body
Mar
4
comment How do I display an expression with negative powers?
I got it to work for the given example, but now it seems to convert everything that it can with a negative power. 1/2 comes out as 2^-1.
Mar
3
comment How do I display an expression with negative powers?
This works for simple expressions, but when I apply this rule to 1/2^-4, Mathematica produces (1/2^4)^-1.
Mar
3
comment How do I display an expression with negative powers?
This looks appealing, but it will take me a little time to understand it and implement it.