Qt Expected Value Formula