Sum of distinct count of all subsets

Revision en1, by bihariforces, 2023-08-24 12:51:43

Given an array $$$arr$$$ of length $$$N$$$, find the sum of count of unique values in a subset for every subset of $$$arr$$$, modulo $$$10^9 + 7$$$.

I can see that the result depends only on frequency of distinct values, and seems like some combinatorial trick, it's a made up question but seems standard, what is the most optimal solution for length $$$N$$$ array?

Tags combinatorics, counting, dynamic programming, math

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English bihariforces 2023-08-24 12:51:43 384 Initial revision (published)