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. An organization allows its employees to work independently on consultancy projects but charges an overhead on the consulting fee. The overhead is 20% of the consulting fee, if the fee is up to . 5,00,000. For higher fees, the overhead is . 1,00,000 plus 10% of the amount by which the fee exceeds . 5,00,000. The government charges a Goods and Services Tax of 18% on the total amount (the consulting fee plus the overhead). An employee of the organization charges this entire amount, i.e., the consulting fee, overhead, and tax, to the client. If the client cannot pay more than . 10,00,000, what is the maximum consulting fee that the employee can charge?
  2. Three frictionless pulleys with rope attachment are in a static equilibrium as shown in the figure. The mass $m_1$ and $m_2$, in kg, respectively are

  3. If the in-situ density of coal is 1320 kg/m$^3$ and the density of blasted coal is 952 kg/m$^3$, the swell factor is _____________ (rounded off to 3 decimal places)

  4. A five-member truss system is shown in the figure. The maximum vertical force P in kN that can be applied so that loads on the member CD and BC do NOT exceed 50 kN and 30 kN, respectively is _____________(rounded off to 2 decimal places)

  5. The Fourier transform and its inverse transform are respectively defined as $\tilde{f}(\omega) = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{+\infty} f(x)e^{i\omega x}dx$ and $f(x) = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{+\infty} \tilde{f}(\omega)e^{-i\omega x}d\omega$. Consider two functions $f$ and $g$. Another function $f * g$ is defined as 
    $(f * g)(x) = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{+\infty} f(y)g(x - y)dy$ 
    Which of the following relation is/are true? 
    Note: Tilde ($\sim$) denotes the Fourier transform.

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