All

Banzhaf Power Index

Let’s continue from the previous voting weights of five shareholders. This time, we calculate the power in the weighted voting system and determine the critical players. We use R functions to simplify the work. But first, the voting system:
[51: 15, 25, 10, 30, 20]
The shorthand notation indicates that 51% is required to reach the quota, and the players 1 to 5 have 15%, 25%, 10%, 30%, and 20% voting weights, respectively.

The calculation of the Banzhaf Power Index is as follows.

  1. List all winning coalitions
  2. In each collision, identify the critical players
  3. Count how many times each player is critical
  4. Convert these counts to fractions by dividing them by how many times any player is critical.

All coalitions

Following are all the two-player combinations

combinations(n = 5, r = 2, v = c("P1", "P2", "P3", "P4", "P5"))
      [,1] [,2]
 [1,] "P1" "P2"
 [2,] "P1" "P3"
 [3,] "P1" "P4"
 [4,] "P1" "P5"
 [5,] "P2" "P3"
 [6,] "P2" "P4"
 [7,] "P2" "P5"
 [8,] "P3" "P4"
 [9,] "P3" "P5"
[10,] "P4" "P5"

And their weights,

PP <- c(15, 25, 10, 30, 20)
PP_Comb <- combinations(n = 5, r = 2, v = PP, set = FALSE)
P2_Comb <- as.data.frame(PP_Comb) 
P2_Comb$Sum <- rowSums(PP_Comb) 
PlayerPlayerTotal WeightWinning
Coalition
152540NO
151025NO
153045NO
152035NO
251035NO
253055NO
252045NO
103040NO
102030NO
302050NO

We’ll continue with the other player combinations in the next post.

Banzhaf Power Index Read More »

Weighted Voting

Weighted voting is a concept in which voters with different numbers of votes or influences determine the outcome of an election. The more votes someone holds, the more weight she gets in deciding the result. A simple example is a shareholder meeting where 51% of votes are required to settle a decision. Five shareholders hold 15%, 25%, 10%, 30%, and 20% of the total shares. Each of the shareholders gets a weightage corresponding to the shares they hold.

A: 15%
B: 25%
C: 10%
D: 30%
E: 20%
In the above example, Player D gets the highest weight, and Player C has the lowest. Quota is the minimum weight required to pass the election. And in our case, the quota is 51%.

If q represents the quota, w1, w2, etc., denotes the weight of player 1, player 2, etc., then the shorthand notation of the voting system is written as:
[q: w1, w2, w3, w4, w5]

In our example, it is
[51: 15, 25, 10, 30, 20]

Dictator: When one entity has a weight equal to or more than the quota. There is no dictator in [51: 15, 25, 10, 30, 20], but the third entity is a dictator in [51: 10, 20, 52, 18]. A dictator can pass or block any resolution, and nobody can win a vote without the dictator.

A player has veto power if her support is necessary to reach the quota. In [10: 6, 5, 4], player 2 and player 3 can only get the quota with support from player 1. Player 1 has veto power. On the other hand, player 2 or player 3 has no veto power. No one has veto power in [10, 6, 5, 7].

A player is a dummy if her vote is never essential for a group to reach quota. Player 3 is a dummy in [10: 7, 4, 2].

Weighted Voting Read More »

Airport Problem and the Shapley Solution

Here is how we apply the concept of Shapley Values to the famous airport problem.
Suppose an airport wants to build a runway to support three airline companies. Here are the requirements for each company:
Airline 1: 1500 m
Airline 2: 2200 m
Airline 3: 3000 m
Assume the cost per m of runway construction is $1k. How must the airport split costs among the three airline companies fairly?

Proportional rule

The simplest way is to split the cost proportional to the length each airliner needs, i.e., you divide the total cost proportional to the runway requirements as:

Airline 1: 3000 x 1500 / (1500 + 2200 + 3000 ) = 672k
Airline 2: 3000 x 2200 / (1500 + 2200 + 3000 ) = 985k
Airline 3: 3000 x 3000 / (1500 + 2200 + 3000 ) = 1343k

Is it a fair division? It seems so. But what happens if Airline 3 comes up with a variation, say, change to 3500? The new contributions get modified to:
Airline 1: 729k
Airline 2: 1069k
Airline 3: 1701k

Suddenly, this seems unfair for Airlines 1 and 2 as the new plan only benefits the third one, but the others also bear the extra costs (729 – 672) and (1069 – 985), respectively. So, we try the Shapley values:

Shapley value

We have seen how it works in the previous post. Let’s build the table first for case 1.

C(1500, 2200, 3000)

Combination 123
1231500700800
132150001500
23102200800
21302200800
312003000
321003000
Average3000/6
= 500
5100/6
= 850
9900/6
= 1650

And for case 2, C(1500, 2200, 3500):

Combination 123
12315007001300
132150002000
231022001300
213022001300
312003500
321003500
Average3000/6
= 500
5100/6
= 850
12900/6
= 2150

Case 1:
Shapley value Airline 1 = 500
Shapley value Airline 2 = 850
Shapley value Airline 3 = 1650

Case 2:
Shapley value Airline 1 = 500
Shapley value Airline 2 = 850
Shapley value Airline 3 = 2150

The game theory solution does not penalise the first two airlines and only demands the third one to pay for the scope change.

Airport Problem and the Shapley Solution Read More »

Shapley Value

Three people – Andy, Bichel and Carol decided to share a taxi to reach their homes. Andy will get down first, where the taxi fare if travelled alone, would have been $5; Bichel should have paid $10 and Carol 25. How should they divide the taxi fair?

It does not make sense, Andy – $5, Bichel $10 and Carol $25 as it would mean paying $40 for the taxi!
It’s not fair on Andy if he is asked to pay 5, Bichel 5 (10-5, marginal fare) and Carol 15 (25 -10).

Lloyd Shapley introduced a concept known as the Shapley Value, based on the notion of fairness to divide the payoff among all the coalition members.

The Shapley value is the average of marginal contributions of all the permutations of the three individuals. First, how many permutations are possible? It is 3! or 6.

ABC
ACB
BCA
BAC
CAB
CBA

The marginal contribution is calculated assuming A, B, and C came to the coalition in that order. ABC implies A comes first and pays 5, B comes then and pays his fare minus (-) what is already paid (10-5), and C pays 25 – 10. In the same way, CAB means C pays 25, A pays 0, and B pays 0. Let’s tabulate the marginal contributions.

Combination ABC
ABC5515
ACB5020
BCA01015
BAC01015
CAB0025
CBA0025
Average10/6
= 1.67
25/6
= 4.17
115/6
19.17

The Shapley value of Andy is $1.67
The Shapley value of Bichel is $4.17
The Shapley value of Carol is $19.17
If you add all the contributions up, you get $25.

Shapley Value Read More »

Monthly Miracle

During the time that we are awake and actively engaged in living our lives, roughly for eight hour each day, we see and hear things happening at a rate of about one per second. So the total number of events that happen to us is about thirty thousand per day, or about a million per month. With few exceptions, these events are not miracles because they are insignificant. The chance of a miracle is about one per million events. Therefore we should expect about one miracle to happen, on the average, every month

Freeman Dyson

Morgan Housel’s latest book, Same as Ever’, continues from where he left off in his earlier very popular, “The Psychology of Money”. It’s about human psychology and its inability to comprehend probability.

The brain always craves certainty or a black-or-white world. And even trained people find it challenging to reconcile with the math behind chances. The lottery winning odds, as perceived by journalists in the last post, is just one example of that. The result is that newspapers continue to display shocking headlines, reinforcing people’s trust in magic and divine interventions.

Here is an example: in a world with 8 billion humans, how many rarest of rare events, i.e., something with a probability of occurrence of once in a billion in a year, happens in a year? It seems difficult to imagine 8 billion people interacting with their surroundings is analogous to 8 billion independent binomial trials:

P(s; p, n) = nCs x ps (1-p)n-s

The formula represents the probability of s number of ‘success’ if n number of independent trials happen, each with a chance of p. In our problem, substitute n with 8 billion and p with 1/1,000,000,000.

The probability of no ‘miracle’ happening in a year, i.e., s = 0.

P(0; 1×10-9, 8×109) = 1 x 1 x (1-1×10-9)8e9

The answer is almost ZERO; subtracting 10-9 from 1 gives a fraction just short of 1, which multiplies by itself a few billion times, and the answer leads to nearly nothing.

You can evaluate the formula for s = 1, 2, etc. We will use the R function for that and plot.

s <- seq(0,15)
plot(s, dbinom(s, 8e9, 1e-9))

There is more than a 10% chance to see 5, 6, 7, 8, 9 or 10 miracles in a given year. The only thing is: it can’t say where it will happen; it will happen somewhere, and the journalist will dig it up to her headlines.

Monthly Miracle Read More »

Coincidences and A Double Lottery Winner

In 1985, Evelyn Marie Adams won $3.9 million in the New Jersey lottery. Four months later, in 1986, she won again; it was $1.4 million this time! The New York Times ran an article claiming that the probability of such an event was one in 17 trillion. Their argument must have been:

The probability of winning the first lottery – 6 numbers out of 39:
1/39C6 = 1/3262623
The probability of winning the first lottery – 6 numbers out of 42:
1/42C6 = 1/5245786
The chance of her winning both = (1/3262623)x(1/5245786) = 1/17 x 1012

This was actually the correct answer to a wrong question. The question should have been:
What is the probability that both tickets will be winners if you buy precisely two tickets for the New Jersey state lottery?”

Instead, the probability here was:
What is the chance that someone, out of millions of people buying lottery tickets each week in the United States, hits the lottery twice in four months?

Stephen Samuels and George McCabe of the Department of Statistics at Purdue University, who wrote in the newspaper’s opinion column, estimated that to be 1 in 30.

Reference

More Lottery Repeaters Are on the Way: NYT

Coincidences and A Double Lottery Winner Read More »

Weibull and Rayleigh Distributions

We have seen Weibull before. It is a continuous probability distribution that finds applications in various fields, such as engineering and reliability analysis. It is because of the flexibility to adapt to different shapes: uniform, left, or right-skew.

The shape and scale are the names of two typical parameters in a Weibull distribution. Depending on their values, one can get shapes such as:

Shape between 1 and 2.6: Right-skewed

xx <- seq(0,20, 0.1)
plot(xx, dweibull(xx, shape = 2, scale = 4))

Shape ~ 3 Uniform

Shape > 3.7 Left-Skewed

The Rayleigh distribution is a special case of the Weibull distribution. Rayleigh has one parameter, namely the scale. If The Rayleigh scale parameter is A, the corresponding Weibull has a scale = sqrt(2)xA and shape = 2. Here is a comparison between Rayleigh and Weibull for a Rayleigh scale= 3.

xx <- seq(0,20, 0.1)
plot(xx, drayleigh(xx, scale = 3), type = "l", ylim = c(0,0.25), lwd = 3, xlab = "X", ylab = "Density")
lines(xx, dweibull(xx, shape = 2, scale = sqrt(2)*3), type = "l", ylim = c(0,0.25), col = "red", lwd = 5, lty=3)

Here, Black represents the Rayleigh and red the Weibull.

Weibull and Rayleigh Distributions Read More »

Again Russian Roulette

Suppose a person is forced to play the Russian Roulette. Here is how it works: the person must try two, each time spinning a six-chambered revolver before pulling the trigger. He also gets two options to choose from: 

  1. A revolver with two bullets in it
  2. Randomly select one of the two revolvers – one carrying three bullets and the other with one bullet.
    Which is a better choice?

Let’s evaluate the survival chance of each:

1. Revolver with two bullets firing two times:
Probability survival after two rounds (randomised and made independent by spinning the barrel each time) = (4/6)x(4/6) = 0.44
2a. Revolver with three bullets:
(3/6)x(3/6) = 0.25
2b. Revolver with one bullet:
0.69

The chance of 2a or 2b to occur is 50:50. Therefore, the overall probability in the second case is (1/2) x (0.25 + 0.69) = 0.47

well, the second option gives a slightly better chance of survival!

Again Russian Roulette Read More »

Causal Diagrams

A causal diagram is a graphical representation of the relationship between variables. For example, the picture below describes a probability rule specifying how Y changes if X changes.

Back-door path

Is any path from X to Y that starts with an arrow pointing to X. Here is an example with a back-door path (X <- Z -> Y)

Whereas the picture below has no back-door path

Confounder

We know what a confounder is, and it is an example of a back-door path. The most famous example is the relationship between sunburn and ice cream sales! The data may show sunburn increases with ice cream sales. In contrast, the proper interpretation requires a back-door path in which a confounder, sunlight, causes both an increase in ice cream sales and sunburn.

Mediator

An example of a mediator is the case of an alarm for fire hazards. Here, smoke is a mediator; when a fire happens, the detector detects the smoke and sets off the alarm.

Causal Diagrams Read More »

Three Poisson Problems

The average number of bacteria per ml water is six. What is the probability of finding less than four bacteria in 1 ml of water?

This is an example of a problem that can be solved using the Poisson probability model. It involves a random variable, X, and it takes positive values. All we know is an expected value (average value), lambda. The probability is expressed as:

\\ P(X = s) = \frac{e^{-\lambda}\lambda^s}{s!}

In the bacteria problem, s is the total of all numbers less than four, i.e., 0+1+2+3 (P(X=0) + P(X=1) + P(X=2) + P(X=3). In R, it can be estimated as:

exp(-6)*6^0 / factorial(0) + exp(-6)*6^1 / factorial(1) + exp(-6)*6^2 / factorial(2) + exp(-6)*6^3 / factorial(3)
0.1512039

Even better: use the in-built function for the cumulative density function, ppois().

ppois(3,6, lower.tail = TRUE)

Recovery vehicle

There is a stretch of road in the city where, on average, five accidents happen during rush hour. The city council will purchase a recovery vehicle if the probability of having more than five accidents in the rush hour is more than 30%. Should the council go for a recovery vehicle?

Let’s use the R function:

ppois(5, 5, lower.tail = FALSE)

0.38

38% is above the cut-off value, so go for it!

Note that ppois(5, 5, lower.tail = FALSE) = 1 – ppois(5, 5, lower.tail = TRUE)

Birthday on Jan 1st

In a group of 30,000 married couples, what is the probability that at least one couple share their birthday on January 1?

Lambda, or the expected value, is the total number of couples x probability of a pair having the same given birthday. i.e., 30000 x (1/365) x (1/365) = 0.225.

At least 1 = 1 – P(X=0)

1 - dpois(0,0.225)
0.20

or

ppois(0, 0.225, lower.tail = FALSE)

Three Poisson Problems Read More »