Tag Archives: subtraction

Polynomial Arithmetic

Polynomial Arithmetic Image

With students beginning to attend classes across the nation, I wanted to focus the site towards some of the things they’re going to be addressing. This latest page publicize some scripts that I wrote to help with polynomial arithmetic. Originally I wrote these as homework exercises for a class in programming, but I have found them useful ever since – both in teaching mathematics classes like college algebra, which spends a lot of attention on polynomials, and in my research life. Its funny (and sad) the number of simple errors that a person (mathematician or not) can make when performing simple arithmetic, so I found it very useful to have a calculator more advanced than the simple scientific calculators that are so easily available.

I’m not going to spend a lot of time discussing the importance of polynomials, or trying to justify their need. I will bring up some problems that I’d like to address in the future, that deal with polynomials. The first is finding the roots of the characteristic polynomial of a matrix. This is useful in research because these roots are the eigenvalues of the matrix and can give many properties of the matrix. There are also some data analysis tools like Singular Value Decomposition and Principal Component Analysis where I will probably build out from this initial set of instances.

The user interface for the scripts I’ve written generate two polynomials and ask the user what is to be done with those polynomials. The options are to add the two, subtract polynomial 2 from polynomial 1, multiply the two, divide polynomial 1 by polynomial 2, and divide polynomial 2 by polynomial 1. There is also the option to make the calculations more of a tutorial by showing the steps along the way. Users who want new problems can generate a new first or second polynomial and clear work.

For addition and subtraction, the program works by first ensuring that both polynomials have the same degree. This can be achieved by adding terms with zero coefficient to the lower degree polynomial. Once this has been accomplished, we simply add the terms that have the same exponent.

For multiplication, the program first builds a matrix A, where the element ai, i+j on row i and column i+j of the matrix A is achieved by multiplying the ith term of the first polynomial by the jth term of the second polynomial. If an was not given a value in the matrix, then we put a value of zero in that cell. Once this matrix is formed, we can sum the columns of the matrix to arrive at the final answer.

The division of two polynomials works first by dividing the first term of the numerator by the first term of the denominator. This answer is then multiplied by the denominator and subtracted from the numerator. Now, the first term in the numerator should cancel and we use the result as the numerator going froward. This process is repeated as long as the numerator’s degree is still equal to or greater than the denominator’s degree.

Check out the latest page on polynomial arithmetic and let me know what you think.

Fraction Arithmetic

Fraction Arithmetic

I hope everyone had a good holiday season. I certainly enjoyed mine. Over this season, I had a chance to speak with some youth and their parents. Funny that whenever we discuss that I have a PhD in applied mathematics, the topics of the children struggling in mathematics and the possibility of tutoring their children always seem to come up. I have no problem with tutoring and I actively participate in such sessions in my spare time. However I will say that it is sometimes a difficult task to do this job over such a short time period. Needless to say, I felt bad that I couldn’t have been of more assistance.

So, this being the holiday season and all, I decided to make somewhat of a new years resolution to focus this site more towards some of the things that the youth struggle with to hopefully be able to answer some of their questions.

With that being said, the first area that I decided to look at was fractions. This is one of the first areas where the youth begin to dislike mathematics. I feel like regardless of how much teachers and professors speak of the importance of understanding these processes, many students simply never grasp the procedures involved, partially because they never get used to the rules associated with these matters.

In this first script on fractions, I’ve focused on four types of problems corresponding to the four basic operations of arithmetic: Addition, Subtraction, Multiplication and Division.

To add two fractions of the form

num1
den1
+
num2
den2

We use the formula

num1
den1
+
num2
den2
=
num1
den1
+
num2
den2
=
num1*den2 + num2*den1
den1*den2

Lets take a moment to consider where this formula comes from. In order to be able to add fractions we first need to obtain a common denominator for the two fractions. One way that always works to obtain a common denominator is to multiply the denominators of the two fractions. So in the formula above, the denominator on the right hand side of the equals sign is the product of the two denominators on the left hand side. Once we have a common denominator, we need to rewrite each of the two fractions in terms of this common denominator.

num1
den1
+
num2
den2
=
num1*den2
den1*den2
+
num2*den1
den1*den2

The formula for subtracting fractions is similar, with the notable difference of a subtraction in the place of addition.

num1
den1
num2
den2
=
num1*den2 – num2*den1
den1*den2

To multiply two fractions (also known as taking the product of two fractions, the resulting numerator is the product of the two initial numerators, and likewise the resulting denominator is the product of the two initial denominators.

num1
den1
*
num2
den2
=
num1*num2
den1*den2

Finally, remembering that division is the inverse of multiplication, we can derive the formula to divide two fractions by multiplying by the inverse of the fractions:

num1
den1
รท
num2
den2
=
num1
den1
*
den2
num2
=
num1*den2
den1*num2

The next step in each of these operations is to reduce the fraction to lowest terms. One way of doing this is by considering Euclid’s GCD algorithm which is available here.

The script is available to practice your work on fractions at
http://www.learninglover.com/examples.php?id=31