Algorithm to polynomial multiplication
I need to create algorithm to polynomial multiplication , but I don't know how to do it. Please for help.
I need to create algorithm to polynomial multiplication , but I don't know how to do it. Please for help.
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2018-04-25 08:02:57 +0100
Seen: 330 times
Last updated: Apr 25 '18
Some questions:
I know that SageMath has algorithms for polynomial multiplication, but I must write it myself. Yes, it is my homework I wrote something like this, but in the end should be showed polynomial, not only factors. I don't know how to do it. Could you help me? Please
W1=[1,2,3,4] W2=[5,4,3,2,1] W3=[]
for i in range(0,len(W1)+len(W2)-1): W3.append(0)
for i in range(0,len(W1)): for j in range(0,len(W2)): W3[i+j]=W3[i+j]+W1[i]*W2[j]
print(W3)
Your algorithm is fine for multiplying the polynomials. What you get is the list of coefficients. (I don't know what you mean by "factors".) If you want a polynomial from this list, you have to build a polynomial ring and get the polynomial from the list of coefficients in the following way: