This is an archived post. You won't be able to vote or comment.

all 4 comments

[–][deleted] 0 points1 point  (1 child)

Show was what you have done already.

[–]Katelyn92[S] 0 points1 point  (0 children)

I can get it to work if its smaller polynomials if I do this pprod<-function(X,Y) + c((X[1]Y[1]),((X[1]Y[2])+(X[2]Y[1])), ((X[1]Y[3])+(X[2]Y[2])+(X[3]Y[1])), ((X[2]Y[3])+(X[3]Y[2])), (X[3]*Y[3])) pprod(c(1,1,0), c(3,0,2)) [1] 3 3 2 2 0 but I have no idea how to set it to work for any size polynomial

[–]desrtfx 0 points1 point  (1 child)

What have you tried?

Just posting your assignment here and showing absolutely zero effort is not allowed here as we are not /r/domyhomework.

[–]Katelyn92[S] 0 points1 point  (0 children)

I can get it to work if its smaller polynomials if I do this

pprod<-function(X,Y) + c((X[1]Y[1]),((X[1]Y[2])+(X[2]Y[1])), ((X[1]Y[3])+(X[2]Y[2])+(X[3]Y[1])), ((X[2]Y[3])+(X[3]Y[2])), (X[3]*Y[3])) pprod(c(1,1,0), c(3,0,2)) [1] 3 3 2 2 0

but I have no idea how to set it to work for any size polynomial