Skip to content

Instantly share code, notes, and snippets.

@ricbit
Created April 17, 2021 01:38
Show Gist options
  • Save ricbit/79d4a639885da821302fccea7244cfbb to your computer and use it in GitHub Desktop.
Save ricbit/79d4a639885da821302fccea7244cfbb to your computer and use it in GitHub Desktop.
Expected number of packs to complete an album
row[n_] := Table[
Binomial[n, 4-(k-n)] Binomial[180-n, k-n] / Binomial[180, 4],
{k, 0, 180}]
m = Table[row[k], {k, 0, 180}]
r = m[[1;;180, 1;;180]]
Print[N[Total[Inverse[IdentityMatrix[180] - r][[1]]]]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment