def split_slack(kp):
    """Computes the expected value of the splitting item r.v. and the expected value of the slack r.v.

    Computes E(S), the expected value of the splitting item r.v. S using the expression (26b) in theorem 8.
    Computes E(K), the expected value of the slack r.v. K, using the expression (29c) in Theorem 11.

    Args:
        kp: Int. knapsack capacity

    Returns:
        s: Int. the expected value of the splitting item r.v. S
        k: float. the expected value of the slack r.v. K

    """
    s = (1 + 1 / kp) ** kp
    base = 1 + 1 / kp
    k = - (base ** (kp) - 1) * base
    k = k + (base ** (kp + 1) - 1 - base) * (kp + 3)
    k = k - 2 * kp * (base ** (kp + 2) - (5 * kp ** 2 + 7 * kp + 2) / (2 * kp ** 2))
    return (s, k)