# Table of Polynomials [closed]

makePolynomial


that creates a random Polynomial of a certain degree, e.g.

2+T+3T^2+8T^3-5T^4...


now I want to create a Table of say 5 of those (different) Polynomials. A natural way would be

Table[makePolynomial, {5}]


but this creates 5 times the same Polynomial. How can I get a Table of 5 different Polynomials, that means makePolynomial is newly evaluated for each table item?

here is my makePolynomial function, I'm also looking for improvements:

makePolynomial[n_Integer, x_Symbol] :=
Module[{z, c}, z = RandomChoice[{-1, 1}] RandomInteger[{0, 100}];
c = Table[RandomInteger[{-100, 100}], {n}];
FromDigits[Reverse[AppendTo[c, z]], x]]

-

## closed as too localized by Yves Klett, Artes, Mr.Wizard♦May 13 '13 at 12:42

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

You should show your definition of makePolynomial. Most likely you need SetDeleyed i.e. := insted of Set (=). E.g. makePolynomial[n_] := x^Range[0, n - 1].RandomInteger[{-10, 10}, n], then it works. –  Artes May 13 '13 at 11:42
Since your given code works as you desire it to, and the problem was something outside of the question asked, I am closing this as "too localized" as it is unlikely to be of use to anyone else. –  Mr.Wizard May 13 '13 at 12:41

I cannot give an explanation why it does not work for you unless you give the definition of your makePolynomial. But what about this?
makePolynomial[deg_] := Sum[RandomInteger[{0, 9}]*x^i, {i, 0, deg}]

@MartinKoller You need not putting it there directly if you use  f := makePolynomial  –  Artes May 13 '13 at 11:59