A list becomes a function
Here is a signal that fades: x[n] = 0.8ⁿ for n ≥ 0, and 0 before n = 0. Each sample is 0.8 times the one before: 1, 0.8, 0.64, 0.512 ... It shrinks forever but never reaches 0.
The Z-transform turns the whole list into one function of a number z: X(z) = Σ x[n]·z⁻ⁿ. Multiply each sample by z⁻ⁿ, that is (1/z)ⁿ, then add every product. In general z is a complex number.
Does the sum converge?
Choose z = 2. The terms x[n]·2⁻ⁿ are 1, 0.4, 0.16, 0.064 ...: each is 0.4 times the last. The running sum goes 1, 1.4, 1.56, 1.624 ... and settles at 1.667. So X(2) = 1.667.
Each term is 0.8/z times the one before: a geometric series. When |0.8/z| < 1 it adds up to 1/(1 − 0.8/z) = z/(z − 0.8). Check: 2/(2 − 0.8) = 1.667, where the running sum settled.
Now choose z = 0.5. Each term is 0.8/0.5 = 1.6 times the last: 1, 1.6, 2.56, 4.1 ... The sum grows without limit. The formula says 0.5/(0.5 − 0.8) = −1.667, but the sum never gets there.
ROC, poles and the unit circle
The sum converges only when |0.8/z| < 1, that is |z| > 0.8. Only the size of z matters, not its angle. Those z fill the z-plane outside a circle of radius 0.8: the region of convergence, or ROC.
X(z) = z/(z − 0.8) is 0 at z = 0: a zero, drawn ○. At z = 0.8 it blows up: a pole, drawn ×. There every term is 1, so the sum diverges. The edge of the ROC runs through the pole.
The unit circle |z| = 1 lies inside the ROC. On it z = e^jω and X(e^jω) is the DTFT, so this signal has a spectrum. At z = 1 the terms are 0.8ⁿ, adding up to 1/(1 − 0.8) = 5.
Why the ROC matters
Now take x[n] = −0.8ⁿ for n ≤ −1, and 0 from n = 0 on. Its sum is also z/(z − 0.8), but only for |z| < 0.8. At z = 0.4 it adds up to −1. Same formula, different ROC, different signal.
In Python 3 with numpy, the sum is one line. 200 terms are plenty: 0.4²⁰⁰ is far too small to matter. It prints 1.666666666666667, matching z/(z − 0.8). Next: getting x[n] back from X(z).
The working
# step 1/10 · signal x[n] = 0.8ⁿ · u[n] u[n] = 1 for n ≥ 0, 0 for n < 0 (the unit step) x[0] = 1 x[1] = 0.8 x[2] = 0.64 x[3] = 0.512 x[4] = 0.4096 ... infinitely many samples, none of them 0
The factor 0.8 and the test values z = 2, 0.5, 0.8, 1 and 0.4 are chosen examples. Every term, running sum and value in the figure is computed from the definition X(z) = Σ x[n]·z⁻ⁿ in this model; the plot adds the first 16 terms. The figure only tries real, positive values of z, so every term is a real number. The ROC is a statement about |z|: any complex z with the same size behaves the same way.