Tennis Player’s Dilemma

An upcoming tennis player can win a prize if she wins two consecutive matches in a three-game series against the #1 and #2 players alternately. She can choose either of the matchups: 121 or 212. Which scheme has a better chance of winning the prize?

Let p1 be her chance to defeat #1 and p2 to beat #2; p1 < p2 (#1 is a better player than #2).

Matchup 121

The probability of winning two consecutive matches in the 121 scheme is: p1 x p2 x p1 + p1 x p2 x (1-p1) + (1-p1) x p2 x p1 = p1p2(2 – p1)

Matchup 212

The probability of winning two consecutive matches in the 212 scheme is: p2 x p1 x p2 + p2 x p1 x (1-p2) + (1-p2) x p1 x p2 = p1p2(2 – p2)

Therefore, it reduces to a comparison bewteen p1p2(2 – p1) vs p1p2(2 – p2) or (2-p1) vs (2-p2).

Since p1 < p2, (2-p1) > (2-p2). So she must go for matchup 121.

Reference

Fifty Challenging Problems In Probability: Frederick Mosteller

Tennis Player’s Dilemma Read More »

Flippant Juror Problem

There are two systems of the jury. The first is a 1-member jury with a probability p to deliver the correct verdict. The second system is a 3-member jury that works on majority (at least 2) decisions to win. The two members each have an independent probability, p, for making the correct decision, and the third juror flips a coin and decides. Which jury has a better chance of making the right decisions?

Take the case of the 3-member jury:

The probability of getting the majority right = P(all three right) + P(first two correct AND third wrong) + P(first and third right AND second wrong) + P(second and third right AND first wrong)

= p x p x 1/2 + p x p x 1/2 + p x 1/2 x (1-p) + p x 1/2 x (1-p)

= (1/2) x (p2 + p2 + p – p2 + p – p2)

= 2p/2 = p = probability of 1-member jury to make the correct decision.

Flippant Juror Problem Read More »

Cardano’s Games of Chance

How many throws of a fair are required to have an even chance of at least one six?

Let’s break down the problem. 1) The probability of at least one six in n throws is (1 – the probability of getting no sixes in n throws). It is 1 – (5/6)n. 2) Even chance means 0.5. By combining the two pieces of information:

1 – (5/6)n = 0.5

Taking logs on both sides,

n ln (5/6) = ln(1/2)
n = ln(1/2)/ln (5/6) = 3.8

So, four throws.

Cardano’s Games of Chance Read More »

Newton-Pepys Problem

Ana, Betty and Carol are doing a competition. Ana can throw a die six times and aims to get at least one ‘6’. Betty can throw twelve times but needs to get at least two 6s. Carol has eighteen chances to get at least 3. Who has a better chance of winning the competition?

Let’s calculate the chances of each using binomial trials.

the probability of s successes in n rounds is nCs x ps x q(n-s)

Ana’s chances

The probability of getting at least one 6 in 6 tries is (1 – the probability of getting no success)

1 – 6C0 x (1/6) 0 x (5/6)(6-0) = 0.665

Betty’s chances

The probability of getting at least two 6s in 12 tries is (1 – the probability of getting no success – the probability of getting one success).

1 – 12C0 x (1/6) 0 x (5/6)(12-0)12C1 x (1/6) 1 x (5/6)(12-1) = 0.619

Carol’s chances

The probability of getting at least three 6s in 18 tries is (1 – the probability of getting no success – the probability of getting one success – the probability of getting two success).

1 – 18C0 x (1/6) 0 x (5/6)(18-0)18C1 x (1/6) 1 x (5/6)(18-1)18C2 x (1/6) 2 x (5/6)(18-2) = 0.597

Newton-Pepys Problem Read More »

Park Run Bingo

Suppose Ana wants to participate in a park run bingo – a version of what is known as stop-watch bingo – how many weekends is she expected to run to tick off the whole card?

In a stopwatch bingo, one tick off on the card, the digits (00-59), the seconds that show up on the watch. So for a weekly park run, it could be the seconds of the final timing recorded by the organiser. Notice if you take down timings from your watch, it becomes challenging to maintain randomness.

If you apply the formulation that we did in the earlier post, you get,

E(T) = 60*[1 + \frac{1}{2} + \frac{1}{3} + ... + \frac{1}{60}]

nn <- 60
run.sum <- rep(0, nn)
run.sum[1] <- 1.0
for(i in 2:nn){
current = nn/(nn - i +1)
run.sum[i] <- run.sum[i-1] + current
}
run.sum[nn]

The answer is 281.

You can see from the graph that by about 50 runs, you could be getting close to 40 unique numbers; it then becomes difficult to avoid duplications.

The Coupon Collector’s Problem: Stand-up Maths

Coupon collector’s problem: Wiki

Park Run Bingo Read More »

NBA Draft Lottery – More Stats

Having seen the probability of winning the lottery picks in the NBA, it would be interesting to see how fortune has favoured the teams historically. Last year (2022), the top four went to, respectively, Magic (2nd), Okc (4th), Rockets (1st) and Kings (7th). So, the number 7 got a lift of 3 places and reached inside top 4. It’s a coincidence that the 7th team has been in the lottery pick every year since 2018! Well, the odds of the 7th team getting inside the lottery (top 3 then) had been 16% in 2018 and 32% since then.

But how many times the first draw has gone to the top 1 team (i.e., the last one of the regular season)? Here is the graph summarising the statistics from 1985 through 2022.

Here ‘1’ means if the first team got the first pick and ‘0’ otherwise.

Note that the probability for the first team to come first in the lottery has changed over the year – 14.29 in the first four years, followed by 11.11 for a year, then 16.7, 25 for a long time until the latest 14% since 2019. Considering all these, the average probability of winning first is 21.48%. And the eight winners in the last 38 years suggest the actual data stands at 21%!

In 1993, the Orlando Magic got the first pick, whereas its pre-lottery chance was merely 1.52%. Similar things happened in 2008 (1.70%, Chicago Bulls) and 2014 (1.70%, Cleveland Cavaliers). The Cavaliers have more instances of luck, where they got Kyrie traded from the Clippers in 2011, where the latter had a 2.8% chance to win the first draw, and the ultimate price, Lebron James in 2003, where they were indeed the first one on the list!

References

NBA Draft Lottery History: Real GM
Tanking Won’t Die in the New NBA Draft Lottery System: The Ringer
NBA Draft Lottery: NBA
Top 5 NBA Draft Lottery Miracles: NBC

NBA Draft Lottery – More Stats Read More »

Flipping Biased Coins

After a break, we are back with coin-flipping games. Here is the first – A biased coin produces heads 70% of the time. You toss the coin twice. If both tosses have the same outcome, what is the probability that both tosses are tails?

Let’s apply the general form of Bayes’ equation straightaway.

P(TT|Same) = \frac{P(Same|TT) * P(TT)}{P(Same|TT) * P(TT) + P(Same|HT) * P(HT) + P(Same|TH) * P(TH) + P(Same|HH) * P(HH)} \\ \\ =  \frac{1 * 0.3*0.3}{1 * 0.3*0.3 + 0 + 0 + 1 * 0.7*0.7} = \frac{0.09}{0.58} = 0.155 \\ \\

Second one: there are two kinds of coins in a box in equal numbers – fair coins and the biased coins of the previous type (70% heads). You randomly select one and flip it twice. If it lands tails on both occasions, What is the probability that the coin is biased?

P(Biased|TT) = \frac{P(TT|Biased) * P(Biased)}{P(TT|Biased) * P(Biased) + P(TT|NOT-Biased) * P(NOT-Biased)} \\ \\ =  \frac{0.3*0.3*0.5}{0.3*0.3*0.5+ 0.5*0.5*0.5} = \frac{0.045}{0.17} = 0.265 \\ \\

Flipping Biased Coins Read More »

The Coupon Collector Problem

Imagine that a person wants to collect coupons that come along with a product. Each product pack can contain one of the ten types of coupons, and her goal is to accumulate all of them. The question is: how many packets does she need to open to get all ten coupons?

Remember the post on expected waiting time? It says: if something has a probability p to occur, the amount of time you wait 1/p. It is the expected waiting time. So, start our problem in steps.

The probability of getting a new coupon from the first purchase is 10/10 = 1. The expected time or the number of packets to open is 1/1 = 1, which is not surprising. Note that it is a problem with replacement, i.e., the same type of coupon can come again. What is the probability of getting a new card the next time? It’s given by dividing the number of ‘not-yet-collected’ coupons / by the total number of coupons = 9/10. Naturally, the expected time gets longer = 10/9. Finally, when you got everything but the last, it requires 10/1 or ten purchases for the elusive one!

The total time required is the time to get the first coupon + the additional time for the second + third + … 10. It is 1 + 10/9 + 10/8 + 10/7 + 10/6 + 10/5 + 10/4 + 10/3 + 10/2 + 10/1 = 10 (1/10 + 1/9 + …. 1). Rearranging this will make it familiar: 10 (1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6 + 1/7 + 1/8 + 1/9 + 1/10).

In general, for N coupons, it becomes N x (1 + 1/2 + …. 1/N) = N x HN. And HN is the Nth Harmonic number. From the wiki, the approximation for the sum equals,

\\ E(T) = N * H_N = N*ln(N) + \gamma*N + 1/2 + O(1/N)\\ \\ \gamma = 0.577

So, for the 10-coupon problem. she may be purchasing, on average, 29 packs of the product!

Coupon collector’s problem: Wiki

The Coupon Collector Problem Read More »

NBA Draft – Probabilities

Now that you know the probabilities given to the fourteen teams and how the lottery system works, what are the chances that team number 1 gets the lottery?

Getting first

What is the probability of team number 1 (the team with the worst performance in the regular season) getting the lottery in the first draw?

P_1 = 140/1000 = 0.14

Getting second

What is the probability that Team 1 gets lucky in the second draw? Well, it is the joint probability that another team (i) obtains the first draw AND team 1 gets the second.

P_1(2) = P_i(1) * \frac{140}{1000-X} = \frac{X}{1000} *  \frac{140}{1000-X}

Notice X, the number of combinations allocated to team ‘i’ that won the first, will not be available for the second lot, and, therefore, you subtract from 1000. And remember, ‘i’ varies from 2 to 14 (all squads other than Team 1). So, you estimate the joint probability with each of them and add them up. Rearrange terms and sum it over ‘i’,

P_1(2) =\sum\limits_{i=2}^{14} \frac{140}{1000} * \frac{X}{1000-X} = \sum\limits_{i=2}^{14} P_1 \frac{P_i}{1-P_i} =  P_1 \sum\limits_{i=2}^{14} \frac{P_i}{1-P_i}

Let’s estimate the value using the R code:

prob_value <- c(0.14, 0.14, 0.14, 0.125, 0.105, 0.09, 0.075, 0.06, 0.045, 0.03, 0.02, 0.015, 0.01, 0.005)
prob.sum = 0
for(i in 2:14){
    current = prob_value[i]/(1-prob_value[i])
    prob.sum = prob.sum + current
}
prob.sum*prob_value[1]

The answer is 0.1341732. The probability of team 1 getting lucky in the first two draws = 0.14 + 0.1341732 = 27%

Getting third

Extending the same logic, the probability for Team 1 to get the third lot is

\\ P_1(3) = P_i(1) * P_j(2) * \frac{140}{1000-X-Y} = \frac{X}{1000} *  \frac{Y}{1000-X}  * \frac{140}{1000-X-Y}  \\ \\  P_1(3) = \mathop{\sum\sum} \frac{140}{1000} * \frac{X}{1000-X} * \frac{Y}{1000-X-Y} \\ \\  P_1(3) = \mathop{\sum\sum}\limits_{i\neq j \neq 1} P_1 * \frac{P_i}{1-P_i} * \frac{P_j}{1-P_i-P_j}

prob_value  <- c(0.14, 0.14, 0.14, 0.125, 0.105, 0.09, 0.075, 0.06, 0.045, 0.03, 0.02, 0.015, 0.01, 0.005)
prob.sum = 0
for(i in 2:14){
  for(j in 2:14){
    if(i != j){
          prob.sum =  prob.sum + prob_value[i]*prob_value[j]/ ((1-prob_value[i]) * (1-prob_value[i]-prob_value[j]))
      }
     }  
  }
prob.sum*prob_value[1]

0.1274865. So, for team 1 getting in the first three draws = 0.14 + 0.1341732 + 0.1274865 = 40 %

Getting fourth (final)

\\ P_1(4) = P_i(1) * P_j(2) * P_k(3) \frac{140}{1000-X-Y-Z} = \frac{X}{1000} *  \frac{Y}{1000-X}  * \frac{Z}{1000-X-Y}  * \frac{140}{1000-X-Y-Z}\\ \\ P_1(4) = \mathop{\sum\sum\sum}\limits_{i \neq j \neq k \neq 1} P_1 * \frac{P_i}{1-P_i} * \frac{P_j}{1-P_i-P_j} \frac{P_k}{1-P_i-P_j-P_k}

prob_value <- c(0.14, 0.14, 0.14, 0.125, 0.105, 0.09, 0.075, 0.06, 0.045, 0.03, 0.02, 0.015, 0.01, 0.005)
prob.sum = 0
for(i in 2:14){
  for(j in 2:14){
    for(k in 2:14){
          if(j != k){
            if(i != j){
              if(i != k){
    current = (prob_value[i]/(1-prob_value[i])) * (prob_value[j]/(1-prob_value[i]-prob_value[j])) * (prob_value[k]/(1-prob_value[i]-prob_value[j]-prob_value[k]))
    prob.sum = prob.sum + current              
              }
  
          }
    }
      }  
  }
}
prob.sum*prob_value[1]

0.1197205. So, for team 1 getting one of the lotteries = 0.14 + 0.1341732 + 0.1274865 + 0.1197205 = 52.1 %

NBA Draft – Probabilities Read More »

NBA Draft – The Lottery

Now, the lottery. Fourteen ping pong balls – numbered 1 through 14 – are placed in a glass drum and well mixed for 20 seconds. Four balls are collected from the mix at ten second-intervals. So why 14 balls? The clue: it is not related to the 14 teams that are participating in the draw! But it has to do with statistics – Four balls, picked randomly from fourteen balls, gives a total combination of about 1000.

_{14}C_4 = \frac{14!}{4! 10!} = \frac{14 * 13 * 12 * 11}{4*3*2} = 77 * 13 = 1001

Each team gets a list of four-ball combinations (the look-up table) based on their assigned probability, as seen in the earlier post. E.g., Pistons, Rockets and Spurs get 140 numbers, the Hornets receive 125, Pelicans 5 etc.

Here is the list of the first 140 numbers generated by the R command, combinations(14,4)[1:140,]. It is just an illustration, and I am not sure if NBA assigns numbers in this order.

Once the team that qualified for the first draft is determined, the lottery is repeated. If a combination corresponding to the already selected team comes up in the draw again, the machine will be reset for another try.

References

2022 NBA Draft Lottery Presented By State Farm: NBA
The room where it happens: Behind the scenes at the NBA Draft lottery: The Athletic
How NBA Draft Lottery Probabilities Are Constructed: Squared Statistics
Nervous energy, phone withdrawal and a waiting period: Inside the 2022 NBA Draft Lottery drawing room

NBA Draft – The Lottery Read More »