Forty-five minutes before a nationally televised audience views the ceremonial unveiling of the NBA draft lottery’s results Tuesday, the actual ping-pong ball drawing will unfold in a separate room inside the Chicago Hilton.

Moderator Kiki VanDeWeghe, a team official from 14 franchises, select media members and an Ernst and Young lawyer will be present — stripped of communication devices such as cell phones, computers.

Fourteen ping-pong balls are placed into a hopper — each numbered 1-14. According to an internal memo, the ping-pong balls will already have been weighed, measured and certified by the firm Smart Play — a leading manufacturer of state lottery machines.

Four of those ping-pong balls will determine Zion Williamson’s new NBA home.

The No. 1 pick in the draft is determined by the drawing of the first four balls that spell out a number combination. There are 1,001 possible number combinations. One thousand of those combinations have a team assigned. One four-ball combination does not.

The Knicks, for example, will be assigned 140 different combinations (14 percent of 1,000) — which could be anything from 1-2-3-4 to 14-13-12-11, including any random sequence in between. If one of their combinations is drawn, they would win the first pick.

As it happens, 14 ping-pong balls are mixed in the lottery machine for 20 seconds and the first ball is drawn by by NBA events VP Lou DiSabatino. The machine is turned on for another 10 seconds to scramble the balls for the second withdrawal, another 10 seconds of mixing for the third ball and also the fourth ball.

The length of time the balls are mixed is monitored by a timekeeper who faces away from the machine and signals the operator when to stop.

The lucky team assigned to that first four-ball combination will win Williamson’s rights. If the four-ball combination comes up as the lone unassigned one, a do-over occurs.

After the first pick is assigned, four more drawn balls will determine the second pick. (A repeat team will force a do-over.) The machine will spit out four more balls for the third pick and again for the fourth pick. The rest of the draft will fall in order of worst won-loss record.

Darrington Hobson, of Ernst & Young, places correspondent team logos into an envelope and delivers it to the studio where deputy commissioner Mark Tatum will make the results public for millions of viewers. Neither Tatum nor the team reps on the dais are made aware of ping-pong ball results.

A video of the actual drawing is posted on the league’s website right after the 8:30 p.m. show.