3 ms·
Very much so. Edit: To determine the number of records created from permuting a single string, use this: for (r = 1; r <= e; r++) numRecs += (fact(n)
by LordGrey 5y ago
Very much so.
Edit: To determine the number of records created from permuting a single string, use this:
for (r = 1; r <= e; r++)
numRecs += (fact(n) / (fact(r) * fact(n - r)));
where e = edit distance and n = length of string. fact() is your standard factorial function.
- idealmedtech 5y agoThis actually has a closed form! numRecs = -1 + 2^n + (n nCr e+1) * 2F1(1, e-n+1; e+2; -1) n nCr k combinatorial choice, 2F1 is the hypergeometric function
- cb321 5y agoIn a dictionary with more than a few words, some "created corruptions" in the lookup table/index collide with each other. (EDIT: e.g. for "hand" and "and" the overlap of the deletion-corrupted sets is substantial.) You only know which/how many by running the algo against a concrete dictionary. So, these expressions are at best a rough guide.