def r_sum(y,w): 
    """Reduction: Weighted Sum Transformation for WFG1 Transition 4."""
    numerator = sum(y[i]*w[i] for i in range(len(y)))
    denominator = sum(w)	    
    return ( numerator / denominator )