## Tuesday, January 12, 2016

### Calculate the odd of winning Powerball in R

This Wednesday’s Powerball grand prize already climbed up to \$1.5 BILLION. If you choose to cash out, it would be \$930 million. And it keeps increasing…
So, what’s the odd of winning the jackpot prize?
Here is the game rule according to Powerball.com:

…we draw five white balls out of a drum with 69 balls and one red ball
out of a drum with 26 red balls.

We can calculate the total number of different combinations in R:

``````> choose(69,5)*26
[1] 292201338``````

If we are super super lucky to win the Jackpot of \$930 million cash value, given that we have to pay 39.6% as federal tax, how much we expect to return for a \$2 investment? (Of course, everyone expect to win the \$1.5 billion jackpot)

``````> 930e6*(1-0.396)/(choose(69,5)*26)
[1] 1.92``````

Actually it’s not a good investment. (Thanks for the comment below. I made a mistake; 930million should be 930e6, not 930e9).
If we want to be 100% guaranteed, we have to buy all 292 million combinations. In that case, can we earn?

``````# this is what we pay
> choose(69,5)*26*2
[1] 584,402,676

# this is what we earn in total, before tax
> 930000000 + 1000000*choose(25,1) + 50000*choose(5,4)*choose(69-5,1) + 100*choose(5,4)*choose(69-5,1)*choose(25,1) + 100*choose(5,3)*choose(69-5,2) + 7*choose(5,3)*choose(69-5,2)*choose(25,1) + 7*choose(5,2)*choose(69-5,3) + 4*choose(5,1)*choose(69-5,4) + 4*choose(69-5,5)
[1] 1,023,466,048

# Nearly \$5 billion!!! Then we need to pay 40% of tax. Maybe not for the minor prize, let's simplify it for all.
> 1023466048 * (1-0.396)
[1] 618,173,493``````

That’s still more than what we paid. Why don’t we do that?
Remember, people share the prize if multiple persons got the same winning number, which we don’t know. :D

Just some fun! :)

References:
1. Fascinating Math Behind Why You Won’t Win Powerball
(http://www.wired.com/2016/01/the-fascinating-math-behind-why-you-wont-win-powerball/)
2. Tax for lottery (http://classroom.synonym.com/much-federal-taxes-held-lottery-winnings-20644.html)

1. Thanks! Jackpot payoff is off by a few digits though. I think you want 9.3e8 instead of 930e9. The expected value of the jackpot payoff is 1.92x the price of the ticket assuming only one winner.

1. Thanks. I don;t get the part "jackpot payoff is 1.92x the price of the ticket". Could you please describe with more details?

2. 930e9 should be 930e6.

It would be clearer if you outlined the math behind the total winnings combinations;

totwin <- 930e6*1 +
1e6*choose(5,5)*choose(25,1) + ## match 5 out of 5 white, don't match powerball
5e4*choose(5,4)*choose(69-5,1)*choose(1,1) + ## match 4 out of 5 white, match powerball
1e2*choose(5,4)*choose(69-5,1)*choose(25,1) + ## match 4 out of 5 white, don't match powerball
1e2*choose(5,3)*choose(69-5,2)*choose(1,1) + ## match 3 out of 5 white, match powerball
7*choose(5,3)*choose(69-5,2)*choose(25,1) + ## match 3 out of 5 white, don't match powerball
7*choose(5,2)*choose(69-5,3)*choose(1,1) + ## match 2 out of 5 white, match powerball
4*choose(5,1)*choose(69-5,4)*choose(1,1) + ## match 1 out of 5 white, match powerball
4*choose(5,0)*choose(69-5,5)*choose(1,1) ## match 0 out of 5 white, match powerball
prettyNum(totwin, big.mark=",")
[1] "1,023,466,048"

You've also missed a couple of combination factors, probably because you've dropped terms.

1. Thanks. This looks much better. If you don't mind, I take it for the update :)

2. Fine by me. I've just done a similar write-up myself. Mind giving a shout-out?

http://www.jcarroll.com.au/2016/01/stats/jackpot/

3. Of course not. Actually it's fun to read your website. Nice to know you.

3. This was fun! Is it possible to deduct the gambling losses on the losing tickets on your tax return, thus lowering the final tax bill?

1. I guess you can if you loss a lot and keep the evidence. But don't take my words as I'm not an expert on tax. Better ask someone knowing tax things better.

2. That's a really interesting point! I would say that buying 292 million tickets (of which only a few win) would definitely incur a lot of expense (i.e. loss) in my book.
I wonder if there's a hedge fund buying all the numbers right now. I hope they sent the intern to wait in line.... which makes me think that perhaps your analysis doesn't account for the acquisition cost of each ticket.

3. you are right. It's not practical at all, as this following article states: http://www.businessinsider.com/buying-every-powerball-ticket-2016-1 "According to Statista, JPMorgan Chase Bank has about 189,000 employees. That means that there are about 1,546 possible Powerball tickets for each employee. If each employee spent 10 hours a day buying and filling out Powerball tickets for three days, this would mean each employee would need to fill out about 50 tickets per hour."

4. Very comprehensible analyses, an eye-opener for many I would say. Thanks for the tip it was rather timely. People should understand what they are getting into be it Powerball or other lottery.
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "http://onetipperday.sterding.com/2016/01/calculate-odd-of-winning-powerball-in-r.html?showComment=1452877109950", "fetch_time": 1638812009000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2021-49/segments/1637964363309.86/warc/CC-MAIN-20211206163944-20211206193944-00569.warc.gz", "warc_record_offset": 63474919, "warc_record_length": 24668, "token_count": 1550, "char_count": 5054, "score": 4.3125, "int_score": 4, "crawl": "CC-MAIN-2021-49", "snapshot_type": "latest", "language": "en", "language_score": 0.8489864468574524, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00008-of-00064.parquet"}