Admittedly, I'm not an expert at this stuff, but it seems like strictly using expected values to calculate optimum decisions can get you into some strange situations, like infinite expected value [1]. For some reason the author brings up lump sums vs annuities, which I don't think is at all comparable to betting (annuities from the US govt are guaranteed payments). That aside, a number of people have already mentioned Kelly criterion [2]. This strategy would tell you that you should take the guaranteed $1 million, but this is a long-run strategy. I personally would take the $1 million because it is guaranteed. I'm also not sure if relying on math for a one-off event like this makes sense.
[1] https://en.wikipedia.org/wiki/St._Petersburg_paradox
[2] https://en.wikipedia.org/wiki/Kelly_criterion