shapiq.utils.count_interactionsΒΆ

shapiq.utils.count_interactions(n, max_order=None, min_order=0)[source]ΒΆ

Counts the number of interactions for a given number of players and maximum order.

Parameters:
  • n (int) – Number of players.

  • max_order (int | None) – Maximum order of the interactions. If None, it is set to the number of players. Defaults to None.

  • min_order (int) – Minimum order of the interactions. Defaults to 0.

Return type:

int

Returns:

The number of interactions.

Examples

>>> count_interactions(3)
8
>>> count_interactions(3, 2)
7
>>> count_interactions(3, 2, 1)
6