# Creating a random complex univariate polynomial

I am a newbie in Mathematica, but I need to create a random univariate polynomial of degree d with complex coefficients whose entries are random complex variables with real and imaginary parts being independent distributions with mean value = 1 and variance = 2.

=================

See for example RandomVariate, Dot and Array or FromCoefficientRules
– Dr. belisarius
Oct 15 ’15 at 16:57

Also, FromDigits[].
– J. M.♦
Oct 15 ’15 at 17:02

Greetings! To make the most of Mma.SE please take the tour now. Help us to help you, write an excellent question. Edit if improvable, show due diligence, give brief context, include minimum working examples of code and data in formatted form. As you receive give back, vote and answer questions, keep the site useful, be kind, correct mistakes and share what you have learned.
– rhermans
Oct 15 ’15 at 17:29

=================

2

=================

Using FromDigits as suggested by J.M.

f[d_Integer, var_Symbol] := ExpandAll@FromDigits[
(#1 + #2 I) & @@@ Transpose[{
RandomVariate[NormalDistribution[1, Sqrt[2]], d]
, RandomVariate[GammaDistribution[1/2, 2], d]
}], var]

To figure out parameters of GammaDistribution

{Î±, Î²} /.
First@Solve[{Variance[GammaDistribution[Î±, Î²]] == v,
m}, {Î±, Î²}]

{m^2/v, v/m}

Just post anothor method about building a polynomial,and the coefficients you can use the @rhermans ‘s solution to produce.

list = RandomComplex[{-2 – I, 5 + 3 I}, 3]
(*{1.83992 + 1.75346 I,3.79133 + 1.05147 I, -0.0638321 – 0.551983 I}*)

AlgebraicNumber[x, list]
(*(1.83992 +1.75346 I) + (3.79133 + 1.05147 I) x – (0.0638321 + 0.551983 I) x^2*)

+1 for AlgebraicNumber
– rhermans
Oct 16 ’15 at 7:25