How can one know the polynome equation based on the output of a system?
The right-hand polynomial is the Z-transform $X(z)$ of the discrete-time function $x[n]$, and is given by

$$X(z)=\sum_{n=0}^{\infty}x[n]z^{-n}$$

(unilateral or bilateral does not matter here, since $x[n]$ is causal anyway). So, if you now insert $x[n]$ you get

$$X(z)=\sum_{n=0}^{\infty}z^{-n}=\sum_{n=0}^\infty\left(z^{-1}\right)^n$$

You can use formula for the geometric series, as long as $|z|&gt;1$ (i.e. $|z|&gt;1$ is the region of convergence of the Z-transform):

$$X(z)=\sum_{n=0}^{\infty}\left(z^{-1}\right)^n=\frac{1}{1-z^{-1}}=\frac{z}{z-1}.$$

For the second case, i.e. $x[n]=a^nu[n]$, you can write the following:

$$X(z)=\sum_{n=0}^{\infty}a^nz^{-n}=\sum_{n=0}^{\infty}(az^{-1})^n$$

Then, again applying the geometric series formula you get (given that the series converges, i.e. $|az^{-1}|&lt;1$)
$$X(z)=\frac{1}{1-az^{-1}}$$