import math


def weightedMeanStdDev( valueList, weights, scale ):
	"""Compute the weighted mean and standard deviation of a *non-empty* list of numbers."""

	numElements = sum(weights)
	if len(valueList) < 1 or numElements == 0:
		return(None, 0.0)

	mean = 0
	for i in range(len(valueList)):
		mean += float(valueList[i]*weights[i])
	mean = mean / numElements
	variance = 0
	for  i in range(len(valueList)):
		variance += math.pow( valueList[i] - mean, 2 )*weights[i]
	variance = variance / float(numElements)
	
	return (scale * mean, scale * math.sqrt(variance))