Plotting the set of complex numbers that satisfy an inequality

900 Views Asked by At

I am trying to understand how to plot the set on the complex plane that satisfies $$\mid 1 + z + z^2|<4$$ where $z \in \mathbb{C}$. I have tried to use $z = a+bi$ and substitute in to the inequality, but I am left with imaginary numbers that I do not know how to interpret. Is there anyway to visualize this inequality graphically on the complex plane? Thanks in advance.

2

There are 2 best solutions below

2
On BEST ANSWER

Note that the roots of $z^2+z+1$ are $-\frac12\pm\frac{\sqrt3}2i$. So$$\lvert z^2+z+1\rvert<4\iff\left\lvert z-\left(-\frac12+\frac{\sqrt3}2i\right)\right\rvert\times\left\lvert z-\left(-\frac12-\frac{\sqrt3}2i\right)\right\rvert<4.$$Therefore, you have the set of those points $z\in\mathbb C$ such that the product of their distances to $-\frac12+\frac{\sqrt3}2i$ and to $-\frac12-\frac{\sqrt3}2i$ is smaller that $4$. So, you get the region of $\mathbb C$ bounded by a Cassini oval:

enter image description here

3
On

Now that you've seen the smart way to do this, let's do it the dumb way! (Well, it always works a charm for me.)

This is written for Python 3.4.0 and matplotlib 2.1.1. (Yes, my computer is very old.)

from random import random import matplotlib.pyplot as plt N = 10000 M = 3.0 X = [] Y = [] plt.figure(figsize=(8,8)) plt.xlim(-3,3) plt.ylim(-3,3) for count in range(N): x = M*(2*random() - 1) y = M*(2*random() - 1) z = x + y*1j if abs(z**2 + z + 1) < 4: X.append(x) Y.append(y) plt.scatter(X, Y, s=1, c='k') plt.show() Really dumb plot.

(I'll get me coat.)