Factorization Dictionary
- 2022년 4월 8일
- 1분 분량
Like any other day, I was doing my math homework. The topic was factorization. I could not memorize every factorising equations so I needed to go back to the page where it is written for every single problem. It was very inefficient. I decided to make a programme that tells me the factorised equation if I type the expanded equation. This programme is very simple but very useful. This programme did not simply show the equation, it really helped me to memorise the equation. This is the code: from sympy import Symbol x = Symbol(‘x’) y = Symbol(‘y’) z = Symbol(‘z’) a = Symbol(‘a’) b = Symbol(‘b’) c = Symbol(‘c’) insu = {} insu[‘a^3 + b^3’] = “(a + b)(a^2 – ab +b^2)” insu[‘a^3 – b^3’] = “(a-b)(a^2 + ab + b^2)” insu[‘(a + b)^3’] = “a^3 + 3a^2b + 3ab^2 + b^3” insu[‘(a – b)^3’] = “a^3 – 3a^2b + 3ab^2 – b^3” insu[‘(a + b+ c)^2’] = “a^2 + b^2 + c^2 + 2ab + 2bc + 2ac” insu[‘a^2 + b^2 + c^2’] = “(a + b + c)^2 – 2ab -2bc – 2ca” insu[‘a^3 + b^3 + c^3’] = “(a+ b+ c)(a^2 + b^2 + c^2 -ab -bc -ca) + 3abc or 0.5(a + b + c){(a-b)^2 + (b-a^3 – b^3c)^2 + (c-a)^2}” insu[‘a^4 + a^2b^2 + b^4’] = “(a^2 + ab + b^2)(a^2 – ab +b^2)” insu[‘(a^2 + ab + b^2)(a^2 – ab +b^2’] = “a^4 + a^2b^2 + b^4” print(insu[input()])

댓글