def minkowski_distance(v, w, p):
    """Assumes v and w are equal-length arrays of numbers.
    Returns Minkowski distance of order p between v and w"""
    distance = 0
    for i in range(len(v)):
        distance += abs(v[i] - w[i])**p
    return distance**(1 / p)