import math


def logistic_growth(p, r, k, t):
    """
    Models logistic growth over discrete generations.
    
    :param p: initial population
    :param r: growth rate
    :param k: final population
    :param t: number of generations

    :returns: population size at time t
    :rtype: numeric
    """
    return (p * k) / (p + (k - p) * math.exp(-r * t))