The Heat enters the final weekend of the regular season and the play-in with anywhere from an extremely slim to a nearly 10 percent chance of snagging a top four pick in a talent-rich draft.

Where Miami lands will be dictated by the results of a potential random drawing and the results of games involving the Heat, Charlotte Hornets, Los Angeles Clippers, Portland Trail Blazers, Phoenix Suns and Golden State Warriors.

The Heat (42-39) is currently slotted 13th, which would give the Heat a 1 percent chance of landing the top pick in the May 10 draft lottery, and a 4.8 percent chance of securing a top four pick.

But much could change before the lottery order is determined.

For the Heat to have the best possible odds of a top four pick, Miami would need to emerge 11th in the lottery standings, meaning having the fourth-best regular season record among teams not advancing to the playoffs. That 11th slot would mean close to a 2 percent chance of landing the top pick and a 7.1 percent to 9.4 percent chance of a top four pick, with that percentage depending on the record of the other play-in teams that miss the playoffs.

Here’s the most realistic path of what would be needed for the Heat to slot 11th:

â–ª The Heat would need to lose its regular season finale at home against Atlanta and then lose in the play-in tournament.

â–ª The Clippers would need to win at home against Golden State on Sunday. If the Clippers win and Heat loses, both teams would finish 42-40, and a random drawing in the next two weeks would determine which team has the higher draft slot heading into the lottery.

â–ª Portland would need to win at home against Sacramento on Sunday. If the Blazers win and Heat loses, both teams would finish 42-40 and a random drawing would determine which team has the higher draft slot heading into the lottery.

â–ª Golden State would need to advance from the play-in to the playoffs.

If all of the above happen – including Miami winning random drawings with the Clippers and Portland but losing in the play-in — then the Heat would be assured of entering the lottery in the 11th slot because it would have the fourth best record among teams that don’t make the playoffs.

If the above plays out and Miami loses random drawings against the Clippers and Portland, then Miami could still move as high as 12th if the Phoenix Suns lose in the play-in. In that scenario, Miami would be 12th because the Suns and whatever other East team loses in the play-in would have better records than Miami and pick 13th and 14th.

But here’s the catch: While random drawing determines who would pick in what order if none of the these teams get lucky in the lottery, the Heat, Clippers and Portland would have roughly the same odds of landing a top four pick (7.1 %) if they finish with the same record. That’s because the NBA doesn’t want to give one team a clear advantage over the other team in terms of chances of moving into the top four.

In the event of a tie, the NBA merges the ping-pong ball combinations assigned to those specific seeds and divides them as evenly as possible among the tied teams.

If the Heat beats Atlanta and Charlotte loses at the Knicks, Miami would slot 12th in the lottery if Phoenix and either Philadelphia or Orlando misses the playoffs and Charlotte makes the playoffs.

But Miami would pick 14th if it has the best record among non-playoff teams. The 14th lottery seed has only a 0.5 percent chance of landing the top pick and a 2.4 percent chance of securing a top four pick.

But that scenario (Heat winning Sunday, Charlotte losing Sunday) also would give the Heat a home game against Charlotte in the 9-10 play-in game on Tuesday or Wednesday. Otherwise, Miami would play at Charlotte in that 9-10 game.

The loser of the Heat-Hornets 9-10 game would be eliminated and the winner would advance to play the loser of the 7-8 game (likely Orlando against Philadelphia) on Friday.

The winner of that Friday game would advance to play Detroit in the first round of the playoffs and would not participate in the draft lottery.

The NBA lottery determines the order of the top four picks. So heading into Sunday, Miami can pick only first, second, third, fourth, 11th, 12th, 13th or 14th in the first round of the June 24 draft.

â–ª The Heat also will select 41st overall, in the second round — a pick that originally was owned by Golden State but is now owned by Charlotte. That pick was awarded to the Heat as compensation for Miami acquiring Terry Rozier from the Hornets while he was under FBI investigation.