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.
2 Answers
$\begingroup$
$\endgroup$
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,
Mean[GammaDistribution[α, β]] ==
m}, {α, β}]
{m^2/v, v/m}
$\begingroup$
$\endgroup$
1
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*)
RandomVariate
,Dot
andArray
orFromCoefficientRules
$\endgroup$FromDigits[]
. $\endgroup$