Skip to main content
Notice removed Draw attention by Simd
Bounty Ended with gsitcia's answer chosen by Simd
added 4 characters in body
Source Link
Simd
  • 3.2k
  • 1
  • 9
  • 56

I have string \$s\$ of length \$n\$ and some constant integer \$k\$ which is at most \$n\$. Give the fastest algorithm to sample a random string with Levenshtein distance \$k\$ from \$s\$ uniformly.

Your algorithm should output any of the strings with edit distance exactly \$k \leq n\$ from the input string \$s\$ with the same probability. You should assume that only the characters in the string \$s\$ are used.

For example, if \$s\$ = "1111011010" the number of strings with distance \$k\$ is

 k | # of results

 0              1
 1             28
 2            302
 3           1652
 4           5533
 5          14533
 6          34808
 7          80407
 8         180663
 9         395923

If \$k\$ = 9 you should output one of the 395923 possible output strings chosen uniformly at random.

I have string \$s\$ of length \$n\$ and some constant integer \$k\$ which is at most \$n\$. Give the fastest algorithm to sample a random string with Levenshtein distance \$k\$ from \$s\$ uniformly.

Your algorithm should output any of the strings with edit distance exactly \$k \leq n\$ from the input string \$s\$ with the same probability. You should assume that only the characters in the string \$s\$ are used.

For example, if \$s\$ = "1111011010" the number of strings with distance \$k\$ is

 k | # of results

 0              1
 1             28
 2            302
 3           1652
 4           5533
 5          14533
 6          34808
 7          80407
 8         180663
 9         395923

If \$k\$ = 9 you should output of the 395923 possible output strings chosen uniformly at random.

I have string \$s\$ of length \$n\$ and some constant integer \$k\$ which is at most \$n\$. Give the fastest algorithm to sample a random string with Levenshtein distance \$k\$ from \$s\$ uniformly.

Your algorithm should output any of the strings with edit distance exactly \$k \leq n\$ from the input string \$s\$ with the same probability. You should assume that only the characters in the string \$s\$ are used.

For example, if \$s\$ = "1111011010" the number of strings with distance \$k\$ is

 k | # of results

 0              1
 1             28
 2            302
 3           1652
 4           5533
 5          14533
 6          34808
 7          80407
 8         180663
 9         395923

If \$k\$ = 9 you should output one of the 395923 possible output strings chosen uniformly at random.

Notice added Draw attention by Simd
Bounty Started worth 50 reputation by Simd
latex consistency. Also removed an unwarranted question mark that had been bothering me
Source Link
thejonymyster
  • 2.6k
  • 15
  • 46

I have string s\$s\$ of length n\$n\$ and some constant integer k\$k\$ which is at most n\$n\$. Give the fastest algorithm to sample a random string with Levenshtein distance k\$k\$ from s\$s\$ uniformly?.

Your algorithm should output any of the strings with edit distance exactly \$k \leq n\$ from the input string s\$s\$ with the same probability. You should assume that only the characters in the string s\$s\$ are used.

For example, if s\$s\$ = "1111011010" the number of strings with distance k\$k\$ is

 k | # of results

 0              1
 1             28
 2            302
 3           1652
 4           5533
 5          14533
 6          34808
 7          80407
 8         180663
 9         395923

If k\$k\$ = 9 you should output of the 395923 possible output strings chosen uniformly at random.

I have string s of length n and some constant integer k which is at most n. Give the fastest algorithm to sample a random string with Levenshtein distance k from s uniformly?

Your algorithm should output any of the strings with edit distance exactly \$k \leq n\$ from the input string s with the same probability. You should assume that only the characters in the string s are used.

For example, if s = "1111011010" the number of strings with distance k is

 k | # of results

 0              1
 1             28
 2            302
 3           1652
 4           5533
 5          14533
 6          34808
 7          80407
 8         180663
 9         395923

If k = 9 you should output of the 395923 possible output strings chosen uniformly at random.

I have string \$s\$ of length \$n\$ and some constant integer \$k\$ which is at most \$n\$. Give the fastest algorithm to sample a random string with Levenshtein distance \$k\$ from \$s\$ uniformly.

Your algorithm should output any of the strings with edit distance exactly \$k \leq n\$ from the input string \$s\$ with the same probability. You should assume that only the characters in the string \$s\$ are used.

For example, if \$s\$ = "1111011010" the number of strings with distance \$k\$ is

 k | # of results

 0              1
 1             28
 2            302
 3           1652
 4           5533
 5          14533
 6          34808
 7          80407
 8         180663
 9         395923

If \$k\$ = 9 you should output of the 395923 possible output strings chosen uniformly at random.

Post Reopened by Command Master, Wheat Wizard
deleted 21 characters in body
Source Link
Wheat Wizard
  • 102.9k
  • 23
  • 299
  • 698

I have string s of length n and some constant integer k which is at most n. Give the fastest algorithm to sample a random string with edit (also known as Levenshtein) distance k from s uniformly?

Your algorithm should output any of the strings with edit distance exactly \$k \leq n\$ from the input string s with the same probability. You should assume that only the characters in the string s are used.

For example, if s = "1111011010" the number of strings with distance k is

 k | # of results

 0              1
 1             28
 2            302
 3           1652
 4           5533
 5          14533
 6          34808
 7          80407
 8         180663
 9         395923

If k = 9 you should output of the 395923 possible output strings chosen uniformly at random.

I have string s of length n and some constant integer k which is at most n. Give the fastest algorithm to sample a random string with edit (also known as Levenshtein) distance k from s uniformly?

Your algorithm should output any of the strings with edit distance exactly \$k \leq n\$ from the input string s with the same probability. You should assume that only the characters in the string s are used.

For example, if s = "1111011010" the number of strings with distance k is

 k | # of results

 0              1
 1             28
 2            302
 3           1652
 4           5533
 5          14533
 6          34808
 7          80407
 8         180663
 9         395923

If k = 9 you should output of the 395923 possible output strings chosen uniformly at random.

I have string s of length n and some constant integer k which is at most n. Give the fastest algorithm to sample a random string with Levenshtein distance k from s uniformly?

Your algorithm should output any of the strings with edit distance exactly \$k \leq n\$ from the input string s with the same probability. You should assume that only the characters in the string s are used.

For example, if s = "1111011010" the number of strings with distance k is

 k | # of results

 0              1
 1             28
 2            302
 3           1652
 4           5533
 5          14533
 6          34808
 7          80407
 8         180663
 9         395923

If k = 9 you should output of the 395923 possible output strings chosen uniformly at random.

added 95 characters in body
Source Link
Simd
  • 3.2k
  • 1
  • 9
  • 56
Loading
Post Closed as "Needs details or clarity" by Luis felipe De jesus Munoz, Jonah, emanresu A, Wheat Wizard
added 69 characters in body
Source Link
Simd
  • 3.2k
  • 1
  • 9
  • 56
Loading
added 500 characters in body
Source Link
Simd
  • 3.2k
  • 1
  • 9
  • 56
Loading
Source Link
Simd
  • 3.2k
  • 1
  • 9
  • 56
Loading