Normal Form for Polynomial Formulas

In summary, the conversation centers around the concept of a "normal form" for formulas in polynomials of Q, including polynomial fractions. This "normal form" aims to reduce any formula to a polynomial or, if not possible, to a polynomial fraction where the highest coefficient in the denominator is 1. The purpose of this exercise is to create an "equation prover" that can show the steps from the left-hand side to the normal form and then to the right-hand side, proving if the two expressions are equal. The conversation also touches on the challenges of implementing a "toString" method for the polynomial class and the need for a polynomial GCD and division. It is noted that working with integer/rational coefficients simplifies the process
  • #1
dodo
697
2
"Normal form" for formulas

I am about to set myself the following programming exercise; let me know if this would be useful in any way, or how can it be improved into something useful.

Suppose I restrict myself to formulas in polynomials of Q, including polynomial fractions. My intention is to define a "normal form" for such formulas, say, "reduce any possible formula to a polynomial or, if not possible, to a polynomial fraction where the highest coefficient in the denominator is 1". Namely, prefer [tex]{{2 \over 3} x^2 + {5 \over 3} x + {7 \over 3}} \over {x + {11 \over 3}}[/tex] over [tex]{2x^2 + 5x + 7} \over {3x + 11}[/tex].

The intention is reduce to "normal form" any expression entered by the user. This way, two expressions can be proved equal if they reduce to the same normal form.

If a formula is reduced to a normal form by automated, reversible steps, then an "equation prover" is straightforward: just reduce the LHS and RHS to normal form, and compare if equal; if so, show the steps from LHS to normal form and, reversed, the steps to RHS.

Constants and variables would be stored in infinite precision, fractional form (a numerator and a denominator, with gcd=1). Calculations would be performed in the same manner.
 
Mathematics news on Phys.org
  • #2


I've done something similar for rational polynomials. The hardest part is probably going to be a toString method for your polynomial class =-) You wouldn't think it, but rules for writing algebraic expressions are arbitrary and complicated!
 
  • #3


Yes, I know exactly what you mean... which is why I decided I won't spend a minute on output. The output will go on a text line, much like the input, period.

My major concern is: does it exist such a thing as a "normal form"?

That's why I'm limiting the domain, thus avoiding formulas like x^y. But I would really like to include formulas in many variables and, if possible, implement substitution. (Without the program deciding what to substitute in order to accomplish a proof; that might be hard.)
 
  • #4


You can normalize univariate rational functions the same way as rational numbers -- put it into lowest terms, normalize the numerator, denominator, and that fixes everything up to a choice of signs (you can flip the signs on both terms without changing the rational function), which you make an extra case for.

For the record, this means you're going to have to implement a polynomial GCD, along with polynomial division.

(I'm assuming you want to keep everything in the form of a single rational function expression, rather than other sorts of forms... e.g. the thing you get from partial fractions, or a list of sufficiently many point-value pairs)And for the record, things are a lot simpler because you're working with integer/rational coefficients... because you have unique factorization into irreducible elements (times a leading sign), and even more because the Euclidean algorithm is usable.
 
  • #5


Indeed, part of the idea is to get an insight on the algebraic structures below. So this information is, as always, very valuable to me.
 

1. What is a normal form for formulas?

A normal form for formulas is a standardized way of representing logical statements or mathematical expressions. It is a simplified version of a formula that follows specific rules and conventions, making it easier to understand and manipulate.

2. Why is it important to have a normal form for formulas?

Having a normal form for formulas allows for easier comparison and evaluation of logical statements or mathematical equations. It also helps in identifying errors and inconsistencies in the formulas and makes it easier to solve complex problems.

3. What are the common types of normal forms for formulas?

The most common types of normal forms for formulas are conjunctive normal form (CNF) and disjunctive normal form (DNF). Other types include negation normal form (NNF), disjunctive normal form with unique conjunctions (DNU), and conjunctive normal form with unique disjunctions (CNU).

4. How do you convert a formula into a normal form?

The process of converting a formula into a normal form depends on the type of normal form desired. Generally, you start by distributing logical operations, such as negation, disjunction, and conjunction, over the statements or expressions. Then, you apply specific rules and conventions to achieve the desired normal form.

5. Are there any drawbacks to using normal forms for formulas?

One potential drawback of using normal forms for formulas is that the resulting formulas may be longer and more complex than the original ones. This can make it harder to understand and manipulate the formulas. Additionally, certain types of normal forms, like CNF and DNF, may not always be possible to achieve for certain formulas.

Similar threads

Replies
9
Views
2K
  • General Math
Replies
10
Views
3K
Replies
7
Views
1K
Replies
3
Views
742
  • General Math
Replies
16
Views
3K
Replies
3
Views
933
Replies
1
Views
876
Replies
2
Views
1K
  • General Math
Replies
3
Views
4K
  • Calculus and Beyond Homework Help
Replies
1
Views
998
Back
Top