This is a re-working and extension of a quadratic iteration visualization generated by Simon Tyler here.

Iterative Quadratic

Take a monic quadratic, :
:=
2
z
+
ω
1
z+
ω
2
0,
ω
1,2
∈
Generate random complex coefficients
ω
1,2
using
RandomComplex
:
In[]:=
ω12:=RandomComplex[{-1-I,1+I},2]
Find the roots
r
1,2
of  and randomly shuffle these back in as
ω
1,2
=
r
1,2
or
ω
1,2
=
r
2,1
as the coefficients of the quadratic using
RandomSample
to select the order:
In[]:=
[ω_]:=SolveValues[
2
z
+{z,1}.RandomSample[ω]==0,z]
Symbolic check:
In[]:=
Table[[{a,b}],4]//Grid
Out[]=
1
2
-b-
-4a+
2
b

1
2
-b+
-4a+
2
b

1
2
-b-
-4a+
2
b

1
2
-b+
-4a+
2
b

1
2
-a-
2
a
-4b

1
2
-a+
2
a
-4b

1
2
-b-
-4a+
2
b

1
2
-b+
-4a+
2
b

Repeat
n
times using
NestList
:
In[]:=
quadraticroots[n_]:=NestList[,ω12,n]
Estimate the maximum absolute value of the resulting roots:
In[]:=
quadraticroots[
4
10
]//Abs//Max
Out[]=
2.21346
Produce an Argand plot of the generated roots:
In[]:=
Graphics{AbsolutePointSize[1],quadraticroots[
5
10
]/.​​Complex[a_,b_]:>Point[{a,b}]},
Options...

Out[]=

Random Cubic

Generalize the above code to a monic cubic, :
:=
3
z
+
ω
1
2
z
+
ω
2
z+
ω
3
0,
ω
1,2,3
∈
Generate random complex coefficients
ω
1,2,3
using
RandomComplex
:
In[]:=
ω123=RandomComplex[{-1-I,1+I},3]
Out[]=
{0.165623-0.286416,-0.423783+0.0984421,0.220354+0.0448621}
Find the roots
r
1,2,3
of  and randomly shuffle these back in as the coefficients of the cubic using
RandomSample
to select the order:
In[]:=
[ω_]:=SolveValues[
3
z
+{
2
z
,z,1}.RandomSample[ω]==0,z]
Repeat
n
times using
NestList
:
In[]:=
cubicroots[n_]:=NestList[,ω123,n]
Estimate the maximum absolute value of the resulting roots:
In[]:=
cubicroots[
4
10
]//Abs//Max
Out[]=
2.88092
Produce an Argand plot of the generated roots:
In[]:=
Graphics{AbsolutePointSize[1],cubicroots[5
4
10
]/.​​Complex[a_,b_]:>Point[{a,b}]},
Options...

Out[]=

Swapping
r
1
↔
r
3

Again find the roots
r
1,2,3
of  but, instead of randomly permuting them, just randomly swap
r
1
↔
r
3
using
RandomChoice
and them put them back in as the coefficients of the cubic:
In[]:=
[ω_]:=SolveValues[
3
z
+{
2
z
,z,1}.RandomChoice[{Identity,Reverse}][ω]==0,z]
Repeat
n
times using
NestList
:
In[]:=
swappedroots[n_]:=NestList[,ω123,n]
Estimate the maximum absolute value of the resulting roots:
In[]:=
swappedroots[
4
10
]//Abs//Max
Out[]=
2.49918
Produce an Argand plot of the generated roots:
In[]:=
Graphics{AbsolutePointSize[1],swappedroots[5
4
10
]/.​​Complex[a_,b_]:>Point[{a,b}]},
Options...

Out[]=

CITE THIS NOTEBOOK

Visualisation of iterated random complex roots​
by Paul Abbott​
Wolfram Community, STAFF PICKS, January 7, 2025
​https://community.wolfram.com/groups/-/m/t/3351787