TX Lottery

Problem:

Before a single Texas Lottery Scratch-off ticket is sold, the probability of a winning ticket is known.  Unfortunately, as the game progresses and tickets are purchased (winning and losing), the probability of a customer purchasing a winning ticket changes.  Using openly published information from the TX lottery commission, we are possibly able to gain a better idea of the current probability of a winning ticket for all Texas lottery scratch off games.

Background:

For this analysis we will be using some basic probability properties.  In general, the number of  winning tickets, divided by the total number of available tickets, is the probability of a ticket being a winner.  But, unless we are the first person to buy a scratch-off, we don't want to know the overall probability at the start of the game.  For the vast majority of players, they want/need/should know the probability of the ticket they are about to purchase.  We will  denote this as P(T), where T is the ticket number they are purchasing.  So, if we have N tickets at the start of the game, and W winning tickets, the probability of the first customer who purchases 1 ticket, winning is:

When T=1, P(1) = W / N

Now we have N-1 tickets in play, and our analysis must take into account the previous results:

1) If the first ticket was a winner, we now have N-1 tickets in play, as well as W-1 winning tickets in play.  We can compute P(2) as:

P(2) = (W - 1) / (N - 1)

2) If the first ticket was a losing ticket, we now have N-1 tickets in play, but we still have W winning tickets so we can compute P(2) as:

P(2) = W / (N - 1)

Regardless of the 1 ticket's outcome,

If you run a few more examples by hand, you'll see that, in general:

P(T) = (W - # of winning tickets played) / (N - # of losing tickets played - # of winning tickets played)

Now that we have a general formula for the probability of purchasing a winning texas scratch-off ticket, let's try to optimize our playing strategy.

Winning Strategies

First off, we want to win.  It's intuitive to see that the more winning tickets we buy, the more money we will win.  The more losing tickets we buy, the more money we will lose.  For this game, we want to buy more winning tickets than losing tickets.  Knowing the probability of a winning ticket allows us to theoretically pick a 'better' ticket.  Therefore, without any other information, we will want to purchase tickets with a higher probability of winning.

Assumptions

When we talk about the probability of purchasing a winning lottery ticket, we make a few dangerous assumptions.  We first have to define that there are two types of tickets: winning and losing.  Since the lowest prize is generally (there are definitely exceptions to this rule) the face value of a ticket, any ticket that wins will get us our money back.  I would consider this a win, even though we haven't gained any money; but we haven't lost anything either.

We then have to assume that there is an even distribution of those tickets throughout the state of texas.  To prove this point we would have to empirically know where all winning scratch-off tickets were purchased.  Since we don't have the funds, or the ability to purchase all scratch-offs from all vendors in the state of TX, we'll have to just assume that winning and losing tickets are evenly geographically distributed, thus making our local testing, relevant.

We also have to assume that all tickets are purchased at the same rate.  This one is hard to really gauge since it effectively removes any of the marketing and design work that goes into tickets.  The price point and the layout/prize/design all have to be ignored for now.  For now, based on the data we can collect, we have to say that a ticket, is a ticket, is a ticket.

Real-time Data
Downloading report from txlottery.org
Already downloaded odds from txlottery.org on 01/17/2018
Successfully downloaded the scratch-off report

Game #2078 - Weekly Grand ($2) => 31.25% chance of winnning something.
Total prizes: 9,110,315 of 29,153,008 tickets
Total claimed: 1,247

Game #1874 - Big Money ($2) => 31.21% chance of winnning something.
Total prizes: 1,637,735 of 5,240,752 tickets
Total claimed: 3,359

Game #2023 - Dazzling Dollars X9 ($5) => 31.15% chance of winnning something.
Total prizes: 1,771,727 of 5,669,526 tickets
Total claimed: 8,435

Game #1877 - Super Loteria ($5) => 30.39% chance of winnning something.
Total prizes: 10,742,914 of 34,377,325 tickets
Total claimed: 422,844

Game #2021 - $1,000,000 Big Money ($20) => 29.95% chance of winnning something.
Total prizes: 2,666,333 of 8,532,266 tickets
Total claimed: 157,955

Game #2018 - Super 7's ($10) => 29.88% chance of winnning something.
Total prizes: 4,235,890 of 13,554,848 tickets
Total claimed: 264,556

Game #2012 - Hot 7's ($1) => 29.87% chance of winnning something.
Total prizes: 6,354,425 of 20,334,160 tickets
Total claimed: 399,208

Game #2016 - Wild 7's ($3) => 29.78% chance of winnning something.
Total prizes: 3,600,786 of 11,522,515 tickets
Total claimed: 241,705

Game #2020 - Money ($5) => 28.60% chance of winnning something.
Total prizes: 2,353,637 of 7,531,638 tickets
Total claimed: 279,166

Game #1862 - Bonus Break the Bank ($5) => 28.27% chance of winnning something.
Total prizes: 4,202,529 of 13,448,093 tickets
Total claimed: 559,288

Game #2013 - Lucky 7's ($5) => 27.90% chance of winnning something.
Total prizes: 5,202,404 of 16,647,693 tickets
Total claimed: 772,689

Game #1838 - Instant Millionaire ($20) => 27.57% chance of winnning something.
Total prizes: 10,851,488 of 34,724,762 tickets
Total claimed: 1,764,126

Game #2014 - Mega 7's ($20) => 27.27% chance of winnning something.
Total prizes: 3,004,643 of 9,614,858 tickets
Total claimed: 525,928

Game #1885 - Mega Loteria ($10) => 25.83% chance of winnning something.
Total prizes: 7,493,175 of 23,978,160 tickets
Total claimed: 1,753,175

Game #1899 - Texas Lottery Platinum ($50) => 25.29% chance of winnning something.
Total prizes: 1,074,166 of 3,437,331 tickets
Total claimed: 274,379

Game #1871 - $100,000 Bing-O-Rama ($5) => 24.12% chance of winnning something.
Total prizes: 3,920,066 of 12,544,211 tickets
Total claimed: 1,178,263

Game #1891 - Strike It Rich ($5) => 23.94% chance of winnning something.
Total prizes: 2,139,218 of 6,845,498 tickets
Total claimed: 657,566

Game #2007 - $5 Holiday Gift Pack ($5) => 23.75% chance of winnning something.
Total prizes: 8,770,866 of 28,066,771 tickets
Total claimed: 2,761,165

Game #2002 - Ultimate Crossword/ Ultimate Bingo ($20) => 23.16% chance of winnning something.
Total prizes: 1,756,247 of 5,619,990 tickets
Total claimed: 591,739

Game #1671 - $500,000,000 Cash ($20) => 22.93% chance of winnning something.
Total prizes: 12,362,471 of 39,559,907 tickets
Total claimed: 4,272,809

Game #1857 - Weekly Half Grand ($1) => 22.65% chance of winnning something.
Total prizes: 6,579,900 of 21,055,680 tickets
Total claimed: 2,340,338

Game #1859 - Crossword Connect ($5) => 22.36% chance of winnning something.
Total prizes: 5,886,374 of 18,836,397 tickets
Total claimed: 2,156,514

Game #1879 - Money Time ($2) => 22.31% chance of winnning something.
Total prizes: 1,498,753 of 4,796,010 tickets
Total claimed: 551,770

Game #1860 - Big Play Cashword ($10) => 21.80% chance of winnning something.
Total prizes: 3,616,428 of 11,572,570 tickets
Total claimed: 1,398,575

Game #1822 - Winners Galore ($20) => 21.71% chance of winnning something.
Total prizes: 5,139,100 of 16,445,120 tickets
Total claimed: 2,003,967

Game #1855 - Cowboys ($5) => 21.42% chance of winnning something.
Total prizes: 2,482,383 of 7,943,626 tickets
Total claimed: 993,516

Game #1845 - $100 Million Golden Treasures ($20) => 20.52% chance of winnning something.
Total prizes: 2,281,260 of 7,300,032 tickets
Total claimed: 985,433

Game #1856 - Houston Texans ($5) => 20.48% chance of winnning something.
Total prizes: 1,384,365 of 4,429,968 tickets
Total claimed: 599,820

Game #1894 - Texas Lottery Red ($1) => 20.40% chance of winnning something.
Total prizes: 4,120,126 of 13,184,403 tickets
Total claimed: 1,796,740

Game #1896 - Texas Lottery Silver ($5) => 20.01% chance of winnning something.
Total prizes: 3,482,980 of 11,145,536 tickets
Total claimed: 1,565,547

Game #1806 - Texas Loteria ($3) => 19.75% chance of winnning something.
Total prizes: 10,477,516 of 33,528,051 tickets
Total claimed: 4,803,117

Game #2010 - $500 Frenzy ($5) => 19.19% chance of winnning something.
Total prizes: 1,881,084 of 6,019,469 tickets
Total claimed: 898,643

Game #1895 - Texas Lottery Blue ($3) => 19.08% chance of winnning something.
Total prizes: 2,165,878 of 6,930,810 tickets
Total claimed: 1,042,516

Game #1861 - Instant Bingo ($2) => 18.80% chance of winnning something.
Total prizes: 8,232,223 of 26,343,114 tickets
Total claimed: 4,038,827

Game #2019 - Fast 50'S ($1) => 18.33% chance of winnning something.
Total prizes: 1,970,453 of 6,305,450 tickets
Total claimed: 997,569

Game #1858 - Break the Bank ($2) => 17.93% chance of winnning something.
Total prizes: 8,305,016 of 26,576,051 tickets
Total claimed: 4,313,410

Game #2003 - Veterans Cash ($2) => 17.59% chance of winnning something.
Total prizes: 1,666,614 of 5,333,165 tickets
Total claimed: 883,815

Game #2008 - Season's Greetings ($10) => 17.40% chance of winnning something.
Total prizes: 1,349,294 of 4,317,741 tickets
Total claimed: 723,832

Game #1882 - Dominoes ($3) => 17.10% chance of winnning something.
Total prizes: 1,762,613 of 5,640,362 tickets
Total claimed: 962,511

Game #1852 - Wheel of Fortune ($10) => 16.57% chance of winnning something.
Total prizes: 2,382,975 of 7,625,520 tickets
Total claimed: 1,341,834

Game #1759 - $200 Million Payout ($10) => 16.38% chance of winnning something.
Total prizes: 8,733,858 of 27,948,346 tickets
Total claimed: 4,969,016

Game #1897 - Texas Lottery Black ($10) => 16.18% chance of winnning something.
Total prizes: 2,762,001 of 8,838,403 tickets
Total claimed: 1,588,888

Game #1794 - $5 Set For Life ($5) => 16.11% chance of winnning something.
Total prizes: 6,657,371 of 21,303,587 tickets
Total claimed: 3,844,703

Game #1898 - Texas Lottery Gold ($20) => 15.26% chance of winnning something.
Total prizes: 1,623,768 of 5,196,058 tickets
Total claimed: 980,507

Game #2011 - $50 or $100 ($10) => 14.77% chance of winnning something.
Total prizes: 729,912 of 2,335,718 tickets
Total claimed: 451,717

Game #2000 - Dia De Los Muertos ($5) => 14.75% chance of winnning something.
Total prizes: 2,332,214 of 7,463,085 tickets
Total claimed: 1,444,568

Game #1881 - Texas A&M University ($1) => 13.95% chance of winnning something.
Total prizes: 1,719,902 of 5,503,686 tickets
Total claimed: 1,106,250

Game #1832 - $7,500,000 Ultimate Cash ($50) => 13.54% chance of winnning something.
Total prizes: 1,456,383 of 4,660,426 tickets
Total claimed: 954,541

Game #1842 - Explosión De Dinero ($10) => 13.50% chance of winnning something.
Total prizes: 1,679,265 of 5,373,648 tickets
Total claimed: 1,102,660

Game #1824 - 20X The Cash ($5) => 12.33% chance of winnning something.
Total prizes: 6,902,635 of 22,088,432 tickets
Total claimed: 4,767,448

Game #1868 - Bonus Cashword ($3) => 11.84% chance of winnning something.
Total prizes: 9,792,010 of 31,334,432 tickets
Total claimed: 6,898,963

Game #1870 - Ultimate Millions ($50) => 11.64% chance of winnning something.
Total prizes: 1,134,499 of 3,630,397 tickets
Total claimed: 805,716

Game #1888 - $75,000 Ca$h ($3) => 11.37% chance of winnning something.
Total prizes: 1,440,212 of 4,608,678 tickets
Total claimed: 1,033,642

Game #2006 - Holiday Wishes ($3) => 11.16% chance of winnning something.
Total prizes: 1,454,562 of 4,654,598 tickets
Total claimed: 1,052,391

Game #1830 - 50X Super Ticket ($10) => 10.92% chance of winnning something.
Total prizes: 2,976,332 of 9,524,262 tickets
Total claimed: 2,173,637

Game #2085 - Feliz Navidad ($2) => 10.81% chance of winnning something.
Total prizes: 1,095,094 of 3,504,301 tickets
Total claimed: 803,038

Game #1851 - Instant Riches ($5) => 10.71% chance of winnning something.
Total prizes: 2,080,429 of 6,657,373 tickets
Total claimed: 1,531,615

Game #1846 - Fast Cash Mulitplier ($5) => 10.59% chance of winnning something.
Total prizes: 1,730,775 of 5,538,480 tickets
Total claimed: 1,279,959

Game #1880 - The University of Texas ($1) => 10.05% chance of winnning something.
Total prizes: 1,743,664 of 5,579,725 tickets
Total claimed: 1,315,186

Game #2005 - Reindeer Riches ($1) => 9.69% chance of winnning something.
Total prizes: 1,931,198 of 6,179,834 tickets
Total claimed: 1,475,556

Game #1742 - Lucky 7 ($5) => 9.56% chance of winnning something.
Total prizes: 1,982,643 of 6,344,458 tickets
Total claimed: 1,521,609

Game #1840 - 7 ($5) => 8.18% chance of winnning something.
Total prizes: 2,038,429 of 6,522,973 tickets
Total claimed: 1,638,850

Game #1886 - $10, $20 Or $50! ($5) => 8.00% chance of winnning something.
Total prizes: 1,383,655 of 4,427,696 tickets
Total claimed: 1,118,965

Game #1853 - Money ($20) => 7.98% chance of winnning something.
Total prizes: 2,358,730 of 7,547,936 tickets
Total claimed: 1,908,871

Game #1793 - Weekly Grand ($2) => 6.43% chance of winnning something.
Total prizes: 9,632,688 of 30,824,602 tickets
Total claimed: 8,175,903

Game #1825 - 5X The Cash ($1) => 6.02% chance of winnning something.
Total prizes: 6,767,265 of 21,655,248 tickets
Total claimed: 5,814,104

Game #1854 - Lucky Symbols ($1) => 5.80% chance of winnning something.
Total prizes: 1,922,640 of 6,152,448 tickets
Total claimed: 1,662,302

Game #1843 - Instant Winnings ($1) => 5.64% chance of winnning something.
Total prizes: 2,568,852 of 8,220,326 tickets
Total claimed: 2,231,167

Game #1839 - Back To School Crossword ($3) => 4.25% chance of winnning something.
Total prizes: 2,224,927 of 7,119,766 tickets
Total claimed: 2,007,786

Game #2004 - Diamond Mine 9X ($5) => 4.21% chance of winnning something.
Total prizes: 2,001,166 of 6,403,731 tickets
Total claimed: 1,807,732

Game #1807 - Super Loteria ($5) => 3.92% chance of winnning something.
Total prizes: 10,831,708 of 34,661,466 tickets
Total claimed: 9,860,456

Game #1873 - Triple 777 ($2) => 3.79% chance of winnning something.
Total prizes: 1,762,412 of 5,639,718 tickets
Total claimed: 1,609,739

Game #1808 - Bonus Break the Bank ($5) => 2.90% chance of winnning something.
Total prizes: 4,272,241 of 13,671,171 tickets
Total claimed: 3,991,632

Game #1827 - 50X The Cash ($10) => 2.48% chance of winnning something.
Total prizes: 4,796,980 of 15,350,336 tickets
Total claimed: 4,528,610

Game #1829 - 100X The Cash ($20) => 1.81% chance of winnning something.
Total prizes: 3,203,167 of 10,250,134 tickets
Total claimed: 3,073,198

Game #1867 - Mega Loteria ($10) => 1.67% chance of winnning something.
Total prizes: 4,317,476 of 13,815,923 tickets
Total claimed: 4,155,768


* This data and its analysis are not intended to provide advice and should not be construed as a recommendation to buy lottery/scratch-off tickets.  Remember, it's still a gamble, and the odds are against you.

Analysis

The csv file includes one line for each game/prize combination.  For each, it tells us the number of winning tickets already collected since those are reported back to the TX lottery commission.  Unfortunately, we do not receive the number of losing tickets purchased, since the trash can doesn't report back to the TX lottery commission.

Using our earlier assumptions, and based on the information we can collect, we compute the number of total winning tickets minus the number of cashed winning tickets, divided by the total number of tickets minus the number of cached winning tickets.  This calculation is missing the subtraction of the total number of losing tickets in the denominator, but if we assume that all game tickets are purchased at the same rate, we can effectively ignore this.  Alternatively, we could assume a number of tickets purchased daily, and based on the game's start date, guess how many tickets have been played.

Flaws

This strategy may be easy to rely on, but it's definitely has it's flaws.  As of now, we are unable to count losing tickets effectively.  We also don't know the rate of play for each game or prize level/ticket price.  It's possible that the cheaper tickets are sold at a much more rapid rate than the $20 tickets.  That actually might be a safe assumption, but one that we'll have to table for the moment.

Expansion

Later on, I'd like to figure out a way to charting the # of winning tickets which could indicate the rate of ticket sales, maybe.  This again is a flawed assumption but perhaps looking at all this data together could prove to be useful.

If users reported when they played losing tickets for each game, our stats would be much better.  Consider a mobile app that users scanned the ticket's barcode, and reported on losers.  For their time and energy, they'd be given access to charts and graphs helping them pick better scratch-off games.

Based on previously stored data, try to see a trend in game length vs winning ticket redemptions.

And after compiling all the data, the best game might not be the one with the best probability but a combination of probability and trends.