Here there are many ways to go. As didymus was saying, it really depends on how one chooses to model the phenomenon. I propose a game where players have different payoff functions. As a matter of fact, having a large number of players with heterogeneous preferences is probably a more realistic model of the phenomenon we are trying to describe and it allows to obtain situations where not everybody get vaccined, but let's try to keep the game as simple as possible. I will assume that the game is simoultaneous, as this is the framework where Nash Equilibrium make sense.
Imagine a game with N players, each of them can choose either VAX or NO-VAX. There is a "herd-immunity" threshold n. Let us divide the players into three groups (A, B and K)
Description of the players:
Assume that a portion A (smaller than N) of them have a payoff function that makes VAX a strictly dominant strategy. These might be people that believe in vaccines no matter what, or people that want to get vaccinated because they are scared of the disease and they want to avoid getting seriously sick.
Assume also that a portion B (small enough that A + B is smaller or equal to N) has NO-VAX as strictly dominant strategy.
Finally, let us say that the rest of the population K (equal to N minus A minus B) is worried about the epidemic aspect of the disease, but these agents don't like the idea of getting vaccined and see the vaccine as a cost (say, -3). Thus, they will take the vaccine if this leads to herd-immunity, but they'd rather not. These agents's payoff functions are as follows:
i) if the total number of people getting the vaccine is above the herd immunity threshold (n), and player i chose NO-VAX, player i gets 10;
ii) if the total number of people getting the vaccine is below herd immunity and player i chose NO-VAX, player i gets 0;
iii) if the total number of people getting the vaccine is above the herd immunity threshold (n), and player i chose VAX, she gets 7;
iv) if the total number of people getting the vaccine is below herd immunity and player i chose VAX, she gets -3;
Nash Equilibrium analysis
Before starting, let us distinguish into different cases. Cases 1, 2 and 3 are immediate and maybe non-interesting, but they show easy ways to obtain Nash Equilibria with heterogeneous behaviors. Skip direclty to case 4 for something more interesting.
- A + B = N (simplest case: all players have str dominant strategies)
In this case, the only Nash Equilibrium is: players in the A group play VAX, players in the B group play NO-VAX. (And this means that if A is smaller than the herd-immunity thershold n, then herd-immunity won't be reached)
- A + B < N (some players have no dominant strategy) and K + A < n (herd-immunity cannot be reached)
As before, players in A choose VAX and players in B choose NO-VAX. Since herd-immunity cannot be reached, players in the group K won't get any benefit getting vaccined. Since these agents see getting vaccined as a cost, they will all choose NO-VAX.
- A + B < N (some players have no dominant strategy) and A > n (herd-immunity is automeatically reached, only with agents in group A)
As before, players in A choose VAX and players in B choose NO-VAX. Here there is a (unique, I believe) Nash Equilbrium where all players in A choose VAX, and all players in B and K choose NO-VAX. Agents in K choose NO-VAX because herd-immunity threshold is reached even without them, so they can enjoy the benefit of herd-immunity without bearing the costs of taking the vaccine. (They get 10 with NO-VAX and 7 with VAX, hence no profitable deviation here)
- A + B < N (some players have no dominant strategy) and K + A > n (herd-immunity can be reached)
Here we get to the "interesting" case. As usual, players in group A all choose VAX and those in B all choose NO-VAX.
Now, we assumed that n is the number of vaccinated people that would lead to herd-immunity. So, we need still (n - A) player to choose VAX in order to obtain herd-immunity. There is a nash equilibrium where z (= n - A) players of group K choose VAX and the others choose NO-VAX.
To be sure this is a Nash Equilibrium, we need to check that there is no profitable deviation for a player, GIVEN the actions of the other players. We can focus just on players in group K, as players in group A and B have strictly dominant strategies.
player i is among the z-group (those playing VAX): payoff = 7
Say that player i deviates and plays NO-VAX. What happens? We take others'
actions as given, so there are (z - 1) + A < n players choosing VAX:
herd-immunity is not reached.
Player i obtains a payoff of 0 < 7. Hence, player i has no profitable
player i is not in the z-group (those playing VAX): payoff = 10 (he's playing NO-VAX)
Herd-immunity has already been reached. If player i chooses VAX, he gets
7 < 10. Hence, player i has no profitable deviation.