# True 2019 NBA Lottery Odds

Every year the NBA draft lottery takes place in May and every year websites race to get up probabilities of which team has the probability to get a certain spot within the lottery. Many times, unfortunately, these sites forget about trades and instead of conveying the probabilities to the truth, the trades are instead wasted away in series of notes, effectively telling the reader to “figure it out, dummy.” So, how do we figure out the true probabilities of a team obtaining a particular pick?

Two years ago, I posted a basic algorithm that counts every probability of every pick without any trades. This algorithm is able to easily recreate the table we find in Wikipedia, and other sites, when it comes to finding a probability matrix for teams:

NBA Draft lottery odds from Wikipedia (April 30th, 2019).

Using our aforementioned post, I was able to reconstruct the entire draft lottery algorithm and produce this table within five minutes. Sweet! The code still works! However, these are not the true probabilities for each team thanks to trades made over the previous years. Therefore, other tables that we find on sites like ESPN, HoopsRumors, and even Wikipedia post the incorrect probabilities:

In all cases the trades were either hyperlinked or stuffed within text, forcing the reader to search for context. This season, the trades are rather tame as there are no “pick swap” trades: trades where a team gets the “better” of two picks, contained within the lottery. The closest we get is the Sacramento to Philadelphia/Boston pick swap. Due to this tameness, teams effectively trade probabilities. So we can give a pass to the Sacramento Kings having a 1% chance of obtaining the first pick. In reality, it’s zero as Philadelphia owns their number one pick.

This is okay, but it requires the reader to search.

But what about Atlanta? Atlanta actually has a 47.02% chance of obtaining the 9th overall pick. That’s thanks to the Trae Young – Luka Doncic draft night deal. And while Dallas has asterisks next to their odds, it’s Atlanta that doesn’t have any indication.

Similarly, Boston has two trades lingering in the draft. They have interesting probabilities floating about the table as well. But that’s not readily apparent either. So let’s incorporate the trades and then update this table. Thanks to Real GM, we are able to turn these trades into code.

## Trade #1: Atlanta Gains 6-14 From Dallas

From the draft night trade in the 2018 Draft, the Atlanta Hawks managed to move down in the draft in order to allow Dallas to guarantee the rights to Luka Doncic. In order to complete this trade and incentivize Atlanta moving down in the lottery, Atlanta gained a pick-protected lottery pick for this season. That is, if Dallas falls between the 6th and 14th picks, Atlanta gains the Mavericks’ lottery pick. We can represent this code (using the variables from our previous lottery odds post) as:

Atlanta is listed as 5th in the lottery and Dallas is listed as 9th per the NBA. Therefore, under Python indices, they are 4th and 8th, respectively.

As a reminder: remainingProbs is a fixed-draw double array that simply aligns the teams that were not selected in the first four picks. There are a total of ten of these positions: picks 5 through 14. Since pick 5 is protected, we count the last nine spots.

## Trade #2: Boston Gains 9-14 From Memphis

On January 12, 2015 a three-team trade involving five players and three draft picks took place between the Boston Celtics, Memphis Grizzlies, and New Orleans Pelicans. In this trade, Memphis sent Tayshaun Prince to Boston and Quincy Pondexter to New Orleans. In return, New Orleans sent Russ Smith and a traded player exception to Memphis and Boston sent Jeff Green (the centerpiece of the deal) to Memphis. In the process, Boston also obtained Austin Rivers from New Orleans.

To soften the loss of Green, Memphis included a protected future first round pick to Boston. Similarly, to help address the loss of Rivers from New Orleans Memphis included a second round pick to the Pelicans. This season, that first round pick comes into play as Memphis is slotted as the 8 team; with highest probability of keeping their pick. Despite this, Boston still has a significant chance of nabbing the Memphis pick, provided Memphis hits that unlucky 42.6% chance of getting the 9th, 10th, or 11th pick in the draft.

Due to the straightforward nature of the trade, we can easily code this as:

Memphis is listed as 8th in the lottery per the NBA. Therefore, under Python indices, they are 7th. Boston is not in the lottery, they are the first new team: 14.

Known as the “Stauskas Trade” back on July 9, 2015, the Sacramento Kings shipped Nik Stauskas, Carl Landry, Jason Thompson, and two future first round picks for the rights to Arturas Gudaitis and Luka Mitrovic. The move for the Kings was essentially to clear cap space for the 2015-16 NBA season in an attempt to Rajon Rondo, Marco Belinelli, and Kosta Koufos.  For the future first round draft picks, a series of pick protections were placed on the 2017 and 2018 draft picks. If those protections were satisfied for Sacramento, then Sacramento’s 2019 first round draft pick went to Philadelphia.

In those years, theKings managed to keep their picks.

Despite this…

…on June 19th, 2017 the Philadelphia 76ers traded their rights to Sacramento’s 2019 first round pick to the Boston Celtics when they made the move from 3rd in the 2017 draft to 1st. It was part of a conditional trade where Boston gained the 2019 Sacramento pick as long as the Los Angeles Lakers’ 2018 Draft pick landed between 2nd and 5th. That draft pick landed 10th and Boston become owner of Sacramento’s 2019 Draft Pick, protected as number one.

To this end, we code this trade as:

## Resulting Probabilities

Applying these trades as a Python script, we are able to generate the probabilities for every team in the draft of obtaining a lottery pick:

Here, we see Sacramento is completely wiped off the map. Here we also see the updated probabilities for Atlanta as well as the illustrated potential of Memphis possibly losing their pick.

This year is a relatively straightforward year when it comes to lottery trades. But at least know how to handle them within our code, as we can visually see everyone’s probabilities. Come May 14th, you now know the true probabilities for your team.