egttools.games.opinion_game.calculate_nb_states

calculate_nb_states(group_size: int, nb_strategies: int) object

Calculates the number of states (combinations) of the members of a group in a subgroup.

It can be used to calculate the maximum number of states in a discrete simplex.

The implementation of this method follows the stars and bars algorithm (see Wikipedia).

Parameters
  • group_size (int) – Size of the group (maximum number of players/elements that can adopt each possible strategy).

  • nb_strategies (int) – number of strategies that can be assigned to players.

Returns

Number of states (possible combinations of strategies and players).

Return type

int

See also

egttools.numerical.calculate_state, egttools.numerical.sample_simplex