Multiset coefficients

Content created by Fredrik Bakke, Jonathan Prieto-Cubides and Egbert Rijke.

Created on 2022-08-07.
Last modified on 2024-10-09.

module elementary-number-theory.multiset-coefficients where
Imports
open import elementary-number-theory.addition-natural-numbers
open import elementary-number-theory.natural-numbers

Idea

The multiset coefficients count the number of multisets of size k of elements of a set of size n. In other words, it counts the number of connected componets of the type

  Σ (A : Fin n → 𝔽), ║ Fin k ≃ Σ (i : Fin n), A i ║.

The first few numbers are

n\k012345
0100000
1111111
2123456
3136101521
41410203556
515153570126

Definition

multiset-coefficient :     
multiset-coefficient zero-ℕ zero-ℕ = 1
multiset-coefficient zero-ℕ (succ-ℕ k) = 0
multiset-coefficient (succ-ℕ n) zero-ℕ = 1
multiset-coefficient (succ-ℕ n) (succ-ℕ k) =
  (multiset-coefficient (succ-ℕ n) k) +ℕ (multiset-coefficient n (succ-ℕ k))

Recent changes