Computing expected value in a game of chance