I want to create a list of polynomials that start with 1 and have additional terms that are negative ie 1-x,1-x-x^2,1-x^9, etc to create a cool fractal by numerically solving them and plotting the roots in the complex plane. I'm doing this by creating lists of random integers between 0 and -1 and then adding a 1 to the beginning of the list. I then create polynomials from this list of coefficients. I want to be able to run this code multiple times so I can add more and more random polynomials to my list but I keep getting a "Tag Times in (1-z-z^2){} is Protected" error.
y = {}
while[i <= 20, coeffArr = RandomInteger[-1, 10]
coeffArr = Insert[coeffArr, 1, 1]
temp = z^Range[0, 10].coeffArr
y = Append[y, temp]
i = i + 1 ]
Set::write: "Tag Times in 2\ {1-z-z^2-z^4-z^6-z^9-z^10} is Protected"


Whileloop. Should bewhile[i <= 20, coeffArr = RandomInteger[-1, 10] ; coeffArr = Insert[coeffArr, 1, 1];...]and so on. see here. – yohbs May 10 '17 at 03:33WhileandForand their friends are not good Mathematica habits. I recommend considering more functional programming style, such asMap,Tableand the like. See here for more. – yohbs May 10 '17 at 03:34