Skip to content

codewithpandey/Algebra-In-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

Algebra-In-Python

Trying to solve algebric expressions in Python.

Research and Analysis for the Project

Let's solve algebra using python programs. In an algebric expression we don not have a numeric value which can be calculated. So we have to do evry step that we do in our copies. For example normally by multiplication we mean to multiply two values. But as for in algbra we have to perform a concatination operation. i.e. a * b = ab. Again, if there is any exponent for the given variable they should be added and also the coefficients are to be multiplied arithmetically. for division we will leave as it is i.e. a/b

Starting with addition:

There are four major types of problems in algebraic additions.

  1. If there are two same variables with no co-efficients such as a + a, then we have to assume there co-efficients as 1 and while adding them there co-efficients add upto 2, and there is left only one variable and the final answer is 2a.

  2. If there are two same variables with some co-efficients such as 2a + 3a, then we have to separately add there co-efficients and take one variable to be shown in the result, i.e. 5a.

  3. If there are 2 different variables with same or different co-efficients, we know that we can not perform addition operation on two different variables in algebra.

  4. If there are two same variables but with their powers are different thent he result will be same as it is with 2 different variables.

Moving on to multiplication:

In multiplication the cases are different from those in addition. Think of it as the concatination operator but the co-efficients will be arithmetically multiplied and should be concatinated in front of the concatinated variables. Of course the case is different with same variables.

  1. If there are two same variables with no co-efficients, of course we assume the co-efficients as 1, but on multiplying the variable will have an exponent. E.g. a * a will have a result a^2.

  2. If there are two same variables with different co-efficients and with different powers, the powers must be added and the co-efficients must be multiplied arithmetically.

  3. If there are two different variables with same or different powers or, same or different co-efficients, the co-efficients will be multiplied but the varibales itself with there exponents shall be concatinated. E.g. 2a^2 * 3b^3 will result into 6a^2b^3.

Let's work on Division:

For division we have many ways to approach. For instance, we can multiply the denominator with the numerator by chnaging it's power from positive to negative or vice versa is also possible. Let's see what are the problems we have to solve.

  1. If both the numerator and the denominator (without power) are same, then we can just eqaute the expression to be absolute unity.

  2. If both the numerator and the denominator (with power) are same, we can just negate there power between each other and, print the rest. We can also perform an algebraic multiplication just by swapping the sign of the power of any one.

  3. If the numberator and denominator is different (with or without powers) then no worries, we can print it as it is. Or we can also print numerator multiplied by the inverse power of the denominator.

About

Trying to solve algebraic expressions in Python.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages