Simulation of an alien population
There are some obvious possible simplifications for elegance, if not necessarily for speed.

The while condition should be written as a double-ended inequality:

while 0 &lt; n &lt; pop_max:
    …


The variable j is unused.  The convention is to use _ as the name of a "throwaway" variable.

The if-elif chain can be eliminated with a smarter randint() call:

for j in range(n):
    n += randint(-1, 2)


NumPy is overkill here, when all you want to know whether the population went extinct.  The built-in sum() function can do the counting for you.

Each simulation run is independent.  I'd put the code in a function for readability.

from random import randint

def population(pop_max=100):
    n = 1
    while 0 &lt; n &lt; pop_max:
        for _ in range(n):
            n += randint(-1, 2)
    return n

iterations = 100000
print(sum(population() == 0 for _ in range(iterations)) / iterations)