Skip to main content

Limit of algebraic polynomial roots: playing around with randomness and algebraic numbers

An adaptation of David Moore (University of California San Diego) work published on Wolfram Community

Download original notebook
SeedRandom[7];
coef[n_, k_] := coef[n, k] = (RandomReal[{-1, 1}] + RandomReal[{-1, 1}] I);

solve[theta_, n_] := NSolve[
   Sum[coef[n, k] z^k, {k, 1, n}] + 0.2 E^(I theta) + 
     0.9 E^(I 2 theta) z^3 If[n >= 3, 1, 0] + 
     0.9 E^(I 3 theta) z^6 If[n >= 6, 1, 0] == 0,
   z
];

disks[theta_, n_] := 
  List @@@ Flatten[
    Table[{Re[z], Im[z], Max[0.3/n, 0.001]} /. solve[theta, n], 
      {n, 4, 30}], 1
  ];

data = NumericArray[disks[0, n]];

\[Theta] = 0;

EventHandler[
  "frame", 
  Function[Null,
    data = NumericArray[disks[\[Theta], n]];
    \[Theta] = \[Theta] + 0.02;
  ]
];

Graphics[{
  Black, Opacity[0.85], 
  Table[
    With[{i = i}, 
      Disk[data[[i]], data[[i]][[3]]] // Offload
    ], 
    {i, Length[data]}
  ],
  AnimationFrameListener[data // Offload, "Event" -> "frame"]
  },
  PlotRange -> 1.5{{-1, 1}, {-1, 1}}, 
  TransitionType -> None, 
  ImageSize -> 500
]
(*VB[*)(FrontEndRef["70dced75-bf56-413d-ac95-2a59df6a126e"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKmxukJKemmJvqJqWZmumaGBqn6CYmW5rqGiWaWqakmSUaGpmlAgCNuBYH"*)(*]VB*)