03 February 2016

Shop Heroes - Opaque UI

Shop Heroes is an item-shop game released on mobile and Kongregate in mid 2014 by CloudCade. The gameplay consists of crafting equipment for heroes, who then go on quests to find materials, which are used to craft more equipment. Players can gather in Towns to share the costs incurred by leveling up buildings, which unlock more heroes and quests.

CloudCade advertise striving for useability and superior gameplay. I understand that when they launched Shop Heroes, they were still a small studio. But their UI needs more work: it has too many screens, too many taps to start an action, too much information, and fragmentation/duplicate information. Sometimes, information is not just missing or duplicated. It's purposefully hidden, misleading, or manipulative.

Manipulating emotions

An example of UI manipulating emotions is the Roulette, which gives players one random award among 12. The UI shows each award equally likely to happen - 1 in 12, or 8% each. Yet the actual chance of keys, gems, and blueprint fragments is less than 1%. Why raise players' hopes so high if it never delivers? So they get 10 seconds of fiero after 10 months of frustration? It's as if a slot machine displayed the jackpot symbol with the same chance as others, but was actually rigged to nearly never stop on it. The gambling industry actually forbids such machines. One could argue that the Roulette is a minor mechanic in Shop Heroes, and that players may understand that it's rigged. A sincere UI would make the area of a reward on the wheel proportional to its likelihood.

Hidding information

An example of UI purposefully hidding important information can be found in the screen where players build their quest teams. Players send heroes on quests dozens of times per day. When heroes are strong enough to tackle the quest, a green smiley is displayed above their head. When they are not strong enough, the smiley turns to yellow or red, showing that they are more likely to be injured. Injured heroes are unusable for several hours, so players strive for green smileys. But each of the 8 equipment slots of each hero has a 1-10% chance to break during a quest. Therefore players equip their heroes with just enough equipment to reach green smileys, so as to minimize the costs incurred by broken equipment.

Yet players noticed discrepancies in the odds of injury. They asked on the forum whether increasing power above green smiley reduces the chance of injury. The community manager did not answer clearly at first, saying it's fun for those playing to figure out, and that it's impossible to create a tutorial for every single detail in the game. Players replied that 1) they are not asking for a tutorial but for explicit numbers to be displayed, 2) core mechanics should not be hidden, and 3) discovering 1%-likelihood mechanics is annoying and time-consuming. The community manager eventually cleared the matter, but why was this important information not explicitly provided inside the game? The in-game UI should, and can, do a better job at displaying the chance of injury, however small it is. One way would be to display the green smiley only when the chance is exactly 0%. Another way would be to display the percentage number, rounded up (0.123% would be 1%). Providing feedback through numbers is the only way that hardcore players can theorycraft and reverse-engineer the most intricate mechanics.

27 January 2016

Powerball lottery - Boosting jackpots to boost sales

The January 2016 jackpot reached $1.5B because the carried-over jackpot increased faster than ever before in the streak of 19 drawings without winner. To show this, the table below compares the $1.5B jackpot to the $564M jackpot of February 2015, which concluded a streak of 20 drawings without winner.

StreakJackpot amount ($M)
Jan'16Feb'15
15255208
16300230
17334261
18529289
19948317
201,500395
21-564
StreakTickets sold (M)
Jan'16Feb'15
152624
164128
175429
1817637
1944048
2063573
21-190

The February 2015 jackpot reached half a billion dollars after 20 consecutive drawings without winner. The January 2016 jackpot reached three times that amount in one drawing less. In fact, it is surprising that the January 2016 jackpot could triple from $529M to $1.5B in two drawings. What happened?

Funding Powerball's jackpot

To understand how jackpots build up, we have to understand some of the inner workings of the Powerball lottery. The 2015 Powerball group rules published by the Multi-State Lottery Association (MUSL) managing Powerball are sometimes ambiguous, so this section may not be perfectly accurate. To keep it simple, the Power Play option is ignored.

Although MUSL runs Powerball, each state lottery is in charge of advertising, selling tickets, and giving non-jackpot prizes to their respective winners. Each state lottery keeps half of ticket sales, which probably directly goes into the state's budget. The other half funds MUSL's four accounts: the prize pool, jackpot pool, bootstrap pool, and reserve.

The prize pool (aka Powerball Set Prize Pool) is filled weekly by each state lottery to pay the small prizes. Ignoring Power Play, it should receive at least $4 / 38.32 + ... + $1M / 11.7M = 32 cents per ticket to be able to pay out the prizes. In-between two drawings, its balance is close to zero.

The jackpot pool (aka Grand Prize Pool) holds the jackpot money. When the other pools (usually the bootstrap pool) need to be topped-up, up to 5% of sales is transferred from it to them. By the time the jackpot reaches $110M annuity/$70M cash, ticket sales have filled all other pools, and the jackpot pool receives the full 68 cents per ticket.

The bootstrap pool (aka Set-Aside Account) backs up the jackpot pool when the jackpot is won at the beginning of a streak. For example, every streak starts with a jackpot of $40M annuity/$25M cash. These drawings usually sell 10 million tickets, ie $20M in sales. The state takes $10M, small prize winners $3.2M (32 cents per ticket), and so there is only $6.8M left to pay the $25M jackpot. The extra $18.2M comes from this pool. Fortunately, 10M tickets have only 4% chance to win the jackpot, so the bootstrap pool is rarely emptied. It is filled by "taxing" the jackpot pool 5% of sales, ie 10 cents per ticket, until it has reached its $20M cap.

The reserve (aka PRA and SPRA) exists so that MUSL does not get bad press for not paying winners their full prize. This could happen because of a system error, miscalculation, or because all other pools are depleted. When the reserve itself is depleted, prizes stop being fixed (eg $1M or $7) and become parimutuel to prevent breaking the bank. Until the reserve reaches its $40M cap, filling it takes precedence over the other pools.

January 2016 vs February 2015

To illustrate how these pools work, we can use the streak of 20 drawings leading to the jackpot of $1.5B annuity / $930M cash as an example. The streak starts on November 7, when 374k 2-dollar tickets and 101k 3-dollar tickets won small prizes. Ticket sales (estimated) are 24.87 * (374k * $2 + 101k * $3) = $26M. The state takes $13M, and small-prize winners $4M. Let's imagine that the reserve is full. The jackpot had reached $90M cash on November 4, so the bootstrap pool should be full, but to illustrate its workings, let's assume it is empty. Since the jackpot is not won, the bootstrap pool receives 5% of sales = $1.3M. The jackpot pool receives the remaining $7.7M. This process goes on until December 19, when the bootstrap pool reaches its $20M cap. All these numbers are listed in the first table below.

On closure day, January 13, when the $930M cash jackpot is won, the ten-week streak has raised a total of $3.4B. Around $623M has been paid to small-prize winners, $930M shared between the jackpot's three winners, and $1.7B kept by the states. As for the February 2015 jackpot, the states only received $679M in roughly the same amount of time (ten weeks and a half). Judging from these two jackpots only, the 2015 tweaks seem to have tripled Powerball's profits.

Pool amounts (in $M) leading to the $1.5B annuity jackpot
date jackpot
(cash)
ticket
sales
prize
pool
jackpot
pool
bootstrap
"tax"
bootstrap
pool
11/725264.27.61.31.3
11/1132223.0151.12.4
11/1438284.1231.43.8
11/1844247.7261.25.0
11/2150276.4321.36.3
11/2557283.1411.47.7
11/2863284.8491.49.1
12/269323.7591.610.7
12/580388.2681.912.6
12/991335.5781.714.3
12/12103387.4881.916.2
12/16113396.2992.018.2
12/19127519.61131.820
12/23143589.9132full20
12/26161546.3153full20
12/301898414181full20
1/221011821219full20
1/633337566341full20
1/9597963159663full20
1/139301,3742741,077full20
closure9303,4406230NA20
Pool amounts (in $M) leading to the $564M annuity jackpot
date jackpot
(cash)
ticket
sales
prize
pool
jackpot
pool
bootstrap
"tax"
bootstrap
pool
12/326222.27.71.11.1
12/633264.4151.32.4
12/1039254.1221.23.6
12/1346274.8291.35.0
12/1752254.4361.26.2
12/20593210.2401.67.8
12/2465359.2471.89.6
12/27723210.3511.611.1
12/3178388.4591.913.1
1/385354.6701.714.8
1/795355.0811.816.6
1/101054110.2902.118.6
1/14114387.01001.420
1/171264816108full20
1/211355212122full20
1/241506218135full20
1/281706011154full20
1/311887415176full20
2/420610018209full20
2/725715130255full20
2/1138140174381full20
closure3811,3582780NA20

The Powerball tweaks have only been implemented for three months now. With little data to rely on, it is not guaranteed that profits will stay triple what they were before. Profits may have soared this time because of the buzz surrounding the record-breaking jackpot. The next billion-dollar jackpot may see mediocre sales because people got tired of Powerball or found other games to play. Will the next billion-dollar jackpot generate a billion dollars in profits? Will players adapt to the new odds? We will probably find out within a year.

26 January 2016

Powerball lottery - Tweaks

The jackpot fatigue theory

The Powerball mechanics have been tweaked several times since it started in 1992. Starting in January 2012, the game had 59 white balls and 35 red balls so that a billion-dollar jackpot would happen every 10 years. No such jackpot happened until the rules changed again in 2015, but as the table below shows, the jackpot reached half a billion several times.

Jackpots above $300M, 2012-2015
Date Jackpot ($M) Tickets (M)
2/11/2012 336 89
8/15/2012 337 86
11/28/2012 588 286
3/23/2013 338 80
5/18/2013 591 243
9/18/2013 399 93
2/19/2014 425 86
2/11/2015 564 191
9/30/2015 310 51

Powerball sales dropped 19% nationally in 2014. Lottery officials suggested two explanations: the lack of a huge jackpot in 2014, and jackpot fatigue: lotteries need increasingly bigger jackpots to attract the casual players who only buy tickets when the jackpot is huge.

The table above confirms that there was only one jackpot above $300M in 2014, but it rejects the fatigue theory. For jackpots between $300M and $350M, the number of tickets sold decreased from 89M in 2012 to 51M in 2015. And for the three jackpots between $550M and $600M, the number of tickets sold went from 286M in 2012 to 191M in 2015. Sales from the biggest jackpots lost 35% in three years.

Yet, the fatigue theory made New York state lottery officials shift their focus from jackpot-driven games, where jackpots get very big too rarely, to instant scratch-off games with more frequent prizes. New York state is a major actor in the Powerball lottery: it ranks third in ticket sales, after California and Florida. So it's likely that the tweaks of October 2015 were an attempt to address jackpot fatigue.

October 2015 tweaks

In October 2015, white balls increased from 59 to 69, and red balls decreased from 35 to 26. Thus the odds of winning a prize increased from 1:32 to 1:25, but the odds of winning the jackpot decreased from 1:175M to 1:292M. Lower jackpot odds means longer streaks until the jackpot is won, ie bigger jackpots. Projections made in 2012 suggested that a billion-dollar jackpot would happen every 10 years. Data from November 2015 to January 2016 suggests that billion-dollar jackpots should now happen every year or so, and there is a 63% chance for one to show up within 5 years. This tweak is similar to the British National Lottery tweak of June 2015: 5 balls used to be picked among 49, which was raised to 59, resulting in the £58M jackpot of January 2016, the largest in the National Lottery's history.

Decreasing the odds of winning the jackpot decreases the expected value of a ticket. This expected value is plotted in the graph below, against the jackpot value. Before the rule change, the jackpot had to reach $200M for a ticket to be worth $1. Based on drawings data from 2015, $200M jackpots were expected to occur every 24 weeks. Now, after the rule change, a ticket is worth $1 when the jackpot reaches $450M, which is expected to happen every 34 weeks.

Long story short, the October 2015 tweaks increased the chance of winning a consolation prize, but decreased the chance of winning the jackpot and the expected value of a ticket. Since the expected value of a ticket estimates how much each lottery ticket costs to the organizers, their profits must have increased!

25 January 2016

Powerball lottery - Odds, expected value, and billion dollar jackpots

Basic odds and expected values

Wikipedia has a good introductory page about lottery mathematics. In short, the number of possibilities for drawing 5 white balls among 69 and one red ball among 26 is C(69,5) * C(26,1) = 292M. Despite these very low odds, 14 people won the jackpot in 2015, and 72 from 2011 to 2015. The chances of winning prizes are listed in the table below. The expected value column is the product of a prize by its odds.

Match Prize Value Odds Expected value
5 whites + red Jackpot $40M to $1.5B 1 in 292M = .00000034% $0.14 to $5.14
5 whites Match-5 $1M 1 in 11.7M = .0000085% $0.09
1-4 whites + red
or 3-4 whites
Consolation $4 to $50k 1 in 24.7 = 4.04% $0.24

The Powerplay mutliplier applies only to consolation prizes. Taking into account the probability of each multiplier, their expected value becomes $0.65. Power Play also doubles the Match-5 prize by 2, so the Match-5 expected value becomes $0.17. While Power Play does increase values, it does not increase them by enough to cover the $1 cost of the Power Play option. Power Play is not worth it.

Huge jackpots do not justify buying a ticket

Intuitively, the January 16 2015 jackpot of $1.5B is so huge that it may seem statistically worth it to buy a ticket: you spend $2 to receive $1.5B / 292M = $5.14. Each ticket would net $3.14. Put another way, one could earn $1.5B after investing 292M * $2 = $584M. The theory is promising, but it has flaws.

First, 635M tickets were sold. An alternative way to find this number is to mutliply the number of winners by the odds of winning: 26.11M * 24.87 = 650M tickets. Based on the method described here, there is an 89% chance that there is another winning ticket. More specifically, the chances of having exactly 0, 1, 2, 3, 4, and 5 winners among the 650M tickets already sold are 11, 25, 27, 19, 11, and 5%. Taking these probabilities into account, $5.14 becomes $5.14 * (11% / 1 + 25% / 2 + 27% / 3 + ... ) = $2.09. So, buying a Powerball ticket is still (barely) worth it. Second, there is a 40% federal income tax on lottery winnings. That brings it down to $1.26 per $2 ticket. Buying a ticket for the $1.5B jackpot is not statistically worth it anymore.

Last, all tickets have to be bought in person. Since Powerball drawings happen twice a week, one would have to buy 70M tickets per day, or 845 per second. CNN reports that in February 1992, an Australian consortium tried to corner a $24 million Virginia Lotto jackpot. But the group was only able to purchase 2.4 million of the 7 million combinations before time ran out.

Billion-dollar jackpots every year

Could the jackpot get big enough that buying a ticket will be statistically worth it? There is no data point after $1.5B, so we can't say. But we can compute the expected time until such a jackpot appears again.

First, For the jackpot to reach $1.5B after 20 drawings, all 957 million tickets from the previous 19 drawings had to be losers. That is a 4% chance. Then, we can adapt the coin-toss method, using ticket sales and jackpot values for the 20 drawings leading to the $1.5B jackpot, to compute the expected time until the jackpot reaches $1.5B. Unless my math is wrong, I found that the expected number of drawings to reach 19 consecutive drawings without winner is 421. With two drawings a week, that means a $1.5B jackpot should appear every 4 years. A billion-dollar jackpot requires 18 consecutive drawings without winner, which can be expected every year.

24 January 2016

Powerball lottery - Rules and patterns of play

On January 13 2016, the Powerball lottery made the news by reaching a jackpot of $1.5B, the largest in US history. Lotteries are interesting because they are a gambling game used by governments to raise funds without raising taxes. Let's have a closer look at the rules, odds, and profits made by lotteries, using Powerball as an example since it's one of the lotteries with highest sales.

Basics

The official simplified rules stipulate that five white balls are drawn among 69, and one red ball among 26. The jackpot is won by matching all five white balls in any order and the red Powerball. The jackpot starts at $40M, and increases every drawing by at least $10M until won. Combined with the minuscule odds of being won, this mechanic makes it possible for the jackpot to become huge. The match-5 prize, worth $1 million, is won by matching five white balls in any order. Consolation prizes, worth $4 to $50k, are won by matching at least three white balls or at least the red Powerball. Tickets cost $2. Players can buy as many tickets as they want.

Drawings happen twice a week, on Wednesdays and Saturdays. The boxplot below plots the median number of tickets sold per drawing. Data consists of drawings with jackpots below $200M, from April 13 2013 (right after California joined the Powerball group) to January 20 2016. Drawings sell an average of 14.0 million tickets on Wednesdays, versus 15.4 millions on Saturdays (p=.0001).

Jackpots predict sales

Ticket sales are very predictable from the jackpot amount. This is shown in the graph below. For jackpots under $300M, the number of tickets sold increases quadratically with the jackpot. Above $300M, we do not have enough data to build a model, but the trend seems logarithmic, probably because ticket sales grow much faster than the jackpot.

Optional features

Power Play is an optional feature that launched in 2001. As of 2015, it multiplies the value of non-jackpot winnings by 2 to 10 by paying an extra $1 per ticket. A wheel determines the multiplier for each drawing (24/43 chance for 2x down to 1/43 for 10x). Interestingly, Power Play used to have a 1x multiplier, but it was removed within a year. Why have a bonus that is sometimes not a bonus?

Random picks: Players can choose their 6 numbers themselves, or have the computer pick them randomly. About 70% to 80% of purchases are computer picks.

Annuity vs cash

Jackpot winners can choose to receive their share of the jackpot immediately through a 30-year annuity, or immediately in cash. When winners choose the cash, they immediately receive the advertised cash amount, which is usually 60-70% the annuity amount. That is why the lottery organizers advertise the jackpot's annuity, and not its cash.

When winners choose the annuity, they immediately receive 1/30th of the cash amount. The organizers invest the rest into government bonds or securities. Every year for 29 years, they sell 1/29th of the bonds and give the proceeds to the winner, with a 5%-interest per year. Choosing the annuity prevents people from blowing through all their money quickly. Yet only one jackpot winner out of 72 chose the 30-year annuity from 2011 to 2015.