Added doc string for expected value method of Factor class
Implemented the expected value method