I am investigating the following problem: I have a large set of values, many of which are repeated. Measuring the number of distinct (or unique) values shows that their number grows much slower than the number of total values, so that with 2M values I get just ~260k distinct values, with 20M values it goes up to just ~750k distinct, and after processing 40M values there are just under a million distinct values.
The values are real-world data points created by joining together a number of variables, each of which may take a (potentially large but finite) set of values. These variables are not necessarily independent; on the contrary, they are most likely dependent on each other.
Intuitively the values must follow some kind of power law distribution, but I cannot fit the values to a satisfying formula. I can tell you it is not an exponential curve because it isn't straight on a log-log plot; it does not appear to be logarithmic either.
The questions that I would like to answer are:
- How many distinct values should I see after processing a given number of values?
- What is the distribution
f(x)
of distinct values? So thatf(1) = 1
(since the first value is certainly distinct) andf(2e6) ~ 261620
. - What are the parameters of the distribution? So I can measure them after changing (or adding or removing) some of the independent variables and see how it affects the number of distinct values.
- Related to the above, how does each variable contribute to the number of distinct values? I can experiment numerically, but I would like to be able to characterize the results using numerical parameters. This would tell me how dependent variables are.
- For bonus points: how can I find out how many bits of information each variable carries? This will be related to how dependent it is.
I have not found on the Wikipedia any info about distinct values; in the literature there are some articles such as this one but they don't delve on the number of distinct values. Apparently this is called a "birthday problem". Any help is appreciated.
Note: initially asked on math.stackexchange.com, where it has been closed.
The actual numbers follow (values, distinct values):
1, 1
2000000, 261620
4000000, 367883
6000000, 446604
8000000, 511565
10000000, 565090
12000000, 610213
14000000, 649240
16000000, 684861
18000000, 717790
20000000, 746938
25000000, 810937
30000000, 865702
35000000, 915417
40000000, 966590