Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is a repost, please answer each part cohesively/simply this time!!! Whoever has answered the previous one I posted, please do not answer this, because

image text in transcribed

image text in transcribed

This is a repost, please answer each part cohesively/simply this time!!! Whoever has answered the previous one I posted, please do not answer this, because the solution was too confusing for me to understand, sorry.

2. Bob decides it is not worth his time to delve into cryptocurrency investment and finds an actual job. Alice's bakery has a vandalism problem. Someone keeps changing her sign to show funny expressions. Bob offers to change the sign back, for a fee. Today, Alice wants bite-crusty-uncles changed back to light-crusts-on-cake. To make this change, Bob considers each letter individually; for each letter, Bob can remove it or replace it with another letter, or Bob can add a new letter. Spaces count as letters. For adding a letter, Bob charges $8. For removing a letter, Bob charges $3. For replacing a letter with a different letter, Bob charges $7. Bob does not charge for leaving letters unchanged. For the first part of the string, Bob planned to make the changes shown on the left and charge $19. Alice found a cheaper matching (shown at right) using dynamic programming. bi te b i ght i ght 7 08 7 7 0 8 8 0 3 0 i t e 7 0 She used a two-dimensional array to keep track of the cheapest matches to make. bit ecrusty - u cies 17 10 13 16 19 i n 7 10 16 13 17 190K 14 Il Saldi 15 23 31 39 47 g h 20 |E||E 15 23 31 39 t 22 23 31 21 26 30 24 28 26 Each entry in the table represents the cheapest way to change the text-up-to-the-column into the text-up-to-the-row. For example, the 30 is the cost of changing bite into light-. The value 18 was determined by considering three possibilities: i. Starting with bite, first change it to light. Then adding - costs $8. This is added to the cost of changing bite to light, which is $?. The total would be $?. ii. Starting with bite, first remove e. This costs $3. Then bit changes to light-, which costs $31. The total would be $34. iii. Starting with bite, replace e with - This costs $7. This is added to the cost of changing bit to light, which is $23. The total would be $30. The cheapest option of the three possibilities is the last, so the table is filled with 30. (a) In iii., $23 was found from the table entry in the row labeled t and column labeled t. What table entry is used to determine the cost of i.? Find the cost of i. (3 points) (b) Describe how to calculate the costs of the three possibilities for general text or for a general location in the table. Be specific about which table entries are used. (6 points) (c) Fill in the rest of the table. What is the minimum cost of changing bite-crusty-uncles to light-crusts-on-cake? (8 points)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design And Implementation

Authors: KROENKE DAVID M.

1st Edition

8120322258, 978-8120322257

More Books

Students also viewed these Databases questions