All Exams Test series for 1 year @ ₹349 only
Question

Levenshtein distance is used to measure the minimum edit distance between two strings by counting the minimum number of editing operations (such as, insertions, deletions, substitutions) required to transform one string to another. Consider an alternative version of the Levenshtein distance in which each insertion and each deletion has a cost of 1 and substitutions are not allowed.

Based on this alternative version, the Levenshtein distance between the strings, word and work is ______ (Answer in integer).

To calculate the alternative Levenshtein distance between the strings "word" and "work" with each insertion and deletion costing 1 and no substitutions allowed, we proceed as follows:

  1. Compare the strings character by character:
    • "word": w, o, r, d
    • "work": w, o, r, k
  2. The first three characters (w, o, r) are identical in both strings, requiring no edits.
  3. The 4th character differs: "d" in "word" vs "k" in "work". Since substitutions are not allowed, we need to perform an insertion followed by a deletion.
    • Delete "d" from "word" (cost: 1)
    • Insert "k" into "word" (cost: 1)
  4. The total cost for completing the transformation from "word" to "work" is 1 + 1 = 2.

In conclusion, the alternative Levenshtein distance is 2, which fits within the specified range of (2,2).

Was this answer helpful?

Important Questions from Numerical Computation

  1. In an engineering college of 10,000 students, 1,500 like neither their core branches nor other branches. The number of students who like their core branches is 1/4th of the number of students who like other branches. The number of students who like both their core and other branches is 500.
    The number of students who like their core branches is

  2. $A$ is an ($n \times n$) matrix. Consider the following two statements 

    Statement 1: Columns of matrix $A$ are linearly independent 

    Statement 2: Inverse of matrix $A$ exists 

    Which one of the following statements is TRUE?

  3. Consider the function $G(x, y, z) = 0$. This function allows us to implicitly define each of three variables as a function of the other two variables. Assume that all partial derivatives of the function $G(x, y, z)$ exist everywhere. Then, the value of $\left(\frac{\partial z}{\partial x} \times \frac{\partial x}{\partial y} \times \frac{\partial y}{\partial z}\right)$ is _________ (in integer)
  4. In a given collection of documents, let $N$ be the total number of documents and let $d$ be the number of documents in which the term $t$ occurs.

    Which ONE of the following fractions is used to define the inverse document frequency (idf) of the term $t$?
  5. The total number of unique character bigrams in the string thoughtsoftheghosts (which contains 19 characters) is ______.
Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App